The =1=Latex Document Preparation System
Total Page:16
File Type:pdf, Size:1020Kb
TheLATEX document preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX TheLAT X document preparation system document E Basic commands Structuring text Maths Dr Engelbert Buxbaum Changing the layout Specialties Department of Biochemistry, RUSM The departmental handout July 2008 1 TheLATEX document Name of the game preparation system Dr Engelbert Buxbaum Introduction Advantages and disadvantages Resources Structure of a LATEX document TEX typesetting system developed by Donald E. Basic commands Knuth (Stanford University) to create beautiful Structuring text documents, especially those containing maths. Maths TEX is free software with copyright vested in the Changing the layout American Mathematical Society. Specialties The departmental LATEXT EX-macroprocessor written by Leslie Lamport, handout which implements a markup-language (similar: HTML, XML). Users can concentrate on the structure of their document rather than on formatting. 2 TheLATEX document Typographic design preparation system Dr Engelbert Buxbaum Introduction Advantages and disadvantages Resources Structure of a LATEX document Basic commands Structuring text Maths I craft that needs to be learned Changing the layout I not about esthetics but about function: Books are read, Specialties The departmental not displayed in a museum handout 3 TheLATEX document Advantages preparation system Dr Engelbert Buxbaum I Several professional styles are available that make Introduction Advantages and documents look “like printed”. Changing style requires disadvantages Resources changing one single line in the document, consistency is Structure of a LATEX ensured. document Basic commands I High quality math typesetting Structuring text I Only a few commands to define the structure of text, no Maths knowledge of typography or book design required. Changing the layout I Complex scientific documents can be created Specialties The departmental automatically: handout I bibliography I index I crossreferences I table of contents, lists of figures, tables etc. I ... I Operating-system independent I Long-term storage of documents: ASCII rather than binary I Free software with source code available: Errors are corrected rapidly 4 TheLATEX document Disadvantages preparation system Dr Engelbert Buxbaum Introduction Advantages and disadvantages Resources Structure of a LATEX document Basic commands Structuring text I Learning curve Maths Changing the layout I Major changes in layout may require rewriting the style Specialties file (blessing in disguise) The departmental handout I One gets an eye for all the bad documents out there 5 TheLATEX document Resources preparation system Dr Engelbert Buxbaum Introduction Advantages and disadvantages Resources Structure of a LATEX document Basic commands Software www.ctan.org, automatically selects nearest Structuring text server Maths Help Usenet: comp.text.tex (also German: Changing the layout de.comp.text.tex) Specialties The departmental Introduction l2short available in various languages handout Literature The LATEX-companion (Mittelbach et al, 2004) Symbols Comprehensive symbol list from CTAN 6 TheLATEX document Boxes and glue preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document classes Basic commands Structuring text Maths I Box (letter) + Glue (space) + Box + ... = larger Box (word) Changing the layout Specialties I Words are treated as boxes to form lines, lines The departmental paragraphs and paragraphs pages handout I Glue can shrink and expand within limits 7 TheLATEX document Structure of a LAT X-document preparation system E Dr Engelbert Buxbaum Introduction %-*- TeX:US -*- % for text-editor Structure of a LATEX document \NeedsTeXFormat{LaTeX2e} % for TeX-system classes \documentclass[options]{style} Basic commands Structuring text \usepackage[latin1]{inputenc} Maths \usepackage[T1]{fontenc} Changing the layout Specialties The departmental \author{} handout \title{} \date{} \begin{document} \maketitle \chapter{} ... \end{document} 8 TheLATEX document Document classes preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document classes LATEX Koma-Script purpose Basic commands Structuring text article scrartcl journal papers, short reports Maths report scrreprt longer text with several chap- Changing the layout ters, e.g. thesis Specialties book scrbook books The departmental handout letter scrlttr2 letters beamer slide presentations sciposter conference posters Apart from Koma-Script another alternative style package is memoir. Also publisher-specific styles (e.g. Springer, Elsevier, Teubner etc.) 9 TheLATEX document Class options preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document classes Basic commands Structuring text Font size 10pt | 11pt | 12pt... Maths Changing the layout Paper size a4paper | legalpaper... Specialties equations fleqn, leqno The departmental handout title titlepage | notitlepage columns onecolumn | twocolumn printing oneside | twoside 10 TheLATEX document Input characters preparation system Dr Engelbert Buxbaum Introduction Some characters have special meaning in TEX, if you need Structure of a LATEX them they have to be entered as T X-commands: document E Basic commands Special characters start command $\backslash$ Hypens & Cie Structuring text n \\ note: = newline Maths $ toggle math modus \$ Changing the layout & tabulator \& Specialties % rest of line comment \% The departmental # \# handout ~ \textasciitilde | vert. lines in table \textbar _ start subscript \_ ^ start superscript \textasciicircum { } command delimiter \{ \} [] optional arguments $[ ]$ “ ” quotation marks ‘‘ ’’ >< tabbing $> <$ 11 TheLATEX document Hypen, minus ... preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document Basic commands Special characters Hypens & Cie A horizontal line can mean a lot of things, depending on length Structuring text and thickness: Maths Changing the layout O-legs O-legs Specialties The departmental 10–18 o’clock 10--18 o’clock handout ja – oder nein? ja -- oder nein? yes—or no? yes---or no? 0, 1 and –1 0, 1 and --1 12 TheLATEX document Sectioning commands preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document Basic commands Structuring text Sectioning I Fonts part{} Lists n Tables and stuff I chapter{} Graphics n I section{} Maths n Changing the layout I subsection{} n Specialties I subsubsection{} The departmental n handout I paragraph{} n 13 TheLATEX document Breaking down large documents preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document Basic commands Structuring text Sectioning Fonts Use separate files for, say, each chapter. One main file with Lists Tables and stuff limbo and commands to include the others: Graphics input{} reads file “as is” Maths n Changing the layout include{} equiv. to clearpage input{} clearpage Specialties n n n n includeonly{} used in limbo to limit files included The departmental n n handout 14 TheLATEX document What is where? preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document Basic commands Structuring text I tableofcontents Sectioning n Fonts I listoffigures Lists n Tables and stuff I listoftables Graphics n Maths I Changing the layout I bibliographystyle{plainnat} Specialties n I bibliography{references} The departmental n handout I I printindex n 15 TheLATEX document Emphasizing preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document textit{} italics, used for foreign words, species names n Basic commands etc: Staph. aureus Structuring text Sectioning textsl{} slanted Fonts n Lists emph{} used for emphasizing: this is not the case Tables and stuff n Graphics textsc{} small caps, used for persons: Neil Armstrong n Maths was the first man on the moon. Changing the layout textbf{} bold face: used to make something really stick Specialties n The departmental out. handout textsf{} sans serif, often used as base font on slides. n Also used for chemical equations. texttt{} typewriter, used for computer code or URLs: n http://www.rossmed.edu.dm/ Note: Slides use sanserif font: slanted instead of italics! 16 TheLATEX document Font sizes preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document Basic commands \tiny microscopic font Structuring text \scriptsize very tiny font (subscripts) Sectioning Fonts \footnotesize tiny font (footnotes) Lists \small small font Tables and stuff Graphics \normalsize normal font Maths \large large font Changing the layout \Large larger font Specialties The departmental \LARGE very large font handout \huge huge font \Huge very huge font Note: not a command: {\small foo bar} 17 TheLATEX document Simple lists preparation system Dr Engelbert Buxbaum Please believe me: Introduction I Structure of a LATEX Few swallows can turn winter into summer. document I Inside it’s colder than in the night. Basic commands I In the morning it pulls. Structuring text I At noon he pushes. Sectioning Fonts I In the evening she goes. Lists Tables and stu I ff Every nonsense must find an end. Graphics Maths Please believe me: Changing the layout \begin{itemize} Specialties \item{Few swallows can turn winter into summer.} The departmental \item{Inside it’s colder than in the night. handout \begin{itemize} \item{In the morning it pulls.} \item{At noon he pushes.} \item{In the evening she goes.} \end{itemize} } \item{Every nonsense must find an end.} \end{itemize} 18 TheLATEX document Descriptive lists preparation system Dr Engelbert