I just started writing in LaTeX and all too often I find myself forgetting commands that I had looked up a few minutes ago. Therefore, I thought it’d help if I compiled a list of these.
Paragraph Spacing
setlength{parskip}{7pt}
This goes in the preamble of the document (after the document class stuff, but before the begin document line).
Removing Page Numbers
thispagestyle{empty}
This gets rid of page numbers for that particular page, but the numbering sequence continues on the next page.
Adding Unnumbered Sections into the TOC
section*{Introduction}
addcontentsline{toc}{section}{Introduction}
By default, unnumbered sections do not appear in the table of contents and therefore they must be added manually.
Defining a New Style with fancyhdr
fancypagestyle{plain}{%
fancyhf{}}% clear all header and footer fields
New style definitions should go before the very last curly brace.
Unnumbered Sections Not Working with leftmark and rightmark
section*{Introductionmarkboth{Introduction}{}}
For some reason, unnumbered sections don’t play nice with fancyhdr and don’t get treated as real sections when the leftmark and rightmark commands are used. By using markboth, it fixes the problem. Now my headers show the correct section name.
Bulleted List
begin{itemize}
item Here is a bullet.
item Here is another bullet.
end{itemize}
Numbered List
begin{enumerate}
item Here is item one.
item Here is item two.
end{enumerate}
Referencing Sections by Name
section{MyFirstSection} label{marker}
section{MySecondSection}
In section~nameref{marker} we defined...
Requires the hyperref package! Put the line below in the preamble.
usepackage{hyperref}
Linking to a Website
href{http://www.example.com}{Link}
Umlauts
"{o}
That gives an o with an umlaut. Just replace the letter to get an umlaut on a different character.
Like this:
Like Loading...
Related
2011-08-21
Really Handy LaTeX Commands
I just started writing in LaTeX and all too often I find myself forgetting commands that I had looked up a few minutes ago. Therefore, I thought it’d help if I compiled a list of these.
Paragraph Spacing
This goes in the preamble of the document (after the document class stuff, but before the begin document line).
Removing Page Numbers
This gets rid of page numbers for that particular page, but the numbering sequence continues on the next page.
Adding Unnumbered Sections into the TOC
By default, unnumbered sections do not appear in the table of contents and therefore they must be added manually.
Defining a New Style with fancyhdr
New style definitions should go before the very last curly brace.
Unnumbered Sections Not Working with leftmark and rightmark
For some reason, unnumbered sections don’t play nice with fancyhdr and don’t get treated as real sections when the leftmark and rightmark commands are used. By using markboth, it fixes the problem. Now my headers show the correct section name.
Bulleted List
Numbered List
Referencing Sections by Name
Requires the hyperref package! Put the line below in the preamble.
Linking to a Website
Umlauts
That gives an o with an umlaut. Just replace the letter to get an umlaut on a different character.
Subscribe to Blog via Email
Share this:
Like this:
Related
In computer stuff
agra Assimilation Bullet COM Comment Contents D Diaeresis EAR Find Go HTML element Introduction It Link Literature Page Table of contents Thou Umlaut URL Writing Z
Next Post
Previous Post