LaTeX Error: Can be used only in preamble
translation: Xovee
translation time: June 11, 2020
LaTeX Error: Can be used only in preamble
This error occurs if you introduce a package or class in the body of the text, rather than in the preamble. Before the command \begin{document}, everything is called a prologue. In the prologue, you define the type of document, the language of the document, and many basic Settings. For example, the preface to a general document looks something like this:
\documentclass[12pt, letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\title{First document}
\author{Hubert Farnsworth \thanks{funded by the ShareLaTeX team}}
\date{February 2014}
If you introduce the package in the body (after \begin{document}) instead of in the preface, you will get this error:
To resolve this error, you must ensure that all packages introduce the command \usepackage{… }, and \ documentClass []{… }, before the \begin{document} command. If you want to learn more about LaTeX document structure, please refer to this document.
Read More:
- There will be row spacing problems in algorithm use in latex. Please use the ‘setstretch {1.35}
- Add a new page in latex
- The problem can not be viewed in the corner log of the Mac computer
- RuntimeError: cudnn RNN backward can only be called in training mode
- When SAP receives the goods, the system prompts that it can only be recorded in the period 2009 / 09 and 2009 / 08 of company code 1101
- Latex macro package and latex error: file ‘xxx. Sty’ not found
- How to Fix errors in Chinese input of latex
- An error is reported when installing the package directly in pycharm, but it can be installed through the terminal. Error non zero exit code (2)
- Three ways of latex supporting Chinese
- Greek letters in latex
- How to Use Subfigure in Latex
- Error in project operation org.springframework.beans . factory.BeanCreationException : error creating bean with name can be configured by
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- lerna WARN No packages found where npmlog can be added.
- Schema validation error in conig/config.xml. See the log for detais, Schema validation can be……
- Macfee can not be upgraded, the prompt returns an error
- Error report on & written by latex in overleaf
- Solution: the network can be recovered only when the Ubuntu broadband is disconnected
- In many cases, the problem of error reporting by label in latex
- Android:Field can be converted to a local varible.