Preparing Documents and Presentations Using LATEX
Total Page:16
File Type:pdf, Size:1020Kb
Preparing documents and presentations using LATEX Mandar Mitra Indian Statistical Institute M. Mitra (ISI) LATEX and Beamer 1 / 55 Outline 1 Preliminaries Beamer 2 Packages Tables Lists Spacing 3 Diagrams 4 Misc. questions M. Mitra (ISI) LATEX and Beamer 2 / 55 Outline 1 Preliminaries Beamer 2 Packages Tables Lists Spacing 3 Diagrams 4 Misc. questions M. Mitra (ISI) LATEX and Beamer 3 / 55 \usepackage{helvet} \usefonttheme{professionalfonts} \usecolortheme[rgb={0.2,0.5,0.5}]{structure} \AtBeginSection[]{ \begin{frame}{Outline} \tableofcontents[currentsection] \end{frame} } \title[\LaTeX\ and Beamer]{Preparing documents ...} \author[M.\ Mitra]{Mandar Mitra} \institute[ISI]{Indian Statistical Institute} \date{} \begin{document} \maketitle Preamble \documentclass{beamer} M. Mitra (ISI) LATEX and Beamer 4 / 55 \usecolortheme[rgb={0.2,0.5,0.5}]{structure} \AtBeginSection[]{ \begin{frame}{Outline} \tableofcontents[currentsection] \end{frame} } \title[\LaTeX\ and Beamer]{Preparing documents ...} \author[M.\ Mitra]{Mandar Mitra} \institute[ISI]{Indian Statistical Institute} \date{} \begin{document} \maketitle Preamble \documentclass{beamer} \usepackage{helvet} \usefonttheme{professionalfonts} M. Mitra (ISI) LATEX and Beamer 4 / 55 \AtBeginSection[]{ \begin{frame}{Outline} \tableofcontents[currentsection] \end{frame} } \title[\LaTeX\ and Beamer]{Preparing documents ...} \author[M.\ Mitra]{Mandar Mitra} \institute[ISI]{Indian Statistical Institute} \date{} \begin{document} \maketitle Preamble \documentclass{beamer} \usepackage{helvet} \usefonttheme{professionalfonts} \usecolortheme[rgb={0.2,0.5,0.5}]{structure} M. Mitra (ISI) LATEX and Beamer 4 / 55 \title[\LaTeX\ and Beamer]{Preparing documents ...} \author[M.\ Mitra]{Mandar Mitra} \institute[ISI]{Indian Statistical Institute} \date{} \begin{document} \maketitle Preamble \documentclass{beamer} \usepackage{helvet} \usefonttheme{professionalfonts} \usecolortheme[rgb={0.2,0.5,0.5}]{structure} \AtBeginSection[]{ \begin{frame}{Outline} \tableofcontents[currentsection] \end{frame} } M. Mitra (ISI) LATEX and Beamer 4 / 55 Preamble \documentclass{beamer} \usepackage{helvet} \usefonttheme{professionalfonts} \usecolortheme[rgb={0.2,0.5,0.5}]{structure} \AtBeginSection[]{ \begin{frame}{Outline} \tableofcontents[currentsection] \end{frame} } \title[\LaTeX\ and Beamer]{Preparing documents ...} \author[M.\ Mitra]{Mandar Mitra} \institute[ISI]{Indian Statistical Institute} \date{} \begin{document} \maketitle M. Mitra (ISI) LATEX and Beamer 4 / 55 . Example . .This is an example block. Useful environments Frames \begin{frame}[fragile,t]{Preamble} ::: \end{frame} . Code, etc. \begin{verbatim} ::: \end{verbatim} \begin{semiverbatim} ::: \end{semiverbatim} Blocks \begin{block}{Example} ::: \end{block} M. Mitra (ISI) LATEX and Beamer 5 / 55 Useful environments Frames \begin{frame}[fragile,t]{Preamble} ::: \end{frame} . Code, etc. \begin{verbatim} ::: \end{verbatim} \begin{semiverbatim} ::: \end{semiverbatim} Blocks \begin{block}{Example} ::: \end{block} . Example . .This is an example block. M. Mitra (ISI) LATEX and Beamer 5 / 55 Useful environments Columns . Column 1 Column 2 . Here is one .column. M. Mitra (ISI) LATEX and Beamer 6 / 55 Useful environments Columns \begin{columns}[t] \column[T]{0.45\textwidth} \begin{block}{Column 1} Here is one column. \end{block} \column[T]{0.45\textwidth} \begin{block}{Column 2} \includegraphics[width=0.95\textwidth]{figs/alignment.png} \end{block} \end{columns} M. Mitra (ISI) LATEX and Beamer 6 / 55 Useful commands \alert{} \only, \uncover, \visible \onlyenv, \uncoverenv, \visibleenv \pause \section, \subsection, \subsubsection (in between frames) \verb M. Mitra (ISI) LATEX and Beamer 7 / 55 References A Beamer Tutorial in Beamer http://www.uncg.edu/cmp/reu/presentations/Charles%20Batts%20-% 20Beamer%20Tutorial.pdf A Beamer Quickstart http://www.math.umbc.edu/~rouben/beamer/ Norm Matloff’s Quick Tutorial http://heather.cs.ucdavis.edu/~matloff/beamer.html Beamer by Example http://www.tug.org/pracjourn/2005-4/mertz/mertz.pdf Beamer v3.0 Guide http://research.microsoft.com/en-us/um/people/saikat/ref/beamer_ guide.pdf Beamer User Guide http://www.tug.org/tetex/tetex-texmfdist/doc/latex/beamer/ beameruserguide.pdf M. Mitra (ISI) LATEX and Beamer 8 / 55 Outline 1 Preliminaries Beamer 2 Packages Tables Lists Spacing 3 Diagrams 4 Misc. questions M. Mitra (ISI) LATEX and Beamer 9 / 55 Where to get them Packages provided by your (GNU/Linux) distribution texlive-generic-recommended texlive-latex-recommended texlive-latex-extra etc. TEX Live installation from scratch installation: http://www.tug.org/texlive/quickinstall.html package manager: tlmgr tlmgr install <pkgname> MikTeX (Windows only?) M. Mitra (ISI) LATEX and Beamer 10 / 55 Where to get them The Comprehensive TEX Archive Network http://ctan.org/ 1 Download the package. http://www.ctan.org/tex-archive/support/ctantools 2 Extract the files: run LATEX on the .ins file. 3 Create the documentation: run LATEX on the .dtx file. 4 Install the files. M. Mitra (ISI) LATEX and Beamer 11 / 55 export BSTINPUTS=":$MYLATEX" # Bibliography style files export MFINPUTS=":$MYLATEX/fonts/source" export TEXINPUTS="$MYLATEX:$MYLATEX/tikz:$MYLATEX/images:" export PKFONTS=":$MYLATEX/fonts/pk" export TEXFONTS=":$MFINPUTS:$MYLATEX/fonts:$MYLATEX/fonts/pk" export TEXPKS=":$MYLATEX/fonts/pk" Can use a standard macros.tex Private installation Put files in ~/latex or ~/texmf Setup paths for TEX and LATEX export MYLATEX="/home/mandar/latex" M. Mitra (ISI) LATEX and Beamer 12 / 55 export PKFONTS=":$MYLATEX/fonts/pk" export TEXFONTS=":$MFINPUTS:$MYLATEX/fonts:$MYLATEX/fonts/pk" export TEXPKS=":$MYLATEX/fonts/pk" Can use a standard macros.tex Private installation Put files in ~/latex or ~/texmf Setup paths for TEX and LATEX export MYLATEX="/home/mandar/latex" export BSTINPUTS=":$MYLATEX" # Bibliography style files export MFINPUTS=":$MYLATEX/fonts/source" export TEXINPUTS="$MYLATEX:$MYLATEX/tikz:$MYLATEX/images:" M. Mitra (ISI) LATEX and Beamer 12 / 55 Private installation Put files in ~/latex or ~/texmf Setup paths for TEX and LATEX export MYLATEX="/home/mandar/latex" export BSTINPUTS=":$MYLATEX" # Bibliography style files export MFINPUTS=":$MYLATEX/fonts/source" export TEXINPUTS="$MYLATEX:$MYLATEX/tikz:$MYLATEX/images:" export PKFONTS=":$MYLATEX/fonts/pk" export TEXFONTS=":$MFINPUTS:$MYLATEX/fonts:$MYLATEX/fonts/pk" export TEXPKS=":$MYLATEX/fonts/pk" Can use a standard macros.tex M. Mitra (ISI) LATEX and Beamer 12 / 55 Outline 1 Preliminaries Beamer 2 Packages Tables Lists Spacing 3 Diagrams 4 Misc. questions M. Mitra (ISI) LATEX and Beamer 13 / 55 Basics tabular environment \begin{tabular}{ l c r } 1 & 2 & 3 \\ 1 2 3 14 & 25 & 36 \\ 14 25 36 147 & 258 & 369 \\ 147 258 369 \end{tabular} M. Mitra (ISI) LATEX and Beamer 14 / 55 \begin{tabular}{ l c r } \multicolumn{3}{c}{Heading} \\ Heading 1 & 2 & 3 \\ 1 2 3 14 & 25 & 36 \\ 14 25 36 147 & 258 & 369 \\\cline{1-2} 147 258 369 \end{tabular} Basics Commands \multicolumn, \cline M. Mitra (ISI) LATEX and Beamer 15 / 55 Basics Commands \multicolumn, \cline \begin{tabular}{ l c r } \multicolumn{3}{c}{Heading} \\ Heading 1 & 2 & 3 \\ 1 2 3 14 & 25 & 36 \\ 14 25 36 147 & 258 & 369 \\\cline{1-2} 147 258 369 \end{tabular} M. Mitra (ISI) LATEX and Beamer 15 / 55 Packages tabularx tabulary ctable (includes packages array, tabularx and booktabs) tabu multirow “Professional” tables Tables in LATEX 2": Packages and Methods, Lapo Filippo Mori Good style: Avoid vertical lines, horizontal lines in body, double lines, etc. Requirements lines and spacing horizontal and vertical alignment M. Mitra (ISI) LATEX and Beamer 16 / 55 “Professional” tables Tables in LATEX 2": Packages and Methods, Lapo Filippo Mori Good style: Avoid vertical lines, horizontal lines in body, double lines, etc. Requirements lines and spacing horizontal and vertical alignment Packages tabularx tabulary ctable (includes packages array, tabularx and booktabs) tabu multirow M. Mitra (ISI) LATEX and Beamer 16 / 55 \begin{tabular}{ l c r }\toprule 1 2 3 1 & 2 & 3 \\\otoprule 14 & 25 & 36 \\[1em] Don’t use! 14 25 36 147 & 258 & 369 \\\bottomrule 147 258 369 \end{tabular} Lines and spacing Use ctable or booktabs \toprule, \bottomrule, \midrule, \cmidrule \newcommand{\otoprule}{\midrule[\heavyrulewidth]} M. Mitra (ISI) LATEX and Beamer 17 / 55 1 2 3 Don’t use! 14 25 36 147 258 369 Lines and spacing Use ctable or booktabs \toprule, \bottomrule, \midrule, \cmidrule \newcommand{\otoprule}{\midrule[\heavyrulewidth]} \begin{tabular}{ l c r }\toprule 1 & 2 & 3 \\\otoprule 14 & 25 & 36 \\[1em] 147 & 258 & 369 \\\bottomrule \end{tabular} M. Mitra (ISI) LATEX and Beamer 17 / 55 Lines and spacing Use ctable or booktabs \toprule, \bottomrule, \midrule, \cmidrule \newcommand{\otoprule}{\midrule[\heavyrulewidth]} \begin{tabular}{ l c r }\toprule 1 2 3 1 & 2 & 3 \\\otoprule 14 & 25 & 36 \\[1em] Don’t use! 14 25 36 147 & 258 & 369 \\\bottomrule 147 258 369 \end{tabular} M. Mitra (ISI) LATEX and Beamer 17 / 55 Packages tabularx Force Force is a vector quantity defined as the rate of change of the momentum of the body that would be induced by that force acting alone. Moment of a force Moment of a force with respect to an origin is defined as the cross prod- uct of the position vector (with re- spect to the same origin) and the force. M. Mitra (ISI) LATEX and Beamer 18 / 55 Packages tabularx \begin{tabularx}{0.85\textwidth}{>{\bfseries}lX} \toprule Force & Force is a vector quantity defined as the rate of change of the momentum of the body that would be induced by that force acting