If you're writing a scientific book, a paper, or a thesis in computer science, engineering, mathematics, physics or a related field, it pays to write it using LaTeX, especially if your work contains formulas, symbols, and heavy cross referencing. Here is advice for doing so, collected over decades of writing hundreds of papers and books, mostly using LaTeX.
Note that this list is not intended to provide advice on English writing style, scientific writing, or TeX programming. There are many other excellent guides for all these topics.
Contributions to this guide via GitHub pull requests are always welcomed.
git init.git tag -a).
This allows you to go back to specific versions when going over review comments,
or when starting a version of a new publication venue.
Push the tags to the online repository you're using so that all can see them
(git push --tags).Obtaining metrics from large code bodies is difficult
for technical and operational reasons~\cite{Moc09,GS13}.
On the technical side,
code dependencies make it difficult to establish
the full context needed in order to parse and semantically analyse the code.
This is especially true for C code,
where the compilation depends on
system header files,
compiler-defined macros,
search paths, and
compile-time flags passed through the build process~\cite{Spi03r,LKA11,GG12}.
The operational reasons are associated with the required throughput,
though due to the relatively small number of releases we examined,
this was not a major issue in this study.
git diff.)
Clean differences make it easier to see what has changed and to
merge changes of others when working as a group.%) to indicate the key idea of each
paragraph or section.XXX or TODO, to indicate places
where more work is needed.% {{{2) to facilitate this.
For example, if your document's structure is in sections and subsections,
these would be level-1 and level-2 folds.
You would then start each paragraph with a level-3 fold comment,
such as the following.% Advantages of model-based development {{{3
Avoid splitting short documents (such as a journal or conference paper)
into multiple files (e.g. introduction.tex, methods.tex, results.tex,
conclusions.tex).
Such splitting makes it difficult to perform a number of tasks with
your editor:
When the document is split, these tasks require you to switch from one file to another or to use external tools.
Split long documents (such as a book or a thesis) into multiple files,
e.g. one for each chapter,
in order to shorten the project's long build and loading time.
Use the \include command to include each chapter in the main document
and the \includeonly command to specify which parts shall appear
in the subset you are working on.
For guidance,
see this example.
Ensure that the document can be built with a single command, and that files that are out of date are appropriately rebuilt. This saves you from repeatedly executing multiple commands, makes it easier to work as a team, and avoids the accidental use of outdated files. You have the following options here.
SConstruct,
are Python scripts.
One such is demonstrated
here.
You may find a short overview of supported commands/packages
here.Once you have automated your build, you are ready for the next step: continuous integration (CI) for LaTeX documents. Executing an automated build on every commit allows you to easily spot accidentally forgotten auxiliary files such as images or tables. You can also easily isolate changes that broke the build and that are sometimes hard to debug later. Moreover, CI creates a defined way to build your project, on which every collaborator can rely on.
You can automate this process using the github-action-for-latex GitHub Action, or the travis-ci-latex-pdf solution for Travis CI.
While at it, consider integrating the running of linters into the build process.
Create one or more centrally-managed bibliography files for your
work, and list those in a \bibliography command in all documents you write.
You can use these tools
to share your references with others and navigate to them.
Using BibTeX or Biber you can then automatically create the document's list of references in the style prescribed by the publisher.
Use \cite commands to reference specific bibliographic entries.
Include multiple references in the same \cite command
(e.g. \cite{Doh19,Spi22}) rather than employing multiple \cite commands
(\cite{Doh19} \cite{Spi22}).
If you need to reference a specific page or chapter, include this information
in square brackets before the key.
For example, write: … educational use~\cite[p.~8]{LR89}.
If your publisher requires in-text author-year citations, use
BibLaTeX
or the
natbib package in conjunction
with the \citet, \citep, and \citeauthor commands.
For example, write:
\citet{jon90} proposed … to get Jones et al. (1990) proposed …Another argument \citep{jon90} … to get
Another argument (Jones et al., 1990) ….As \citeauthor{jon90} argued … to get
As Jones argued … (e.g. on a subsequent mention in the same paragraph).Include in your BibTeX entries all required fields and as many of the optional fields as possible. Copy and consult this file to remember which fields are available, which are required, and which are supported for each entry type.
Obtain a BibTeX entry for a publication's DOI using the doi2bib service. In many cases the quality of its results is higher than that provided by the publisher's digital library.
If you copy-paste a BibTeX entry from a digital library, edit it carefully to ensure a consistent high-level of quality.
The Elements of Programming Style, rather than
The elements of programming style.
This ensures that the title will appear correctly
if a particular bibliography style requires title capitalization.The {C} Programming Language, or Fifty Years of {M}oore's Law.
This ensures these characters will not be converted to lowercase
in bibliography styles that do not require title capitalization.{ICSE} '08: Proceedings of the 30th International Conference on Software Engineering.
It would be a mistake to use a different format, e.g.
12th Working Conference on Mining Software Repositories (MSR 2015), Proceedings of in another entry.doi = {10.1371/journal.pone.0294946}, rather than
doi = {https://doi.org/10.1371/journal.pone.0294946}.
The prefix can be easily added when needed, and many bibliography formats
add it in the hyperlink without wasting space to show it.The Entity-Relationship Model---Toward a Unified View of Data or
The Evolution of {C} Programming Practices: A Study of the {U}nix Operating System 1973--2015.author = {Yann-Ga\"{e}l Gu\'{e}h\'{e}neuc and Herv\'{e} Albin-Amiot}.
This change may not be required if you are using
Biber, provided that
the digital library correctly provides the author names in Unicode.Use consistent, easily derivable, short names for your bibliography entries. One practical scheme is as follows.
Ker08 for an article published
by Brian Kernighan in 2008.DMG07 for an article published by
Duvall, Paul M. and Matyas, Steve and Glover, Andrew in 2007.a, b, c, etc appended to the above keys in the case
of clashes.Through this scheme you can easily search for an existing entry in your bibliography files and saved articles, because you can quickly derive the key used. Also this scheme will help you avoid duplicate entries, because the corresponding keys will clash.
If you save the PDF document associated with a bibliography entry in
your files, name it using the entry's key, e.g. LR89.pdf.
If you print (or photocopy) a document associated with a bibliography entry, write the corresponding key on its top right corner. This will help you reference it in your work. You can also use this key to file the printout so that you can find it in the future.
If you prefer to edit your BibTeX files with an application rather than a generic editor, consider using JabRef for the desktop or Bibtool on the command line.
Conference organizers and publishers often supply style files that determine the appearance and formatting of a document and its references. Download them and use them. If you're writing a thesis and your institution doesn't provide a template you can use this one. Seeing your document in its published look boosts your motivation, helps you appreciate how your readers will experience it, and minimizes rework by forcing you to comply with the publisher's requirements while you develop your document.
You can obtain many formatting goodies by incorporating into your document third-party LaTeX packages. Most LaTeX distributions provide a package management system that simplifies the installation and maintenance of packages. Here are some popular LaTeX packages your may want to know about.
\section and rather than specifying italic text use \emph.\newcommand{\finding}[1]{\textbf{#1}}
while the following environment declaration will list a software's license in a small font keeping its formatting.
\newenvironment{license}{\verbatim\scriptsize}{\normalsize\endverbatim}
\label command,
and reference them using the cleveref
\Cref command.see Figure~\ref{fig:foo});\Cref can create that for you:
see~\Cref{fig:foo}.tab:statResults rather than table1.
Use the tab: prefix when labelling tables,
the fig: prefix when labelling figures, and
the sec: prefix when labelling sections.\[
E = mc^2
\]
This formula states that the equivalent energy (\(E\))
can be calculated as the mass (\(m\)) multiplied
by the speed of light (\(c\)) squared.
\left and \right commands to markup (balanced)
bracketing elements.
This ensures that the elements will be correctly sized, according
to the formula they include.
For example, write \left(\cos(x) + i \sin(x)\right)^n.\mod, \max, or \sin.amsmath command \DeclareMathOperator,
e.g. \DeclareMathOperator{\sha}{sha}.\mathit{Delta} or
\mathrm{Delta}.x_{\mathrm{max}}F_{n} =
\cfrac{1}{\sqrt{5}} \left(\cfrac{1 + \sqrt{5}}{2}\right)^n
- \cfrac{1}{\sqrt{5}} \left(\cfrac{1 - \sqrt{5}}{2}\right)^n
\( math \) delimiters
to TeX's $ math $ style.\,.
Example:The atomic age started with the establishment of the mass–energy equivalence,
\[
E = mc^2 \,.
\]
It took \qty{7146}{s} to load a \qty{134}{\gibi\byte} file over a
\qty{200}{\mebi\bit} connection over a distance of \qty{9500}{\km}.
During the transfer \num{12345} packets were dropped.
The ambient temperature was \qty{-35}{\degreeCelsius}.
\hline and |) in tables.
They are unsightly and this is the reason you will rarely see them
in professionally typeset books.& separator to start each column's
data on the same LaTeX source document column.
See the following example.tr -cs & 1 & \X & -- & \V & 1 \\
sort w & 0 & & -- & \X & 0 \\
fmt & 1 & \X & -- & \V & 1 \\
tr A-Z & 1 & \V & 1 & & 1 \\
sort -u & fmt & \X & -- & \V & 1 \\
% Column labels
Command and options
& Input requirements
& Matched
& Connected
& Matched
& Connected \\
\hline
% Data
tr -cs & 1 & \X & -- & \V & 1 \\
sort w & 0 & & -- & \X & 0 \\
...
\toprule, \midrule and
\bottomrule from the booktabs package.
Example:\toprule
Header \\
\midrule
Table row 1 \\
Table row 2 \\
\bottomrule
.jpeg or .png image if you can include
a PDF created from vector data, e.g. by direct export from
Inkscape or
GraphViz or by converting an .svg file.\centering within a figure or table environment to center its
contents.
This avoids the extra space introduced by the center environment.Be consistent in the rules you follow. Some style guides offer contradicting advice. Examples include:
This isn't a license to randomly use both the one or the other alternative within the document. Adopt your publisher's style or consistently follow the same rule throughout your document.
Use three dashes (---) to create the em-dash,
which separates parenthetical phrases.
According to the Chicago Manual of Style (2.13),
an em-dash has no space before or after it.
(Note that The Associated Press Stylebook specifies spacing.)
Use two dashes (--) to create an en-dash.
Use this to specify number ranges, e.g. 2009--2015.
Separate numbers and the units these represent with a (non-breaking) space:
12~kB, 3.6~GHz.
No space is required for percentages and degrees: 90%, 45°.
Employ a thin space (\,) as a thousands separator, e.g. 123\,456.
Better yet, format your numbers with the
siunitx package:
\SI{90}{\percent}, \SI{45}{\degreeCelsius}, \SI{16}{\gibi\byte},
\SIlist{5; 10; 15}{\milli\metre}, \SI{9.81}{\metre\per\second\squared}
\SIrange{512}{1024}{\mebi\byte}, \num{1234566}.
(Note that the SI standard, in contrast to the Chicago Manual of Style,
specifies that a space should precede
°C and
%.
The siunitx package will consistently follow the appropriate rules.)
Use \dots to produce an ellipsis (…) punctuation symbol.
Put footnotes after punctuation symbols, unless your publisher's
style specifies otherwise.
For example, write … is true.\footnote{See also …}
Avoid underlined text. Underlining is used for emphasis in handwritten text and was also carried over in this capacity in typewritten documents. With modern printers and software you don't need to underline, because you can use a different font style (bold or italic) for emphasis.
Avoid sequences of uppercase text. Text written in all-uppercase characters is an eyesore and considerably more difficult to read than its lowercase equivalent. Lowercase letters have been designed for easy reading, uppercase were originally designed for easy chiseling on stone.
Avoid using the itemize environment, when you're describing
elements. So, rather than itemize together with emphasized
item descriptions, use \paragraph{…} for multi-sentence elements
or the description environment with the described element passed
as an optional argument to item (\item[…]).
For example, rather than writing
\begin{itemize}
\item \textbf{RQ1} What is the meaning of life?
\end{itemize}
write
\begin{description}
\item[RQ1] What is the meaning of life?
\end{description}
Use small caps rather than an unsightly sequence of capital letters
for writing abbreviations.
For example, write \textsc{sql}, rather than SQL.
Note that some publishers do not follow this style.
If you are supplying the final camera ready version
(e.g. for conference proceedings), use small caps.
If a publisher will edit your document and the publisher does not use
small caps, avoid their use;
a common frustrating mistake is for publishers to remove the
\textsc command, without writing the text in uppercase.
Display pseudo-code using the algorithmicx package and environment. See this wikibooks entry for more details.
Display source code snippets using the listings (simpler) or the minted (nicer, but with extra dependencies) package. Make sure your code does not go over the paragraph length; if it does, adjust line breaking and/or font size accordingly.
Don't spend too much time on formatting your document. Concentrate on communicating your ideas and on making your document maintainable. Excessive formatting tweaks can be counterproductive: you waste time implementing them and your publisher may find it more difficult to use your document.
Use a tilde before \cite, \ref, etc. to avoid a line break immediately
before the reference.
For example, write Some also use logging statements~\cite{Spi06e}.
Put a backslash after a non-sentence ending period to ensure this will
not be followed by the sentence-ending spacing.
For example, write In 1962 Watson et al.\ famously found …
Do not use math mode to achieve typographic effects in plain text.
For example write RQ\textsubscript{2} rather than \(RQ_2\), if you
must subscript the number of your research question 2.
Similarly use \textsuperscript for plain superscripted text (e.g.
Wisper Quiet\textsuperscript{TM}).
Match opening and closing quotes using one or two single-opening
(‘ or ‘‘) and single-closing (’ or ’’) quote characters.
Do not use the keyboard's double quote symbol (").
Alternatively you can use the \enquote{} macro from the csquotes
package, which will automatically set the right quotes for the
configure language and can handle nested quotes correctly.
Use the new local font style commands
(e.g. \texttt{}, \textsc{}, or \textbf{})
rather than the old switches (e.g. {\tt }, {\sc }, {\bf })
Run one or more of the LaTeX linters LaCheck
(with the lacheck command) and
ChkTeX (with the chktex command)
on your document to find and fix typesetting errors.
These check documents for certain LaTeX anti-patterns, such as the use of
... instead of the typographically correct \dots or other such violations.
Users can define their own rules, too, for example to enforce consistency
in the spelling of certain phrases.
Now it is up to you to create ChkTeX rules to enforce the guidelines in this
document.
If you do, please share them.
To obtain a PDF document with the widely available Times/Helvetica/Courier font set, rather than the LaTeX, less widely used, Computer Modern fonts, use the following packages.
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
This guide focuses on LaTeX document preparation. Nevertheless, here is some advice for improving your writing and for avoiding common mistakes.
\citet{Smi20} to obtain "Smith [12]" or "Smith (2020)"
(depending on the citation style),
or you can write \citeauthor{Smi20} to obtain "Smith".git log HEAD we were able to inspect the most recent changes."This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
1,114 followers · starred Nov 2023
88 followers · starred Aug 2023
155 followers · starred Aug 2017
641 followers · starred Dec 2022
If you're writing a scientific book, a paper, or a thesis in computer science, engineering, mathematics, physics or a related field, it pays to write it using LaTeX, especially if your work contains formulas, symbols, and heavy cross referencing. Here is advice for doing so, collected over decades of writing hundreds of papers and books, mostly using LaTeX.
Note that this list is not intended to provide advice on English writing style, scientific writing, or TeX programming. There are many other excellent guides for all these topics.
Contributions to this guide via GitHub pull requests are always welcomed.
git init.git tag -a).
This allows you to go back to specific versions when going over review comments,
or when starting a version of a new publication venue.
Push the tags to the online repository you're using so that all can see them
(git push --tags).Obtaining metrics from large code bodies is difficult
for technical and operational reasons~\cite{Moc09,GS13}.
On the technical side,
code dependencies make it difficult to establish
the full context needed in order to parse and semantically analyse the code.
This is especially true for C code,
where the compilation depends on
system header files,
compiler-defined macros,
search paths, and
compile-time flags passed through the build process~\cite{Spi03r,LKA11,GG12}.
The operational reasons are associated with the required throughput,
though due to the relatively small number of releases we examined,
this was not a major issue in this study.
git diff.)
Clean differences make it easier to see what has changed and to
merge changes of others when working as a group.%) to indicate the key idea of each
paragraph or section.XXX or TODO, to indicate places
where more work is needed.% {{{2) to facilitate this.
For example, if your document's structure is in sections and subsections,
these would be level-1 and level-2 folds.
You would then start each paragraph with a level-3 fold comment,
such as the following.% Advantages of model-based development {{{3
Avoid splitting short documents (such as a journal or conference paper)
into multiple files (e.g. introduction.tex, methods.tex, results.tex,
conclusions.tex).
Such splitting makes it difficult to perform a number of tasks with
your editor:
When the document is split, these tasks require you to switch from one file to another or to use external tools.
Split long documents (such as a book or a thesis) into multiple files,
e.g. one for each chapter,
in order to shorten the project's long build and loading time.
Use the \include command to include each chapter in the main document
and the \includeonly command to specify which parts shall appear
in the subset you are working on.
For guidance,
see this example.
Ensure that the document can be built with a single command, and that files that are out of date are appropriately rebuilt. This saves you from repeatedly executing multiple commands, makes it easier to work as a team, and avoids the accidental use of outdated files. You have the following options here.
SConstruct,
are Python scripts.
One such is demonstrated
here.
You may find a short overview of supported commands/packages
here.Once you have automated your build, you are ready for the next step: continuous integration (CI) for LaTeX documents. Executing an automated build on every commit allows you to easily spot accidentally forgotten auxiliary files such as images or tables. You can also easily isolate changes that broke the build and that are sometimes hard to debug later. Moreover, CI creates a defined way to build your project, on which every collaborator can rely on.
You can automate this process using the github-action-for-latex GitHub Action, or the travis-ci-latex-pdf solution for Travis CI.
While at it, consider integrating the running of linters into the build process.
Create one or more centrally-managed bibliography files for your
work, and list those in a \bibliography command in all documents you write.
You can use these tools
to share your references with others and navigate to them.
Using BibTeX or Biber you can then automatically create the document's list of references in the style prescribed by the publisher.
Use \cite commands to reference specific bibliographic entries.
Include multiple references in the same \cite command
(e.g. \cite{Doh19,Spi22}) rather than employing multiple \cite commands
(\cite{Doh19} \cite{Spi22}).
If you need to reference a specific page or chapter, include this information
in square brackets before the key.
For example, write: … educational use~\cite[p.~8]{LR89}.
If your publisher requires in-text author-year citations, use
BibLaTeX
or the
natbib package in conjunction
with the \citet, \citep, and \citeauthor commands.
For example, write:
\citet{jon90} proposed … to get Jones et al. (1990) proposed …Another argument \citep{jon90} … to get
Another argument (Jones et al., 1990) ….As \citeauthor{jon90} argued … to get
As Jones argued … (e.g. on a subsequent mention in the same paragraph).Include in your BibTeX entries all required fields and as many of the optional fields as possible. Copy and consult this file to remember which fields are available, which are required, and which are supported for each entry type.
Obtain a BibTeX entry for a publication's DOI using the doi2bib service. In many cases the quality of its results is higher than that provided by the publisher's digital library.
If you copy-paste a BibTeX entry from a digital library, edit it carefully to ensure a consistent high-level of quality.
The Elements of Programming Style, rather than
The elements of programming style.
This ensures that the title will appear correctly
if a particular bibliography style requires title capitalization.The {C} Programming Language, or Fifty Years of {M}oore's Law.
This ensures these characters will not be converted to lowercase
in bibliography styles that do not require title capitalization.{ICSE} '08: Proceedings of the 30th International Conference on Software Engineering.
It would be a mistake to use a different format, e.g.
12th Working Conference on Mining Software Repositories (MSR 2015), Proceedings of in another entry.doi = {10.1371/journal.pone.0294946}, rather than
doi = {https://doi.org/10.1371/journal.pone.0294946}.
The prefix can be easily added when needed, and many bibliography formats
add it in the hyperlink without wasting space to show it.The Entity-Relationship Model---Toward a Unified View of Data or
The Evolution of {C} Programming Practices: A Study of the {U}nix Operating System 1973--2015.author = {Yann-Ga\"{e}l Gu\'{e}h\'{e}neuc and Herv\'{e} Albin-Amiot}.
This change may not be required if you are using
Biber, provided that
the digital library correctly provides the author names in Unicode.Use consistent, easily derivable, short names for your bibliography entries. One practical scheme is as follows.
Ker08 for an article published
by Brian Kernighan in 2008.DMG07 for an article published by
Duvall, Paul M. and Matyas, Steve and Glover, Andrew in 2007.a, b, c, etc appended to the above keys in the case
of clashes.Through this scheme you can easily search for an existing entry in your bibliography files and saved articles, because you can quickly derive the key used. Also this scheme will help you avoid duplicate entries, because the corresponding keys will clash.
If you save the PDF document associated with a bibliography entry in
your files, name it using the entry's key, e.g. LR89.pdf.
If you print (or photocopy) a document associated with a bibliography entry, write the corresponding key on its top right corner. This will help you reference it in your work. You can also use this key to file the printout so that you can find it in the future.
If you prefer to edit your BibTeX files with an application rather than a generic editor, consider using JabRef for the desktop or Bibtool on the command line.
Conference organizers and publishers often supply style files that determine the appearance and formatting of a document and its references. Download them and use them. If you're writing a thesis and your institution doesn't provide a template you can use this one. Seeing your document in its published look boosts your motivation, helps you appreciate how your readers will experience it, and minimizes rework by forcing you to comply with the publisher's requirements while you develop your document.
You can obtain many formatting goodies by incorporating into your document third-party LaTeX packages. Most LaTeX distributions provide a package management system that simplifies the installation and maintenance of packages. Here are some popular LaTeX packages your may want to know about.
\section and rather than specifying italic text use \emph.\newcommand{\finding}[1]{\textbf{#1}}
while the following environment declaration will list a software's license in a small font keeping its formatting.
\newenvironment{license}{\verbatim\scriptsize}{\normalsize\endverbatim}
\label command,
and reference them using the cleveref
\Cref command.see Figure~\ref{fig:foo});\Cref can create that for you:
see~\Cref{fig:foo}.tab:statResults rather than table1.
Use the tab: prefix when labelling tables,
the fig: prefix when labelling figures, and
the sec: prefix when labelling sections.\[
E = mc^2
\]
This formula states that the equivalent energy (\(E\))
can be calculated as the mass (\(m\)) multiplied
by the speed of light (\(c\)) squared.
\left and \right commands to markup (balanced)
bracketing elements.
This ensures that the elements will be correctly sized, according
to the formula they include.
For example, write \left(\cos(x) + i \sin(x)\right)^n.\mod, \max, or \sin.amsmath command \DeclareMathOperator,
e.g. \DeclareMathOperator{\sha}{sha}.\mathit{Delta} or
\mathrm{Delta}.x_{\mathrm{max}}F_{n} =
\cfrac{1}{\sqrt{5}} \left(\cfrac{1 + \sqrt{5}}{2}\right)^n
- \cfrac{1}{\sqrt{5}} \left(\cfrac{1 - \sqrt{5}}{2}\right)^n
\( math \) delimiters
to TeX's $ math $ style.\,.
Example:The atomic age started with the establishment of the mass–energy equivalence,
\[
E = mc^2 \,.
\]
It took \qty{7146}{s} to load a \qty{134}{\gibi\byte} file over a
\qty{200}{\mebi\bit} connection over a distance of \qty{9500}{\km}.
During the transfer \num{12345} packets were dropped.
The ambient temperature was \qty{-35}{\degreeCelsius}.
\hline and |) in tables.
They are unsightly and this is the reason you will rarely see them
in professionally typeset books.& separator to start each column's
data on the same LaTeX source document column.
See the following example.tr -cs & 1 & \X & -- & \V & 1 \\
sort w & 0 & & -- & \X & 0 \\
fmt & 1 & \X & -- & \V & 1 \\
tr A-Z & 1 & \V & 1 & & 1 \\
sort -u & fmt & \X & -- & \V & 1 \\
% Column labels
Command and options
& Input requirements
& Matched
& Connected
& Matched
& Connected \\
\hline
% Data
tr -cs & 1 & \X & -- & \V & 1 \\
sort w & 0 & & -- & \X & 0 \\
...
\toprule, \midrule and
\bottomrule from the booktabs package.
Example:\toprule
Header \\
\midrule
Table row 1 \\
Table row 2 \\
\bottomrule
.jpeg or .png image if you can include
a PDF created from vector data, e.g. by direct export from
Inkscape or
GraphViz or by converting an .svg file.\centering within a figure or table environment to center its
contents.
This avoids the extra space introduced by the center environment.Be consistent in the rules you follow. Some style guides offer contradicting advice. Examples include:
This isn't a license to randomly use both the one or the other alternative within the document. Adopt your publisher's style or consistently follow the same rule throughout your document.
Use three dashes (---) to create the em-dash,
which separates parenthetical phrases.
According to the Chicago Manual of Style (2.13),
an em-dash has no space before or after it.
(Note that The Associated Press Stylebook specifies spacing.)
Use two dashes (--) to create an en-dash.
Use this to specify number ranges, e.g. 2009--2015.
Separate numbers and the units these represent with a (non-breaking) space:
12~kB, 3.6~GHz.
No space is required for percentages and degrees: 90%, 45°.
Employ a thin space (\,) as a thousands separator, e.g. 123\,456.
Better yet, format your numbers with the
siunitx package:
\SI{90}{\percent}, \SI{45}{\degreeCelsius}, \SI{16}{\gibi\byte},
\SIlist{5; 10; 15}{\milli\metre}, \SI{9.81}{\metre\per\second\squared}
\SIrange{512}{1024}{\mebi\byte}, \num{1234566}.
(Note that the SI standard, in contrast to the Chicago Manual of Style,
specifies that a space should precede
°C and
%.
The siunitx package will consistently follow the appropriate rules.)
Use \dots to produce an ellipsis (…) punctuation symbol.
Put footnotes after punctuation symbols, unless your publisher's
style specifies otherwise.
For example, write … is true.\footnote{See also …}
Avoid underlined text. Underlining is used for emphasis in handwritten text and was also carried over in this capacity in typewritten documents. With modern printers and software you don't need to underline, because you can use a different font style (bold or italic) for emphasis.
Avoid sequences of uppercase text. Text written in all-uppercase characters is an eyesore and considerably more difficult to read than its lowercase equivalent. Lowercase letters have been designed for easy reading, uppercase were originally designed for easy chiseling on stone.
Avoid using the itemize environment, when you're describing
elements. So, rather than itemize together with emphasized
item descriptions, use \paragraph{…} for multi-sentence elements
or the description environment with the described element passed
as an optional argument to item (\item[…]).
For example, rather than writing
\begin{itemize}
\item \textbf{RQ1} What is the meaning of life?
\end{itemize}
write
\begin{description}
\item[RQ1] What is the meaning of life?
\end{description}
Use small caps rather than an unsightly sequence of capital letters
for writing abbreviations.
For example, write \textsc{sql}, rather than SQL.
Note that some publishers do not follow this style.
If you are supplying the final camera ready version
(e.g. for conference proceedings), use small caps.
If a publisher will edit your document and the publisher does not use
small caps, avoid their use;
a common frustrating mistake is for publishers to remove the
\textsc command, without writing the text in uppercase.
Display pseudo-code using the algorithmicx package and environment. See this wikibooks entry for more details.
Display source code snippets using the listings (simpler) or the minted (nicer, but with extra dependencies) package. Make sure your code does not go over the paragraph length; if it does, adjust line breaking and/or font size accordingly.
Don't spend too much time on formatting your document. Concentrate on communicating your ideas and on making your document maintainable. Excessive formatting tweaks can be counterproductive: you waste time implementing them and your publisher may find it more difficult to use your document.
Use a tilde before \cite, \ref, etc. to avoid a line break immediately
before the reference.
For example, write Some also use logging statements~\cite{Spi06e}.
Put a backslash after a non-sentence ending period to ensure this will
not be followed by the sentence-ending spacing.
For example, write In 1962 Watson et al.\ famously found …
Do not use math mode to achieve typographic effects in plain text.
For example write RQ\textsubscript{2} rather than \(RQ_2\), if you
must subscript the number of your research question 2.
Similarly use \textsuperscript for plain superscripted text (e.g.
Wisper Quiet\textsuperscript{TM}).
Match opening and closing quotes using one or two single-opening
(‘ or ‘‘) and single-closing (’ or ’’) quote characters.
Do not use the keyboard's double quote symbol (").
Alternatively you can use the \enquote{} macro from the csquotes
package, which will automatically set the right quotes for the
configure language and can handle nested quotes correctly.
Use the new local font style commands
(e.g. \texttt{}, \textsc{}, or \textbf{})
rather than the old switches (e.g. {\tt }, {\sc }, {\bf })
Run one or more of the LaTeX linters LaCheck
(with the lacheck command) and
ChkTeX (with the chktex command)
on your document to find and fix typesetting errors.
These check documents for certain LaTeX anti-patterns, such as the use of
... instead of the typographically correct \dots or other such violations.
Users can define their own rules, too, for example to enforce consistency
in the spelling of certain phrases.
Now it is up to you to create ChkTeX rules to enforce the guidelines in this
document.
If you do, please share them.
To obtain a PDF document with the widely available Times/Helvetica/Courier font set, rather than the LaTeX, less widely used, Computer Modern fonts, use the following packages.
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
This guide focuses on LaTeX document preparation. Nevertheless, here is some advice for improving your writing and for avoiding common mistakes.
\citet{Smi20} to obtain "Smith [12]" or "Smith (2020)"
(depending on the citation style),
or you can write \citeauthor{Smi20} to obtain "Smith".git log HEAD we were able to inspect the most recent changes."This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
1,114 followers · starred Nov 2023
88 followers · starred Aug 2023
155 followers · starred Aug 2017
641 followers · starred Dec 2022