350 likes | 441 Views
Stijn De Jonge, Eddy Schoeters & Jeroen Buijs. What is TeX?. TeX is essentially a Markup Language (like HTML, XML and RTF) TeX written in 70´s TEX is a typesetting language written by Donald Knuth. Original format of TEX called: “plain TEX".
E N D
What is TeX? • TeX is essentially a Markup Language (like HTML, XML and RTF) • TeX written in 70´s • TEX is a typesetting language written by Donald Knuth. • Original format of TEX called: “plain TEX". • Plain TEX easy for simple documents (without equations, chapters etc). • Otherwise very tricky. • LaTeX is an extension of TeX • Macro packages to make TeX easier to use
What is LaTeX? • Leslie Lamport wrote a format of TeX called LaTeX. • Simple documents slightly harder to produce in LaTeX than plain TeX. • Otherwise much easier to use. • We will be using LaTeX2 version.
Latex vs. Word Processors • WYSIWYG - WYMIWYG • High typeset quality • Easy to include math formulas • Source file format is not bounded to a particular OS or platform • Latex implementations exists for all platforms (DOS, Windows, Unix,..) • Latex is free
Pros and cons for LaTeX • Can only view your document once you have LaTeXed your source code • Can't see how things appear while you type. • Tend to spend more time writing the actual text. • Need to remember command names • Unless you are using a front-end. • Tricky to start with • But once you get the hang of it, it becomes a lot easier to do more complicated things. • Source code for large documents comparatively small compared with word processors even if document contains many pictures. Can easily transfer file onto disk - useful if co-authoring a document.
Pros and cons for LaTeX • Large documents don't usually affect your typing speed (as long as you have a decent text editor). With word processors the whole document is constantly being reformatted as you type. • Automatically follows most laws of typography, particularly when typesetting mathematics. Many word processors don't do a very good job typesetting equations. • Documents created using LaTeX tend to have a more professional look than those created using a word processor. • Free! (Although some front-ends, such as WinEdt, are shareware.)
How to make a document • Writer only makes source • Software creates document source compiler document
How to make a document source compiler document
How to make a document source compiler document
How to make a document source compiler document
LaTeX File Structure • Preamble • Document Class • Predefined Formats (article, report, book,..). • Packages used • Added Functionality (graphics, reference style,...). • … • Main Body • Text and Bibliography References.
Body of Text • Start with \begin{document} • End with \end{document} • Typesetting Text • \\ or \newline and \newpage • Quotations • Bold \textbf{……………} or \bf • Italics \emph{…………} or \textit{………} or \it • Underline \underline{…………} or \ul • Including Multiple Files • \input{filename.tex}
Format • Sections • \section{…} = 1. Latex is Great • \subsection{…} = 1.1 Why Latex is Great • \subsubsection{…} = 1.1.1 Reason One • \appendix - changes numbering scheme • \chapter{…} - To be used with book and report document classes • Titles, Authors and others • \title{…} \author{…} • \footnote{…}
Format Contd. • \maketitle - Display Title and Author • \tableofcontents - generates TOC • \listoftables - generates LOT • \listoffigures - generates LOF • Labels • \label{marker} - Marker in document. • \pageref{marker} - Displays page no. of marker. • \ref{marker} - Displays section location of marker. • Itemize • Use either enumerate, itemize or description. • Alignment center, flushleft, flushright
Font size \tiny\scriptsize \footnotesize \small \normalsize \large \Large \LARGE\huge \Huge
Tabular • Columns • \begin{tabular}{|…|…|} • \end{tabular} • Rows • & - Split text into columns • \\ - End a row • \hline - Draw line under row • Table editors or converter from Excel to LaTeX
Images • Use epsfig package • \usepackage{epsfig} • Reference to pictures in text, pictures saved in folder • Other file formats are also possible • Pdf or png preference • MS PowerPoint, save as GIF and convert to EPS or Use some code to create a PDF image automatically \ifpdf \usepackage{graphicx} \usepackage{epstopdf} \usepackage{epsfig} \DeclareGraphicsRule{.eps}{pdf}{.pdf}{`epstopdf #1} \pdfcompresslevel=9 \else \usepackage{graphicx} \usepackage{epsfig} \fi
Floating Objects • Floating objects can stop splitting of tables and images over pages. • \begin{figure}[options] • \end{figure} • \begin{table}[options] • \end{table} • They will now appear in the • List of Figures (LOF) and • List of Tables (LOT). Options (recommendations) h = place table here t = place at top of page b = place at bottom of page p = special page only for tables and figures ! = without taking into account other rules
Example of table \begin{table}[!htp] \begin{center} \label{testtable} \begin{tabular} {l | r | c} \hline Date & Price & Size \\ \hline Yesterday & 5 & big \\ \hline Today & 3 & small \\ \hline \multicolumn{3}{c}{\today} \\ \end{tabular} \caption{Short table} \end{center} \end{table}
Mathematics • Inline math text: • \( … \), $ … $ or \begin{math} … \end{math} • Equations or formulas: • \begin{displaymath} … \end{displaymath} • \begin{equation} … \end{equation} • \begin{eqnarray}...\end{eqnarray} • Normal text in between math • \textrm{…}
Mathematics examples $ y=\frac{a^3+2c_{x}}{1+\sqrt{b_{x}}} $ \begin{equation} Q = \sum_{i=1}^{j}\int_{\mu}^{\infty}f(x_{j})dx \end{equation} \begin{displaymath} x^2 \geq 0 \qquad \textrm{for all }x \in \mathbb{R} \end{displaymath}
Chemistry • \usepackage[version=3]{mhchem} • Inline chemistry • \ce{…} • Numbered chemistry reaction • \reaction + extra definition in preamble (see manual) • Numbering will be different than math equations • $\frac{1}{2}\mathrm{H}_2\mathrm{O}$ or \ce{1/2H2O}
Chemistry examples \ce{CO2 + C <=> 2CO} \ce{X=Y#Z} $K = \frac{[\ce{Hg^2+}][\ce{Hg}]}{[\ce{Hg2^2+}]}$
Bibliography by hand \begin{thebibliography}{} \bibitem{Maex}Maex, Edel: Mindfulness: \textit{In de maalstroom van je leven} (2006), Lannoo \end{thebibliography}
Bibliography using Bibtex • Bibliography information is stored in a *.bib file, in Bibtex format. • Windows: JabRef • MacOSx : BIBdesk • Set referencing style • \bibliographystyle{style} – default plain (thesis: apacite) • Create reference section by • \bibliography{bibfile with no extension}
Creating Latex Files Your Latex File Your Bibtex File (a text file) Latex compile x3 Bibtex compile x2 Latex compile x3 Device independent output .dvi dvips compile x1 Your Postscript File
Conclusions • Latex is optimal for master and PhD thesis • Mathematical formulae are easy. • Use bibtex search engines • Only concentrate onto content
Where to get everything • MiKTeX distribution: http://www.miktex.org/ • GhostScript & GhostView & epstool for dealing with images: http://www.cs.wisc.edu/~ghost/ [Install GPL Ghostscript, GSView & epstool] • JabRef: http://jabref.sourceforge.net/ • LaTeX editor: http://www.texniccenter.org/ Nice extra: • GIMP (free Photoshop-like thing, especially useful to convert images): http://gimp-win.sourceforge.net/ • Latable - Table editor: http://ctan.org/tex-archive/help/Catalogue/entries/latable.html