- LaTex basics
- Math
- Figure
- Table & List
- Appendix & Bibliography
- Presentation
- Poster
- Journals
- LaTeX packages
- Examples
- References
- LaTeX commands:
\command[option,...]{argument} - 10 special characters:
# $ % & ~ _ ^ \ { } \documentclass[OPTIONS]{CLASS}: layout of the document- CLASS
- Basic: article, book, report, letter, slides, beamer
- American Mathematical Society (AMS): amsbook, amsarticle
- KOMA-Script: scrartcl, scrbook, scrreprt, scrlttr2
- Book: tufte-book
- Journals: revtex4-2, elsarticle
- OPTIONS
- letterpaper, a4paper
- 10pt, 11pt, 12pt
- fleqn, leqno
- titlepage, notitlepage
- oneside, twoside
- onecolumn, twocolumn
- landscape
- openright, openany
- draft, final
- CLASS
\begin{},\end{}: define an environment\begin{document} \begin{environment1} \begin{environment2} \end{environment1} \end{environment2} \end{document}
\title{}\date{}\today
\author{}\newpage\pagestyle{STYLE},\thispagestyle{STYLE}- empty, plain, headings, myheadings, fancy
\pagenumbering{}- gobble, arabic, roman
- Texts
\text{}: normal text\textbf{}: bold~: a non-breaking space between texts (e.g. 3.5~mm)\\: line break\verb|LaTeX-COMMAND|(|can be replaced with other characters),\begin{verbatim}LaTeX-COMMAND\end{verbatim}: display LaTeX commands
- Table of contents
\tableofcontents- In preamble:
\setcounter{tocdepth}{n}, where n = 1, 2, 3(default), 4, 5 - Specify individually before each section:
\addtocontents{toc}{\setcounter{tocdepth}{3}}
- In preamble:
\listoffigures,\listoftables
\part{}\chapter{}(only books and reports)- Sections:
\section{},\subsection{},\subsubsection{},\section*{WITHOUT NUMBERING} - Paragraphs:
\paragraph{},\subparagraph{}
- Math environments:
$INLINE_FORMULA$,\(INLINE_FORMULA\),equation,align,subequations- use asterisk (e.g.
equation*,align*) to turn-off auto numbering - math symbols
- https://latex-tutorial.com/symbols/math-symbols/
- https://en.wikibooks.org/wiki/LaTeX/Mathematics
- most math symbols have to be used in the math environments
\left,\right: scale up the bracket symbol after it\intertext{TEXT}: text within equations- Partitioned statements (with
amsmathpackage):\[ LHS = \begin{cases} RHS1, & \text{CONDITION1}\\ RHS2, & \text{CONDITION2} \end{cases} \]
- use asterisk (e.g.
- Figure environments
\begin{figure}[placement specifier]- h (here, if possible), t (top), b (bottom), p (page of floats), ! (override)
- H (here, definitely) if
\usepackage{float}
\begin{subfigure}[pos][height][inner-pos]{width}- pos: c (center, default), t (top), b (bottom)
- height: strech the height of the subfigure (e.g. 10pt, 1cm)
- inner-pos: t (top), c (center), b (bottom), s (stretch)
- width: width of the subfigure
\begin{wrapfigure}[nline]{pos}[overhang]{width}(if\usepackage{wrapfig})- nline: number of narrow lines (e.g. 12)
- pos: R/r (right), L/l (left), I/i (inside), O/o (outside) [float/no]
- overhang: overhang of the figure (0pt, default)
- width: width of the figure
\includegraphics[width=SIZE\textwidth]{FIGURE_PATH}- SIZE: 0~1 (use 0.1 less than you expect)
\caption{}\label{MARKER}: this MARKER can be used for later referencing\centering\hfill: make one figure left-align and the other right-align, then fill spaces to produce a rubber length (same as\hspace\fill)\hspace{L cm}: L can be a positive or negative value.\ContinuedFloat: preserve the numbering from the previous subfigures
- Set path to figure folder:
\graphicspath{{FOLDER_PATH1}{FOLDER_PATH2}...}
- Table environment
begin{table}begin{tabular}{| l | c | r |}l: left-alignment,c: center-alignment,r: right-alignment,S: aligned decimal point (if\usepackage{siunitx})|: vertical line,\hline: horizontal line- in each row:
column1 & column2 & column3 \\ - for
\usepackage{multirow}- multiple rows:
\multirow{NROWS}{WIDTH}{CONTENT} - multiple columns:
\multicolumn{NCOLUMNS}{ALIGNMENT}{CONTENT}
- multiple rows:
- for long table,
\usepackage{longtable}\begin{longtable}[placement specifier]{ALIGNMENT}- Put the header between
\endfirstheadand\endheadso that it will be shown on every page.
usepackage{rotating}to rotate the table\begin{sidewaystable}
- List environment
\begin{itemize},\begin{enumerate}\item ITEM 1\item ITEM 2\item ITEM n
- To change the bullet point symbol
\item[?]usepackage{enumitem},usepackage{pifont}
- LaTeX tables generator
- Appendix environment
\begin{appendix}
- Referencing
\label{KEY}\ref{KEY},\subref{KEY},\pageref{KEY},\eqref{KEY}\footnote{\label{FOOTNOTE_LABEL} CONTENT}, this footnote can be referred by using\ref{FOOTNOTE_LABEL}\index{KEY}(if\usepackage{makeidx})\makeindex,\printindex
usepackage{hyperref}\hyperref[KEY]{TEXT}&\hypertarget{KEY}{TEXT}\url{URL},\href{URL}{TEXT},href{mailto:EMAIL}{TEXT},\href{run:PATH/FILE}{TEXT}\hypersetup{OPTION1=VALUE1,OPTION2=VALUE2,...}(more information can be found in LaTeX/Hyperlinks)
usepackage{varioref}\vref{KEY}
usepackage{cleveref}\cref{KEY},\Cref{KEY}
- Bibliography
- BibTeX
\bibliographystyle{unsrt} % abbrv, alpha, acm, apalike, ieeetr, plain, unsrt \bibliography{bib_file1.bib, bib_file2.bib, ...}
\cite{ReferenceKey},\nocite{ReferenceKey},\nocite{*}
- biblatex
- in the preamble
\usepackage[backend=bibtex, % biber, bibtex style=numeric, % numeric, alphabetic, authoryear, authortitle, verbose, reading, draft sorting=nyt % nty, nyt, nyvt, anyt, anyvt, ydnt, none ]{biblatex} \addbibresource{bib_file1.bib} \addbibresource{bib_file2.bib}
- in text
\autocite[PAGE_NUM]{ReferenceKey},\textcite[PAGE_NUM]{ReferenceKey}
- print the bibliography
\printbibliography
- in the preamble
- For more informations, please refer to these webpages
- Exporting references from reference managers
- Mendeley
- Zotero
- You may have to modify the title field manually with rich text formatting.
- BibTeX
- LaTeX presentation environment
begin{beamer}
- Themes
\usetheme{default}- Boadilla, Madrid, Montpellier, Warsaw, ,Copenhagen, Goettingen, Hannover, Berkeley
- Title page
\title{},\subtitle{},\author{},\date{},\titlegraphic{}\titlepage
- Logo
\logo{}
- Section
\section{}
- Frame
\begin{frame}[label={LABEL}]{TITLE}{Subtitle}
- Hyperlink
\hyperlink{LABEL}{\beamerbutton{TEXT}}
- TikZ poster
\documentclass[FONT_SIZE, PAPER_SIZE, ORIENT]{tikzposter}- FONT_SIZE: 12pt, 14pt, 25pt, ...
- PAPER_SIZE: a0paper, a1paper, a2paper, a3paper, a4paper
- ORIENT: landscape, portrait
\usetheme{}- Default, Rays, Basic, Simple, Envelope, Wave, Board, Autumn, Desert
- Title
\maketitle
- Block
\block{TITLE} { TEXT } - Columns
\begin{columns} \column{WIDTH} \block{TITLE}{} \column{WIDTH} \block{TITLE}{} \end{columns}
- Beamer poster
\documentclass{beamer}+\usepackage[orientation=portrait,size=a0,scale=1.4]{beamerposter}orientation: landscape, portraitsize: a0, a1, a2, a3, a4scale
- Themes
\usetheme{}- AnnArbor, Antibes, Bergen, Berkeley, Berlin, Boadilla, boxes, CambridgeUS, Copenhagen, Darmstadt, default, Dresden, Frankfurt, Goettingen, Hannover, Ilmenau, JuanLesPins, Luebeck, Madrid, Malmoe, Marburg, Montpellier, PaloAlto, Pittsburgh, Rochester, Singapore, Szeged, Warsaw
\usecolortheme{}- albatross, beaver, beetle, crane, default, dolphin, dove, fly, lily, orchid, rose, seagull, seahorse, sidebartab, structure, whale, wolverine
- https://deic.uab.cat/~iblanes/beamer_gallery/index.html
- Block
\begin{frame}{} \begin{block}{TITLE} TEXT \end{block} \end{frame}
- Columns
\begin{frame}{} \begin{columns}[t] \begin{column}{WIDTH} \begin{block}{TITLE} \end{block} \end{column} \begin{column}{WIDTH} \begin{block}{TITLE} \end{block} \end{column} \end{columns} \end{frame}
- REVTeX
- Package: https://www.ctan.org/pkg/revtex
- Usage:
\documentclass[OPTIONS]{revtex4-2} - Documentation:
- Elsvier article
- Package: https://www.ctan.org/tex-archive/macros/latex/contrib/elsarticle
- Usage:
\documentclass[OPTIONS]{elsarticle} - Documentation:
- Fonts
- LaTeX symbols
- LaTeX packages:
\usepackage{PACKAGENAME}- all packages must be imported at the beginning
inputenc: input encodingsfontenc: font encodingsgeometry: for page formatting, please refer to geometry document for more details.parskip: change the spacing between paragraphssetspace: change the spacing for table of contents by using\singlespacing,\doublespacingbabel: multilingual supportamsmath:- equation numbering can be removed when using
begin{equation*} x=y end{equation*}or\nonumberat the end of the equation - adding text in the equation with
\text{TEXT},\mbox{TEXT}
- equation numbering can be removed when using
graphicx: forfigureenvironmentsubcaption: forsubfigureenvironmentwrapfig: for figures which text can flow aroundbooktabs: fortabularenvironment,\hlinecan be replaced by\toprule,\midruleand\bottomruletikz: for drawing, please visit TIKZ Blog for more examplescircuitikz: for drawing circuit diagramsiunitx: for aligning the decimal point\sisetup{round-mode= places, round-precision= 3}(round-mode: places, figures)
multirow: for multiple rows in one celllongtable: for long tablerotating: rotate the tablepgfplotstable: for autogenerated .csv tablespgfplots: (part oftikz) for autogenerated plotslistings: for source code listings, another alternative is mintedhyperref: for hyperlinksvarioref: for cross-referencing on a different pagecleveref: for cross-referencing with automatic formattingmakeidx: for creating indexes, i.e.\makeindexenumitem: for changing the bullet point symbolpifont: for more bullet point styles, more symbols can be found in the manualblindtext,lipsum: generate dummy textbeamer&beamerposter: for presentations & postersxcolor: using named colors, please refer to manual for more detailsoverpic: picture environment for overlaying figures and annotations, please refer to manual for more detailsfancyhdr: page headers and footers, more details in manualdatatool,databar: for data processing, management, and visualization
- first_latex (tex, pdf)
- paragraph_section (tex, pdf)
- packages (tex, pdf)
- math (tex, pdf)
- figures (tex, pdf)
- table_of_contents (tex, pdf)
- bibliography (tex, pdf)
- csv_tables/plots (tex, pdf)
- presentation (tex, pdf)
- poster (tex-tikz, pdf-tikz; tex-beamer, pdf-beamer)
- revtex (tex, pdf)
- elsarticle (tex, pdf)
- https://latex-tutorial.com/tutorials/
- https://latex-beamer.com/
- https://vknight.org/tex/
- https://www.overleaf.com/learn/latex/Free_online_introduction_to_LaTeX_(part_1)
- https://www.overleaf.com/learn/latex/Posters
- https://en.wikibooks.org/wiki/LaTeX
- https://ctan.org/
- https://texdoc.org/index.html
- [PDF]LaTeX: A Document Preparation System by Leslie Lamport