CorTeX DocsOpen CorTeX
Open CorTeX
Browse all topics

Format text in LaTeX

Apply emphasis, boldface, and monospaced text while keeping meaning separate from appearance.

On this page

Good manuscript source records meaning rather than imitating a final page. Use LaTeX's text commands for local emphasis and define semantic commands for terms that must remain consistent when a venue changes its style.

Format by purpose#

Use \emph for emphasis, \textbf for a label that needs visual emphasis, and \texttt for code, identifiers, or file names. Braces limit each command's scope.

LaTeX source
\documentclass{article}
\newcommand{\modelname}{\textsc{FlowNet}}
\begin{document}
We compare \modelname{} with the \emph{unregularized} baseline.
The primary outcome is \textbf{prediction error}; configuration is stored in
\texttt{models/base.yaml}.

At 95\% confidence, the mean changed from 1.8~m to 2.1~m---a 0.3~m increase.
The samples labeled ``control'' and ``treated'' were analyzed separately.
\end{document}
Compiled result
Open in CorTeX

The result uses one consistent style for the model name, preserves spaces between numbers and units, prints an em dash without surrounding spaces, and uses LaTeX quotation marks. Change the body of \modelname once to see every occurrence update.

Write punctuation and special characters safely#

Several characters control LaTeX syntax. Use \%, \&, \_, \#, \$, \{, and \} when those marks should print literally. Use \textbackslash, \textasciitilde, and \textasciicircum for a backslash, tilde, and caret in text. A bare % starts a comment, while bare _ and ^ belong to mathematics.

For English typography, type two grave accents before a quotation and two apostrophes after it:

``control''

Write a hyphen in finite-element, an en dash as -- in 2019--2024, and an em dash as ---. A nonbreaking space, ~, keeps a value with its unit or a label with its number: 10~ms, Figure~3.

Avoid visual fixes that fight the template#

Do not build headings with \textbf, scatter font-size commands through the paper, or force capitalization with \MakeUppercase. Case-changing commands can damage chemical formulas, identifiers, and author names. Use the document class's section and caption commands, and preserve the capitalization required by the venue.

Custom commands are most useful when their names express meaning, such as \modelname, rather than appearance, such as \bluebold. Before submitting, check whether the venue template already defines the term or forbids custom formatting.

As an exercise, add the sentence The R\&D data contain 25\% missing values in \texttt{subject\_id}. and compile it. You are done when &, %, and _ print rather than changing the source grammar. Continue with lists and spacing.