latex tutorial
TRANSCRIPT
![Page 1: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/1.jpg)
LaTeX Tutorial2015.01.28
![Page 2: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/2.jpg)
Agenda•
• LaTeX
• Hello LaTeX!
•
• Bibliography
• Build
• Writing Tips
![Page 3: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/3.jpg)
LaTeX
• LaTeX TeX Leslie Lamport
• Leslie Lamport: LaTeX, Paxos algorithm, 2013 Turing award
• TeX Knuth
![Page 4: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/4.jpg)
LaTeX •
• Word + OneNote LaTeX
•
•
• Knuth The Art of Computer Programming TeX
•
![Page 5: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/5.jpg)
LaTeX • Beamer
• Pandoc
• musixtex
• circuitkz
•
![Page 6: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/6.jpg)
• LaTeX
• /ˈleɪtɛk/ /ˈlɑːtɛk/
• X k
![Page 7: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/7.jpg)
LaTeX • Overleaf
• https://www.overleaf.com
• writelatex WYSIWYG
• build ...
• StackExchange TeX
• http://tex.stackexchange.com
• BJ4
![Page 8: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/8.jpg)
LaTeX • LaTeX Wikibook
• http://en.wikibooks.org/wiki/LaTeX
• (?)
• CTAN
• http://www.ctan.org
• TeX package
• API Reference
![Page 9: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/9.jpg)
Installation• http://en.wikibooks.org/wiki/LaTeX/Installation
• Linux: TeX Live package
• distribution 200 - 300 MB
• Windows: MiKTeX 160 MB
• Mac: MacTeX 2.4 GB
![Page 10: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/10.jpg)
Hello LaTeX!\documentclass[a4paper, 12pt]{report}
\begin{document}
Hello, \LaTeX{}!
\emph{Welcome} to this \textbf{world}!
Ito\rq{}s formula:
$$ dX_t = \mu_tdt + \sigma_tdB_t $$
\end{document}
![Page 11: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/11.jpg)
![Page 12: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/12.jpg)
\documentclass[a4paper, 12pt]{report}
\begin{document}
Hello, \LaTeX{}!
\emph{Welcome} to this \textbf{world}!
Ito\rq{}s formula:
$$ dX_t = \mu_tdt + \sigma_tdB_t $$
\end{document}
![Page 13: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/13.jpg)
\documentclass[a4paper, 12pt]{report}
\begin{document}
Hello, \LaTeX{}!
\emph{Welcome} to this \textbf{world}!
Ito\rq{}s formula:
$$ dX_t = \mu_tdt + \sigma_tdB_t $$
\end{document}
• \documentclass
•
• a4paper: A4
• 12pt: 12
• report:
![Page 14: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/14.jpg)
\documentclass[a4paper, 12pt]{report}
\begin{document}
Hello, \LaTeX{}!
\emph{Welcome} to this \textbf{world}!
Ito\rq{}s formula:
$$ dX_t = \mu_tdt + \sigma_tdB_t $$
\end{document}
• \begin \end
•
• document
![Page 15: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/15.jpg)
\documentclass[a4paper, 12pt]{report}
\begin{document}
Hello, \LaTeX{}!
\emph{Welcome} to this \textbf{world}!
Ito\rq{}s formula:
$$ dX_t = \mu_tdt + \sigma_tdB_t $$
\end{document}
• • \LaTeX: LaTeX command
![Page 16: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/16.jpg)
\documentclass[a4paper, 12pt]{report}
\begin{document}
Hello, \LaTeX{}!
\emph{Welcome} to this \textbf{world}!
Ito\rq{}s formula:
$$ dX_t = \mu_tdt + \sigma_tdB_t $$
\end{document}
• \emph: emphasis
• \textbf:
• \rq: right quote
• .tex
![Page 17: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/17.jpg)
\documentclass[a4paper, 12pt]{report}
\begin{document}
Hello, \LaTeX{}!
\emph{Welcome} to this \textbf{world}!
Ito\rq{}s formula:
$$ dX_t = \mu_tdt + \sigma_tdB_t $$
\end{document}
• $ TeX
• $ $
•
![Page 18: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/18.jpg)
• .tex
• indent
• # $ % ˆ & _ { } ̃ \
• Tab
• %
![Page 19: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/19.jpg)
LaTeX Group• { } group
• {
\color{red}
This line will be red.
}
This line will not.
![Page 20: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/20.jpg)
LaTeX Command• command
• function
• { } argument
• [ ] optional option
•
![Page 21: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/21.jpg)
LaTeX Environment
• \begin{name} \end environment
• Environment command environment
![Page 22: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/22.jpg)
Input TeX Files• include
• \input{another.tex}
• another.tex \input
• .tex \input
![Page 23: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/23.jpg)
• Global structure
• Document class
• Package
• Chapter, section, subsection
![Page 24: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/24.jpg)
Global Structure\documentclass{…}
\usepackage{…}
% settings
\begin{document}
% content…
\end{document}
• document class
•
•
• document
![Page 25: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/25.jpg)
Document Class
article Journal short report etc.
report chapter
book book
IEEEtran IEEE Transaction format
•
![Page 26: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/26.jpg)
Document Class• options
10pt, 11pt, 12pt 10pt 12pt
a4paper, letterpaper
onecolumn, twocolumn column twocolumn
twoside, oneside book twoside article & report oneside
![Page 27: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/27.jpg)
Package• \usepackage{…} package
• \usepackage{verbatim}
•
•
• cite citation
• graphicx
• tabularx
• listings
![Page 28: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/28.jpg)
• LaTeX
• \chapter book report
• \section
• \subsection
• \subsubsection
![Page 29: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/29.jpg)
...• List (ordered &
unordered)
• Font
• Source code
• Table
• Table of Contents
• Citation and Footnote
• Figure
• Reference
![Page 30: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/30.jpg)
List (unordered)
\begin{itemize}
\item The first item
\item The second
\item The third
\end{itemize}
• The first item
• The second
• The third
![Page 31: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/31.jpg)
List (ordered)
\begin{enumerate}
\item The first item
\item The second
\item The third
\end{enumerate}
1. The first item
2. The second
3. The third
![Page 32: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/32.jpg)
\begin{enumerate}
\item The first item
\begin{itemize}
\item 1 of the first
\item 2 of the first
\end{itemize}
\item The second
\end{enumerate}
1. The first item
• 1 of the first
• 2 of the first
2. The second
![Page 33: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/33.jpg)
Font
• \textbf{…}
• \emph{…}, \italic{…}
• monospace \texttt{…}
![Page 34: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/34.jpg)
• listings
• \usepackage{listings}
• lstlistings
\begin{lstlistings}[breakline] int my_count = 0; println(“hello world!”); \end{lstlistings}
![Page 35: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/35.jpg)
• syntax highlight
• document
\lstset{ language=C, numbers=none,
tabsize=2, basicstyle=\ttfamily\small, breakatwhitespace=true }
![Page 36: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/36.jpg)
• LaTeX
•
• PPT
![Page 37: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/37.jpg)
\begin{tabular}{ l l l }
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{tabular}
1 2 3
4 5 6
7 8 9
![Page 38: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/38.jpg)
\begin{tabular}{ | c | c | c | }
\hline
1 & 2 & 3 \\
\hline
4 & 5 & 6 \\
\hline
7 & 8 & 9 \\
\hline
\end{tabular}
1 2 3
4 5 6
7 8 9
![Page 39: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/39.jpg)
Column c
l
r
p{12cm}
| column
|| column
![Page 40: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/40.jpg)
• \tableofcontents
•
• book: chapter, section, subsection
• report: section, subsection, subsubsection
![Page 41: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/41.jpg)
Citation
• \usepackage{cite}
• \cite{bib_key}
• bib_key bibliography key
![Page 42: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/42.jpg)
Citation
Those techniques are usually used in a client-server scenario where the program is partitioned into tasks and some tasks are offloaded to the server from clients~\cite{MCCSurvey, Chun2011, hung2014mobilefbp}.
Following the emerging HTML5 and JavaScript technologies, web apps are enhanced with increased capabilities that are more specific for mobile contexts \cite{WEBAPP}.
![Page 43: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/43.jpg)
Footnote• citation bibliography
•
• footnote
• \footnote{put footnote texts here}
• \footnotemark \footnotetext
![Page 44: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/44.jpg)
Footnote Web applications are the most widely-adopted cross-platform solution for mobile devices, \footnote{This work was in part supported by MOST under 102-2221-E-002-087-MY3 and by III under 104-EC-17-A-24-0691}
![Page 45: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/45.jpg)
Footnote
\section[Introduction]{Introduction\footnotemark} \footnotetext{This work was in part supported by MOST under 102-2221-E-002-087-MY3 and by III under 104-EC-17-A-24-0691}
![Page 46: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/46.jpg)
• \usepackage{graphicx}
•
• \includegraphics[...]{file_path}
• file_path
• .jpg, .png, .pdf
• .tex \input \input
![Page 47: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/47.jpg)
• \includegraphics[width=1.0\columnwidth]{…}
• column
• 1.0 .8
• \textwidth twocolumn
![Page 48: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/48.jpg)
optional ...
• width=xx height=xx
•
• keepaspectratio
• width height
![Page 49: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/49.jpg)
Figure
• Figure graphic graphictable
• \begin{figure} \end{figure}
![Page 50: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/50.jpg)
Figure: graphic\begin{figure}[htb!]
\begin{centering}
\includegraphics[width=1.0\columnwidth]{figures/usecase-webcam}
\caption{A distributed webcams example}
\label{fig:usecase-webcam}
\end{centering}
\end{figure}
figure
![Page 51: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/51.jpg)
![Page 52: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/52.jpg)
Figure: table\begin{figure}[htb!] \begin{centering} \begin{tabular} % table content... \end{tabular} \caption{A distributed webcams example} \label{fig:usecase-webcam} \end{centering} \end{figure}
![Page 53: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/53.jpg)
Figure • Figure float flow • \begin{figure}[htb!] • placement specifier figure
• h: here source code • t: top • b: bottom • !: LaTeX
• LaTeX •
![Page 54: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/54.jpg)
Figure Graphic
• figure
\begin{figure}[htb!] \includegraphics[width=1.0\columnwidth]{file1} \caption{Caption 1} \label{fig:file1} \includegraphics[width=1.0\columnwidth]{file2} \caption{Caption 2} \label{fig:file2} \end{figure}
![Page 55: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/55.jpg)
Label• \label{label_name}
•
• \chapter \section figure
• label_name
• \label{fig:system_architecture}
• \label{sec:introduction}
![Page 56: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/56.jpg)
Reference• ref
The high-level overview of Migratom.js is illustrated in Figure~\ref{fig:Architecture}.
• FigureChapter Table !!
![Page 57: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/57.jpg)
Bibliography• LaTeX bib
• BibTeX
• .bib key-value pair citation
• \cite{key} Biliography
![Page 58: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/58.jpg)
.bib key-value @article{MCCSurvey, author = {Fernando, Niroshinie and Loke, Seng W. and Rahayu, Wenny}, title = {{Mobile Cloud Computing: A Survey}}, journal = {Future Gener. Comput. Syst.}, issue_date = {January, 2013}, volume = {29}, number = {1}, month = jan, year = {2013}, issn = {0167-739X}, pages = {84--106}, numpages = {23}, url = {http://dx.doi.org/10.1016/j.future.2012.05.023}, doi = {10.1016/j.future.2012.05.023}, acmid = {2388260}, publisher = {Elsevier Science Publishers B. V.}, address = {Amsterdam, The Netherlands, The Netherlands}, keywords = {Mobile cloud computing, Pervasive networks, Task offload}, }
![Page 59: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/59.jpg)
Best Practices
• survey bib
• title
• Google Scholar BibTeX
![Page 60: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/60.jpg)
•
• \addcontentsline{toc}{chapter}{\bibname}
• \bibliography{bib_file_name}
• \usepackage[notbib]{tocbibind}
![Page 61: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/61.jpg)
• Mac xelatex bibtex
• xelatex thesis.tex
• bibtex thesis.tex
• xelatex thesis.tex
• xelatex thesis.tex
• Linux pdftex
![Page 62: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/62.jpg)
1. xelatex thesis.tex: xelatex \cite thesis.aux
2. bibtex thesis.tex: bibtex thesis.aux key .bib values
thesis.bbl 3. xelatex thesis.tex: xelatex .bbl
\bibliography{…} 4. xelatex thesis.tex:
BibTeX
![Page 63: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/63.jpg)
• definecolor
• lstdefinelanguage
• hyphenation
• pdfpages
• listoffigures listoftables
• vspace noindent
![Page 64: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/64.jpg)
definecolor• \definecolor{my_red}{RGB}{223,0,2}
{
\color{my_red}
This sentence is red.
}
![Page 65: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/65.jpg)
lstdefinelanguage\lstdefinelanguage{JavaScript}{ keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break}, keywordstyle=\color{jskw}\bfseries, ndkeywords={class, export, boolean, throw, implements, import, this}, ndkeywordstyle=\color{darkgray}\bfseries, identifierstyle=\color{black}, sensitive=false, comment=[l]{//}, morecomment=[s]{/*}{*/}, commentstyle=\color{jsgreen}\ttfamily, stringstyle=\color{jsred}\ttfamily, morestring=[b]', morestring=[b]" }
![Page 66: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/66.jpg)
… lstset
\lstset{ language=JavaScript, numbers=none, tabsize=2, basicstyle=\ttfamily\small, breakatwhitespace=true }
![Page 67: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/67.jpg)
Hyphenation• LaTeX
• hyphenation • \hyphenation{Java-Script}
![Page 68: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/68.jpg)
pdfpages
• \usepackage{pdfpages}
\addcontentsline{toc}{chapter}{ }
\includepdf[pages={1}]{cert.pdf}
![Page 69: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/69.jpg)
listoffigures & listoftables
• \listoffigures \listoftables
• \tableofcontents
![Page 70: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/70.jpg)
vspace
• \vspace{5mm}
• v = verticle
• 5mm
![Page 71: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/71.jpg)
noindent
• \noindent
•
![Page 72: LaTeX Tutorial](https://reader034.vdocuments.us/reader034/viewer/2022042611/587063531a28ab48378b462f/html5/thumbnails/72.jpg)
Best Practices• \input \input • • ~ • e.g. i.e. • \emph \textbf \texttt • itemize enumerate • build.sh makefile • Google Scholar bib • Git Github Bitbucket
• TeX .gitignore • https://www.gitignore.io/api/latex