Presentation is loading. Please wait.

Presentation is loading. Please wait.

LaTeX A Short Intro to Marco D. Santambrogio Politecnico di Milano Sala DEIB 2 Sept 2015 Ver. 2/9/15.

Similar presentations


Presentation on theme: "LaTeX A Short Intro to Marco D. Santambrogio Politecnico di Milano Sala DEIB 2 Sept 2015 Ver. 2/9/15."— Presentation transcript:

1 LaTeX A Short Intro to Marco D. Santambrogio Politecnico di Milano Sala Seminari @ DEIB 2 Sept 2015 Ver. 1.0 @ 2/9/15

2 What are TeX and LaTeX? LaTeX is a typesetting systems suitable for producing scientific and mathematical documents –LaTeX enables authors to typeset and print their work at the highest typographical quality. –LaTeX is pronounced “Lay-tech”. –LaTeX uses TeX formatter as its typesetting engine. TeX is a program written by Donald Kunth for typesetting text and mathematical formulas 2

3 Why Use LaTeX? Designed by academics and easily accommodates academic use. Professionally crafted predefined layouts make a document really look as if “printed.” Mathematical symbols and equations are easily integrated. Even complex structures such as footnotes, references, table of contents, and bibliographies can be generated easily. Forces author to focus on logical instead of aesthetic structure of a document. Creates more beautiful documents. 3

4 Process to Create a Document Using LaTeX 4 TeX input file file.tex DVI file file.dvi Out input file file.ps or file.pdf Run LaTeX program Run Device Driver Your source LaTeX document Device independent output > latex file.tex > xdiv file.dvi > dvips file.dvi > pdflatex file.tex Unix Commands runs latex previewer creates.ps creates.pdf directly

5 Installing LaTeX In Windows –MiKTeX MiKTeX is a typesetting system for the Windows. Download from www.miktex.org for freewww.miktex.org It is generally recommended to install MiKTeX first, then WinEdt. –WinEdt WinEdt is a text editor. WinEdt creates the source file (.tex and others). Download from www.winedt.com for free for 30 days.www.winedt.com WinEdt costs $30.

6 Installing LaTeX Other text editors –There are other text editors. –Winshell for free (http://www.winshell.de/)http://www.winshell.de/ –Scientific Workplace Combination of LaTeX and Mathematics program Does a good job of calculating and graphing, very user friendly, but expensive In Mac –TexShop Download for free http://www.uoregon.edu/~koch/texshop/http://www.uoregon.edu/~koch/texshop/ Includes everything!

7 How to Use LaTeX to Create Documents Start with a skeleton document (create it by yourself, get it from you classmates, download it from journals’ website) Fill stuff (text, formula, figure, table …) into your skeleton document Run LaTeX to generate output and make modifications Learn as you go –The not so short introduction to LaTeX2e http://tobi.oetiker.ch/lshort/lshort.pdf –Comprehensive TeX archive network http://www.ctan.org/ –Beginning LaTeX http://www.cs.cornell.edu/Info/Misc/LaTeX-Tutorial/LaTeX- Home.html –Google 7

8 Basic Document Structure \documentclass [12pt]{article} \usepackage {color} \usepackage {graphicx} \begin{document} \end{document} Define the types of the document (article, book, thesis …) Preamble. Incorporate packages or define macros here Main body, stuff to be printed, title, authors, abstract, sections, references, ….

9 Basic Document Structure… more details The format of a document is pretty simple. –In the preamble Documentclass Packages –In the front matter Title/author –In the body Contents –In the back matter bibliography

10 Basic Document Structure… more details The format of a document is pretty simple. –In the preamble Documentclass Packages –In the front matter Title/author –In the body Contents –In the back matter bibliography

11 In the Preamble You specify your document class. –Document classes: letter, article, report, book, slides(beamer, prosper) \documentclass[12pt]{article} Backslash – at the beginning of text markup command –Packages: numerous packages are available \usepackage[margin=1in]{geometry} \usepackage{setspace} \usepackage{harvard}

12 In the Front Matter \begin{document} \title{} \author{} \maketitle \begin{abstract} \end{abstract} \pagebreak

13 In the Body To begin a new section –\section{} Similarly, \subsection{}, \subsubsection{}, \subsubsubsection{} LaTeX does automatic numbering. If you don’t like it, use section*{} \emph{}, \textbf{}. \textit{} \singlespacing, \doublespacing, \onehalfspacing \centering or \begin{centering} & \end{centering}

14 Footnotes/Quotes/Equations \footnote{} \begin{quote}, \end{quote} Mathematical Equations –Math always in between $ & $ Alternatively, \begin{equation} & \end{equation} –$ 1+4=5 $ –\frac{}{}, \sqrt{}, \sum_{k=1}^{n} –^{}, _{} –\greek letters (e.g. \alpha or \Alpha)

15 Figures You can insert figures in pdf, jpg, eps, and other formats into your document. Multiple figures can be inserted using \subfigure 15 \begin{figure} \centering \includegraphics {name of the figure file} \caption{Put the caption here} \end{figure}

16 Cross Referencing LaTeX generates numbers for Theorem, Equation, Section, Figure and other environments automatically. You can access them with \label and \ref 16 \section{Introduction} \label{sec:intro} …. In Section \ref{sec:intro}, we ….

17 Citations \cite{bibtexkey} It is more convenient to create a bibliography file, called bibtex file(.bib) and use it as needed.

18 Bibliography by hand \begin{thebibliography}{} \bibitem[Come95]{Come95} Comer, D. E., {\it Internetworking with TCP/IP: Principles, Protocols and Architecture}, volume 1, 3rd edition. Prentice-Hall, 1995. \end{thebibliography}

19 Bibliography using Bibtex Bibliography information is stored in a *.bib file, in Bibtex format. Include chicago package –\usepackage{chicago} Set referencing style –\bibliographystyle{chicago} Create reference section by –\bibliography{bibfile with no extension}

20 In the *.bib file… @book{Come95, author=“D. E. Comer”, title={Internetworking with TCP/IP: Principles, Protocols and Architecture}, publisher=“Prentice-Hall”, year=1995, volume=1, edition=“Third”}

21 How to cite Citing references in text – \cite{cuc98} = (Cuce 1998) – \citeN{cru98} = Crud (1998) – \shortcite{tom98} = (Tom, et. al. 1998) Creating Bibtex Files –Use Emacs with extensions. –or copy Bibtex entries from bibliography database.

22 In the Back Matter Do not forget bibliography{filename} –Make sure that the bibtex file is saved in the same location where the main tex file is saved. Do not forget \end{document}

23 To Do… Install all the necessary tools Try to write your first LaTeX doc How to create a list? How to create numbered list? How to add a table? How to organize the doc over several files (e.g. one file per chapter/section)? 23

24 Credits PRISM Brownbag Series, Byungwon Woo Dept. of Applied Math & Statistics, School of Engineering, University of California Santa Cruz Thomas Madsen 24

25 QUESTIONS? 25


Download ppt "LaTeX A Short Intro to Marco D. Santambrogio Politecnico di Milano Sala DEIB 2 Sept 2015 Ver. 2/9/15."

Similar presentations


Ads by Google