Fei Ye 1 and Moshe Cohen 2 1,2 Department of Mathematics Bar-Ilan University March 28, 2012
1 The preamble Frames Some tips 2 A simple template More basic examples foreach allows for some inline coding 3 What it is How to use it
Start to use L A TEX The American Mathematical Society (AMS) and many other organizations worldwide accept manuscripts in L A TEX. The best way to learn it is to start to use it. Examples: homework papers official documents \begin{ i t e m i z e } \item homework \item p a p e r s \item o f f i c i a l documents \end{ i t e m i z e }
L A TEX: made to type-set math You can write math in-line. For all x i A, there exists some c Z such that x 2 i f (x i + c) 2 mod p, with p prime. For a l l $x i \ i n \mathcal{a}$, there e x i s t s some $c\ i n \mathbb{z}$ such that $x i ˆ2\ cong f ( x i+c ) ˆ2 \mod p$, with $p$ prime. You can also separate equations, as in the following: a 2 +b 2 = { c 2 when c is the hyp. of a right triangle, n i=1 (εsin(α) i ) when this makes no sense. \begin{ e q u a t i o n } aˆ2+bˆ2= \begin{ c a s e s } c ˆ2 & \ t e x t {when $ c $ i s t h e hyp. o f a r i g h t t r i a n g l e,}\\ \sum { i =1}ˆn\Delta (\ v a r e p s i l o n i ˆ{\ s i n (\ a l p h a ) }) & \ t e x t {when t h i s makes no s e n s e }. \end{ c a s e s } \end{ e q u a t i o n } (1)
The preamble The preamble Frames Some tips A LaTeX file always starts with \documentclass{}, follows by the preamble where you may put your customized global commands, and arrived the body where you write your content on. The body of a LaTeX file should be placed between \begin{document} and \end{document}. A simple example: \ d o c u m e n t c l a s s {beamer} %%%%%%%%%%%%%%%%%Preamble%%%%%%%%%%%%%%% \usetheme{warsaw} \ u s e c o l o r t h e m e { d o l p h i n } \ t i t l e {Tips on Beamer, Tikz and B i b t e x } %\ s u b t i t l e {Tips on LaTeX} \ a u t h o r { F e i Ye \ i n s t {1} and Moshe Cohen \ i n s t {2}} \ i n s t i t u t e [ Bar I l a n U n i v e r s i t y ]{\ i n s t {1, 2} Department o f Mathematics\\ Bar I l a n U n i v e r s i t y } \ d a t e {\ c o l o r { b l u e }March 28, 2012} %%%%%%%%%%%%%%%%%Body%%%%%%%%%%%%%%%%%%% \ b e g i n {document}...... \end{document}
Frames The preamble Frames Some tips The main input of beamer are frames.
Frames The preamble Frames Some tips The main input of beamer are frames. Theorem (Author Year [Bol98]) Frames are back-bones of beamer slides.
Frames The preamble Frames Some tips The main input of beamer are frames. Theorem (Author Year [Bol98]) Frames are back-bones of beamer slides. This is a block [Kau83] You can also use block environment for definitions, theorems, etc.
Frames The preamble Frames Some tips The main input of beamer are frames. Theorem (Author Year [Bol98]) Frames are back-bones of beamer slides. This is a block [Kau83] You can also use block environment for definitions, theorems, etc. \begin{ i t e m i z e } \item<1 > The main i n p u t of beamer are frames. \item<2 > \ begin{theorem} Frames are back bones of beamer s l i d e s. \end{ theorem} \item<3 > \begin{ block}{this i s a Block} block environment f o r d e f i n i t i o n s, theorems, e t c. \end{ b l o c k } \end{ i t e m i z e }
Title bar for this particular frame The preamble Frames Some tips It s as easy as beginning and ending each frame. Titles are easy, too. %\begin{frame} < t a k e out % \ f r a m e t i t l e { T i t l e bar f o r t h i s p a r t i c u l a r frame} It s as easy as beginning and ending each frame. T i t l e s are easy, too. %\end{frame} < t a k e out %
Title bar for this particular frame The preamble Frames Some tips It s as easy as beginning and ending each frame. Titles are easy, too. %\begin{frame} < t a k e out % \ f r a m e t i t l e { T i t l e bar f o r t h i s p a r t i c u l a r frame} It s as easy as beginning and ending each frame. T i t l e s are easy, too. %\end{frame} < t a k e out % When you give a presentation using slides, try to keep the text short.
Title bar for this particular frame The preamble Frames Some tips It s as easy as beginning and ending each frame. Titles are easy, too. %\begin{frame} < t a k e out % \ f r a m e t i t l e { T i t l e bar f o r t h i s p a r t i c u l a r frame} It s as easy as beginning and ending each frame. T i t l e s are easy, too. %\end{frame} < t a k e out % When you give a presentation using slides, try to keep the text short. You should explain in more detail as you speak.
Title bar for this particular frame The preamble Frames Some tips It s as easy as beginning and ending each frame. Titles are easy, too. %\begin{frame} < t a k e out % \ f r a m e t i t l e { T i t l e bar f o r t h i s p a r t i c u l a r frame} It s as easy as beginning and ending each frame. T i t l e s are easy, too. %\end{frame} < t a k e out % When you give a presentation using slides, try to keep the text short. You should explain in more detail as you speak. Don t just read what s on the slides.
Some tips The preamble Frames Some tips Print out handouts of your beamer by using \documentclass[handout]{beamer}.
Some tips The preamble Frames Some tips Print out handouts of your beamer by using \documentclass[handout]{beamer}. Include a university logo by adding \pgfdeclareimage[height=0.5cm]{university logo}{biu logo en.pdf} and \logo{\pgfuseimage{university logo}}.
Some tips The preamble Frames Some tips Print out handouts of your beamer by using \documentclass[handout]{beamer}. Include a university logo by adding \pgfdeclareimage[height=0.5cm]{university logo}{biu logo en.pdf} and \logo{\pgfuseimage{university logo}}. Include graphics: e.g. \includegraphics [ scale=0.3]{biu logo en.pdf}. Output:
Some tips The preamble Frames Some tips Print out handouts of your beamer by using \documentclass[handout]{beamer}. Include a university logo by adding \pgfdeclareimage[height=0.5cm]{university logo}{biu logo en.pdf} and \logo{\pgfuseimage{university logo}}. Include graphics: e.g. \includegraphics [ scale=0.3]{biu logo en.pdf}. Output: If you encounter strange errors, then you may try \begin{frame}[fragile ].
Some tips The preamble Frames Some tips Print out handouts of your beamer by using \documentclass[handout]{beamer}. Include a university logo by adding \pgfdeclareimage[height=0.5cm]{university logo}{biu logo en.pdf} and \logo{\pgfuseimage{university logo}}. Include graphics: e.g. \includegraphics [ scale=0.3]{biu logo en.pdf}. Output: If you encounter strange errors, then you may try \begin{frame}[fragile ]. A beamer quickstart http://www.math.umbc.edu/ ~rouben/beamer/quickstart.html
Using color The preamble Frames Some tips Unlike in a research paper, colors are useful (if not overdone)! gray \ definecolor {gray}{rgb}{.5,.5,.5} blue \ definecolor {blue}{rgb}{0,0,1} red \ definecolor {red}{rgb}{1,0,0} green \ definecolor {green}{rgb}{0,1,0} green \ definecolor {darkgreen}{rgb}{0,.5,0} yellow \ definecolor {yellow}{rgb}{1,1,.4} gold \ definecolor {gold}{rgb}{.5,.5,.2} purple \ definecolor {purple}{rgb}{.5,0,.5} \def\gray{\color{gray}} \def\blue{\color{blue}} \def\red{\color{red}} \def\green{\color{green}} \def\darkgreen{\color{darkgreen}} \def\yellow{\color{yellow}} \def\gold{\color{gold}} \def\purple{\color{purple}} You can define your own using RGB by including two lines before \begin{document} and then using {\blue TEXT HERE} in the document.
What is TikZ? A simple template More basic examples foreach allows for some inline coding TikZ is a TeX package (use pgf as an engine) allow we draw nice 2D pictures.
What is TikZ? A simple template More basic examples foreach allows for some inline coding TikZ is a TeX package (use pgf as an engine) allow we draw nice 2D pictures. A cool example: B X F t (x) A t B t B T F (x) A B T Figure: A simple commutative diagram by Stefan Kottwitz \ b e g i n { t i k z p i c t u r e }[ f o n t=\t i n y ] \ m a t r i x (m) [ m a t r i x o f math nodes, row sep=3em, column sep=4em, minimum width=2em ] {F t ( x ) & F ( x ) \\ A t & A \\}; \path[ s t e a l t h ] (m 1 1) edge node [ l e f t ] {$\ mathcal{b} X$} (m 2 1) edge [ double ] node [ below ] {$\ mathcal{ B} t $} (m 1 2) (m 2 1. e a s t m 2 2) edge node [ below ] {$\ mathcal{b} T$} node [ above ] {$\ e x i s t s $} (m 2 2) (m 1 2) edge node [ r i g h t ] {$\ mathcal{b} T$} (m 2 2) edge [ dashed, ] (m 2 1) ; \end{ t i k z p i c t u r e }
What is TikZ? A simple template More basic examples foreach allows for some inline coding TikZ is a TeX package (use pgf as an engine) allow we draw nice 2D pictures. A cool example: B X F t (x) A t B t B T F (x) A B T Figure: A simple commutative diagram by Stefan Kottwitz \ b e g i n { t i k z p i c t u r e }[ f o n t=\t i n y ] \ m a t r i x (m) [ m a t r i x o f math nodes, row sep=3em, column sep=4em, minimum width=2em ] {F t ( x ) & F ( x ) \\ A t & A \\}; \path[ s t e a l t h ] (m 1 1) edge node [ l e f t ] {$\ mathcal{b} X$} (m 2 1) edge [ double ] node [ below ] {$\ mathcal{ B} t $} (m 1 2) (m 2 1. e a s t m 2 2) edge node [ below ] {$\ mathcal{b} T$} node [ above ] {$\ e x i s t s $} (m 2 2) (m 1 2) edge node [ r i g h t ] {$\ mathcal{b} T$} (m 2 2) edge [ dashed, ] (m 2 1) ; \end{ t i k z p i c t u r e } More cool examples: http://www.texample.net/tikz/examples/.
A simple template A simple template More basic examples foreach allows for some inline coding To use TikZ, we first need to add \usepackage{tikz} to the preamble. The following is example to plant TikZ picture in pdf by integrating TikZ sources into TeX files. y y = x 2 o x \ b e g i n { f i g u r e }[ htbp ] \ c e n t e r i n g \ b e g i n { t i k z p i c t u r e }[ s c a l e =0.8, domain = 2:2] \draw [ blue, >] ( 2, 0) (2, 0) node [ r i g h t ]{$ x $}; \draw [ red, >] p l o t ( 0, \x ) node [ r i g h t ]{$ y $}; \draw [ domain = 1:1] p l o t (\x, {\x \x }) node [ above ]{$ y=x ˆ2$}; \draw ( 0, 0) node [ below r i g h t ]{$ o $}; \end{ t i k z p i c t u r e } \end{ f i g u r e }
A simple template More basic examples foreach allows for some inline coding TikZ uses a grid system to create lines, circles, and other shapes. (0, 0) Text Block \ b e g i n { f i g u r e } \begin{ c e n t e r } \ b e g i n { t i k z p i c t u r e } \draw ( 0, 0 ) node [ l e f t ] {$(0,0) $}; \draw ( 0, 0 ) (1,1) (2,0) (3,1) (4,0) (2, 1) c y c l e ; \draw ( 2, 1 ) c i r c l e (3 pt ) ; \ f i l l [ c o l o r=g r e e n ] (5,.5) r e c t a n g l e ( 7,. 5 ) ; \draw ( 6, 0 ) node {Text Block }; \end{ t i k z p i c t u r e } \end{ c e n t e r } \end{ f i g u r e }
A simple template More basic examples foreach allows for some inline coding The \foreach \x command lets you repeat several steps \ foreach \x / \y in {0/3,1/2,3/0} { \draw (\x,\ y ) (\ x+1,\y+1) ; \draw [ c o l o r=white, l i n e width =10] (\ x+1,\y ) (\x,\ y+1) ; \draw (\ x+1,\y ) (\x,\ y+1) ; } = i j i j
What is What it is How to use it stands for a tool and a file format used to process references in LaTex A tool that I love very much is called JabRef http://jabref.sourceforge.net/.
What is What it is How to use it stands for a tool and a file format used to process references in LaTex A tool that I love very much is called JabRef http://jabref.sourceforge.net/. format consists of entries and tags: e.g. @ a r t i c l e {A12, a u t h o r = A, B, T i t l e = {Something Great }, p u b l i s h e r = { S p r i n g e r }, Year = 2012, }
What is What it is How to use it stands for a tool and a file format used to process references in LaTex A tool that I love very much is called JabRef http://jabref.sourceforge.net/. format consists of entries and tags: e.g. @ a r t i c l e {A12, a u t h o r = A, B, T i t l e = {Something Great }, p u b l i s h e r = { S p r i n g e r }, Year = 2012, } You can find bibtex formatted references online very easily and store (e.g. through JabRef) the information in a file yourfilename.bib. A bib file is like a database.
How to use What it is How to use it Change display style of the bibliography: \ bibliographystyle {} (put in preamble). Some packages (e.g. bibunits, natbib etc.) can create more fancy styles.
How to use What it is How to use it Change display style of the bibliography: \ bibliographystyle {} (put in preamble). Some packages (e.g. bibunits, natbib etc.) can create more fancy styles. To cite references: get the citation key and cite using \cite{a12}. Citation keys can be self-defined or automatically generated (if you use JabRef).
How to use What it is How to use it Change display style of the bibliography: \ bibliographystyle {} (put in preamble). Some packages (e.g. bibunits, natbib etc.) can create more fancy styles. To cite references: get the citation key and cite using \cite{a12}. Citation keys can be self-defined or automatically generated (if you use JabRef). Generate bibliography: L-B-L-L. Put your bib file (e.g. bibliography.bib) in the same folder. Input the command \bibliography{bibliography} at the right place. Compile your LaTeX file in the order: latex/pdflatex bibtex latex/pdflatex latex/pdflatex.
What it is How to use it Obtaining bibliographies from MathSciNet If you are on a departmental computer, you can access MathSciNet through the AMS: http://www.ams.org/mathscinet/ From here you can look up any published article or book. Click the MR number to take you to the reference and Select alternative format from the drop-down menu to choose Copy and paste into your.bib file, change the reference tag, and delete (or comment out using %) the MRNUMBER line.
Creating your.bib file What it is How to use it Open a new file in a TeX editor and save as bibliographyname.bib If you read an article off arxiv.org, you can prepare your own reference: @ u n p u b l is h e d {KroMro, AUTHOR = {Kronheimer, P. B. and Mrowka, T. S. }, TITLE = {Khovanov homology i s an unknot detector }, NOTE = { a r X i v : 1005.4346}, YEAR = {2010}, a r c h i v e P r e f i x = arxiv, e p r i n t = 1 0 0 5. 4 3 4 6, primaryclass = math. GT, } Make sure you put this file in the same folder as your.tex file. Keep this.bib file updated with every book and paper you read, and you will never have to look for the references!
What it is How to use it \ b i b l i o g r a p h y s t y l e {amsalpha} \ b i b l i o g r a p h y {11 D e c e m b e r B i b l i o g r a p h y } Béla Bollobás, Modern graph theory, Graduate Texts in Mathematics, vol. 184, Springer-Verlag, New York, 1998. Louis H. Kauffman, Formal knot theory, Mathematical Notes, vol. 30, Princeton University Press, Princeton, NJ, 1983.