Code Check
The Overleaf editor includes a syntax-checker (known as "Code Check") which highlights common errors as you type.
The errors Code Check can find are:
- Mismatched
\begin
and\end
commands - Mismatched LaTeX group delimiters
{ }
- Mismatched
\left
and\right
delimiters - Mismatched math mode delimiters
$..$
and$$..$$
- Math commands used outside math mode
- Text commands used inside math mode
Code Check uses heuristics and assumes that the document is typical LaTeX, using only standard commands, e.g. every \begin{}
has a corresponding \end{}
.
Code Check Limitations
If your project uses your own LaTeX or TeX macros, or packages which change standard LaTeX behaviour, you may find that Code Check needs to be turned off -- you can do this globally, for a single file, or for part of a file.
In particular, if you use macros as shortcuts for standard LaTeX environments (e.g. \newcommand{\beq}{\begin{equation}}
) these will not be expanded and you should disable Code Check.
Disabling Code Check globally
If you don't want to use Code Check at all you can turn it off in the left menu: Click on the Overleaf menu icon above the file list panel, and then look for "Settings - Code Check".
Disabling Code Check for a single file
To turn off Code Check for a single file, put the comment %%novalidate
at the top of the file. (N.B. to avoid conflicts we use a double comment character).
%%novalidate
% complex macro definitions or Tikz figures
% ...
Disabling Code Check for part of a file
You can also turn off Code Check for part of a file
This part of the file is checked with Code Check
%%begin novalidate
This part is not checked
%%end novalidate
This part will also be checked with Code Check
Known issues
- Url, verbatim and other commands where
%
is a literal character can give false errors when there is subsequent LaTeX code on the same line as the command. A workaround is to start a new line after any\url{}
or other commands containing literal%
characters.
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Debugging Compilation timeout errors
- How-to guides
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Fractions and Binomials
- Aligning Equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management in LaTeX
- Bibliography management with biblatex
- Biblatex bibliography styles
- Biblatex citation styles
- Bibliography management with natbib
- Natbib bibliography styles
- Natbib citation styles
- Bibliography management with bibtex
- Bibtex bibliography styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections and equations
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typing exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class
- Tips