/
LATEX:Anunocialreferencemanual LATEX:Anunocialreferencemanual

LATEX:Anunocialreferencemanual - PDF document

faustina-dinatale
faustina-dinatale . @faustina-dinatale
Follow
465 views
Uploaded On 2016-06-20

LATEX:Anunocialreferencemanual - PPT Presentation

May2014 httphomegnaorglatexrefman i ShortContentsLATEX2e 1 1Aboutthisdocument 2 2OverviewofLATEX ID: 369755

May2014 http://home.gna.org/latexrefman i ShortContentsLATEX2e:::::::::::::::::::::::::::::::::::::::::::::::: 1 1Aboutthisdocument:::::::::::::::::::::::::::::::::: 2 2OverviewofLATEX::::::::::::::::

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "LATEX:Anunocialreferencemanual" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

LATEX2e:Anunocialreferencemanual October2018 https://puszcza.gnu.org.ua/software/latexrefman ThisdocumentisanunocialreferencemanualforLATEX,adocumentpreparationsystem,versionofOctober2018.ThismanualwasoriginallytranslatedfromLATEX.HLPv1.0aintheVMSHelpLibrary.Thepre-translationversionwaswrittenbyGeorgeD.GreenwadeofSamHoustonStateUniversity.TheLATEX2.09versionwaswrittenbyStephenGilmore.TheLATEX2eversionwasadaptedfromthisbyTorstenMartinsen.KarlBerrymadefurtherupdatesandaddi-tions,andgratefullyacknowledgesusingHypertextHelpwithLATEX,bySheldonGreen,andLATEXCommandSummary(forLATEX2.09)byL.BotwayandC.Biemesderfer(publishedbytheTEXUsersGroupasTEXniquesnumber10),asreferencematerial.Wealsogratefullyacknowledgeadditionalmaterialappearinginlatex2e-referencebyMartinHerbertDietze.(Fromthesereferencesnotextwasdirectlycopied.)Copyright2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018KarlBerry.Copyright1988,1994,2007StephenGilmore.Copyright1994,1995,1996TorstenMartinsen.Permissionisgrantedtomakeanddistributeverbatimcopiesofthismanualprovidedthecopyrightnoticeandthispermissionnoticearepreservedonallcopies.Permissionisgrantedtocopyanddistributemodi edversionsofthismanualunderthecon-ditionsforverbatimcopying,providedthattheentireresultingderivedworkisdistributedunderthetermsofapermissionnoticeidenticaltothisone.Permissionisgrantedtocopyanddistributetranslationsofthismanualintoanotherlan-guage,undertheaboveconditionsformodi edversions. i ShortContentsLATEX2e:Anunocialreferencemanual::::::::::::::::::::::: 1 1Aboutthisdocument:::::::::::::::::::::::::::::::::: 2 2OverviewofLATEX:::::::::::::::::::::::::::::::::::: 3 3Documentclasses:::::::::::::::::::::::::::::::::::::: 7 4Fonts:::::::::::::::::::::::::::::::::::::::::::::: 16 5Layout::::::::::::::::::::::::::::::::::::::::::::: 22 6Sectioning:::::::::::::::::::::::::::::::::::::::::: 30 7Crossreferences:::::::::::::::::::::::::::::::::::::: 41 8Environments:::::::::::::::::::::::::::::::::::::::: 44 9Linebreaking:::::::::::::::::::::::::::::::::::::::: 90 10Pagebreaking::::::::::::::::::::::::::::::::::::::: 95 11Footnotes::::::::::::::::::::::::::::::::::::::::::: 98 12De nitions::::::::::::::::::::::::::::::::::::::::: 103 13Counters::::::::::::::::::::::::::::::::::::::::::: 116 14Lengths::::::::::::::::::::::::::::::::::::::::::: 120 15Makingparagraphs:::::::::::::::::::::::::::::::::: 125 16Mathformulas:::::::::::::::::::::::::::::::::::::: 129 17Modes::::::::::::::::::::::::::::::::::::::::::::: 151 18Pagestyles::::::::::::::::::::::::::::::::::::::::: 153 19Spaces::::::::::::::::::::::::::::::::::::::::::::: 157 20Boxes::::::::::::::::::::::::::::::::::::::::::::: 169 21Color::::::::::::::::::::::::::::::::::::::::::::: 175 22Graphics::::::::::::::::::::::::::::::::::::::::::: 179 23Specialinsertions:::::::::::::::::::::::::::::::::::: 190 24Splittingtheinput::::::::::::::::::::::::::::::::::: 198 25Front/backmatter::::::::::::::::::::::::::::::::::: 202 26Letters:::::::::::::::::::::::::::::::::::::::::::: 213 27Terminalinput/output::::::::::::::::::::::::::::::: 218 28Commandline:::::::::::::::::::::::::::::::::::::: 220 ADocumenttemplates::::::::::::::::::::::::::::::::: 224 Index::::::::::::::::::::::::::::::::::::::::::::::::: 229 ii TableofContentsLATEX2e:Anunocialreferencemanual::::::::::: 1 1Aboutthisdocument::::::::::::::::::::::::::: 2 2OverviewofLATEX::::::::::::::::::::::::::::::: 3 2.1Startingandending:::::::::::::::::::::::::::::::::::::::::::: 3 2.2Output les:::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.3TEXengines:::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.4LATEXcommandsyntax::::::::::::::::::::::::::::::::::::::::: 5 2.5Environment::::::::::::::::::::::::::::::::::::::::::::::::::: 5 2.6CTAN:theComprehensiveTEXArchiveNetwork::::::::::::::: 6 3Documentclasses:::::::::::::::::::::::::::::::: 7 3.1Documentclassoptions::::::::::::::::::::::::::::::::::::::::: 7 3.2Additionalpackages:::::::::::::::::::::::::::::::::::::::::::: 8 3.3Classandpackageconstruction::::::::::::::::::::::::::::::::: 9 3.3.1Classandpackagestructure:::::::::::::::::::::::::::::::: 9 3.3.2Classandpackagecommands::::::::::::::::::::::::::::: 10 4Fonts:::::::::::::::::::::::::::::::::::::::::::: 16 4.1Fontstyles:::::::::::::::::::::::::::::::::::::::::::::::::::: 16 4.2Fontsizes::::::::::::::::::::::::::::::::::::::::::::::::::::: 18 4.3Low-levelfontcommands:::::::::::::::::::::::::::::::::::::: 18 5Layout:::::::::::::::::::::::::::::::::::::::::: 22 5.1\onecolumn::::::::::::::::::::::::::::::::::::::::::::::::::: 22 5.2\twocolumn::::::::::::::::::::::::::::::::::::::::::::::::::: 22 5.3\flushbottom::::::::::::::::::::::::::::::::::::::::::::::::: 24 5.4\raggedbottom:::::::::::::::::::::::::::::::::::::::::::::::: 24 5.5Pagelayoutparameters:::::::::::::::::::::::::::::::::::::::: 24 5.6Floats::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 6Sectioning::::::::::::::::::::::::::::::::::::::: 30 6.1\part::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 31 6.2\chapter:::::::::::::::::::::::::::::::::::::::::::::::::::::: 32 6.3\section:::::::::::::::::::::::::::::::::::::::::::::::::::::: 33 6.4\subsection:::::::::::::::::::::::::::::::::::::::::::::::::: 34 6.5\subsubsection,\paragraph,\subparagraph:::::::::::::::: 35 6.6\appendix:::::::::::::::::::::::::::::::::::::::::::::::::::: 36 6.7\frontmatter,\mainmatter,\backmatter:::::::::::::::::::: 37 6.8\@startsection:::::::::::::::::::::::::::::::::::::::::::::: 37 iii 7Crossreferences:::::::::::::::::::::::::::::::: 41 7.1\label:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 41 7.2\pageref:::::::::::::::::::::::::::::::::::::::::::::::::::::: 42 7.3\ref:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 42 8Environments::::::::::::::::::::::::::::::::::: 44 8.1abstract:::::::::::::::::::::::::::::::::::::::::::::::::::::: 44 8.2array::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 45 8.3center:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 46 8.3.1\centering:::::::::::::::::::::::::::::::::::::::::::::: 47 8.4description:::::::::::::::::::::::::::::::::::::::::::::::::: 47 8.5displaymath:::::::::::::::::::::::::::::::::::::::::::::::::: 48 8.6document:::::::::::::::::::::::::::::::::::::::::::::::::::::: 49 8.6.1\AtBeginDocument::::::::::::::::::::::::::::::::::::::: 49 8.6.2\AtEndDocument:::::::::::::::::::::::::::::::::::::::::: 49 8.7enumerate:::::::::::::::::::::::::::::::::::::::::::::::::::: 49 8.8eqnarray:::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 8.9equation:::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 8.10figure::::::::::::::::::::::::::::::::::::::::::::::::::::::: 52 8.11filecontents:Writeanexternal le::::::::::::::::::::::::: 53 8.12flushleft::::::::::::::::::::::::::::::::::::::::::::::::::: 53 8.12.1\raggedright::::::::::::::::::::::::::::::::::::::::::: 54 8.13flushright:::::::::::::::::::::::::::::::::::::::::::::::::: 54 8.13.1\raggedleft:::::::::::::::::::::::::::::::::::::::::::: 55 8.14itemize:::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 8.15letterenvironment:writingletters:::::::::::::::::::::::::: 56 8.16list::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 57 8.16.1\item:Anentryinalist:::::::::::::::::::::::::::::::: 61 8.16.2trivlist:Arestrictedformoflist::::::::::::::::::::: 62 8.17math::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 62 8.18minipage:::::::::::::::::::::::::::::::::::::::::::::::::::: 63 8.19picture:::::::::::::::::::::::::::::::::::::::::::::::::::::: 65 8.19.1\put:::::::::::::::::::::::::::::::::::::::::::::::::::: 67 8.19.2\multiput:::::::::::::::::::::::::::::::::::::::::::::: 67 8.19.3\qbezier:::::::::::::::::::::::::::::::::::::::::::::::: 68 8.19.4\graphpaper:::::::::::::::::::::::::::::::::::::::::::: 68 8.19.5\line::::::::::::::::::::::::::::::::::::::::::::::::::: 68 8.19.6\linethickness:::::::::::::::::::::::::::::::::::::::: 69 8.19.7\thinlines::::::::::::::::::::::::::::::::::::::::::::: 69 8.19.8\thicklines:::::::::::::::::::::::::::::::::::::::::::: 69 8.19.9\circle::::::::::::::::::::::::::::::::::::::::::::::::: 69 8.19.10\oval:::::::::::::::::::::::::::::::::::::::::::::::::: 70 8.19.11\shortstack::::::::::::::::::::::::::::::::::::::::::: 70 8.19.12\vector:::::::::::::::::::::::::::::::::::::::::::::::: 71 8.19.13\makebox(picture)::::::::::::::::::::::::::::::::::::: 71 8.19.14\framebox(picture):::::::::::::::::::::::::::::::::::: 72 8.19.15\frame::::::::::::::::::::::::::::::::::::::::::::::::: 72 8.19.16\dashbox:::::::::::::::::::::::::::::::::::::::::::::: 72 iv 8.20quotation"e:::::::::::::::::::::::::::::::::::::::::: 73 8.21tabbing:::::::::::::::::::::::::::::::::::::::::::::::::::::: 73 8.22table:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 76 8.23tabular:::::::::::::::::::::::::::::::::::::::::::::::::::::: 77 8.23.1\multicolumn::::::::::::::::::::::::::::::::::::::::::: 80 8.23.2\vline:::::::::::::::::::::::::::::::::::::::::::::::::: 81 8.23.3\cline:::::::::::::::::::::::::::::::::::::::::::::::::: 81 8.23.4\hline:::::::::::::::::::::::::::::::::::::::::::::::::: 82 8.24thebibliography:::::::::::::::::::::::::::::::::::::::::::: 82 8.24.1\bibitem:::::::::::::::::::::::::::::::::::::::::::::::: 83 8.24.2\cite::::::::::::::::::::::::::::::::::::::::::::::::::: 84 8.24.3\nocite::::::::::::::::::::::::::::::::::::::::::::::::: 84 8.24.4UsingBibTEX::::::::::::::::::::::::::::::::::::::::::: 85 8.25theorem:::::::::::::::::::::::::::::::::::::::::::::::::::::: 86 8.26titlepage::::::::::::::::::::::::::::::::::::::::::::::::::: 86 8.27verbatim:::::::::::::::::::::::::::::::::::::::::::::::::::: 87 8.27.1\verb::::::::::::::::::::::::::::::::::::::::::::::::::: 87 8.28verse:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 88 9Linebreaking::::::::::::::::::::::::::::::::::: 90 9.1\\::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 90 9.2\obeycr&\restorecr:::::::::::::::::::::::::::::::::::::::: 91 9.3\newline:::::::::::::::::::::::::::::::::::::::::::::::::::::: 92 9.4\-(discretionaryhyphen):::::::::::::::::::::::::::::::::::::: 92 9.5\discretionary(generalizedhyphenationpoint):::::::::::::: 92 9.6\fussy&\sloppy:::::::::::::::::::::::::::::::::::::::::::: 93 9.6.1sloppypar::::::::::::::::::::::::::::::::::::::::::::::: 93 9.7\hyphenation::::::::::::::::::::::::::::::::::::::::::::::::: 94 9.8\linebreak&\nolinebreak:::::::::::::::::::::::::::::::::: 94 10Pagebreaking::::::::::::::::::::::::::::::::: 95 10.1\clearpage&\cleardoublepage:::::::::::::::::::::::::::: 95 10.2\newpage:::::::::::::::::::::::::::::::::::::::::::::::::::: 96 10.3\enlargethispage::::::::::::::::::::::::::::::::::::::::::: 96 10.4\pagebreak&\nopagebreak::::::::::::::::::::::::::::::::: 97 11Footnotes:::::::::::::::::::::::::::::::::::::: 98 11.1\footnote::::::::::::::::::::::::::::::::::::::::::::::::::: 98 11.2\footnotemark:::::::::::::::::::::::::::::::::::::::::::::: 99 11.3\footnotetext::::::::::::::::::::::::::::::::::::::::::::: 100 11.4Footnotesinsectionheadings:::::::::::::::::::::::::::::::: 100 11.5Footnotesinatable::::::::::::::::::::::::::::::::::::::::: 100 11.6Footnotesoffootnotes::::::::::::::::::::::::::::::::::::::: 102 v 12De nitions::::::::::::::::::::::::::::::::::: 103 12.1\newcommand&\renewcommand::::::::::::::::::::::::::::: 103 12.2\providecommand::::::::::::::::::::::::::::::::::::::::::: 105 12.3\makeatletter&\makeatother:::::::::::::::::::::::::::: 105 12.4\@ifstar::::::::::::::::::::::::::::::::::::::::::::::::::: 106 12.5\newcounter:Allocatingacounter:::::::::::::::::::::::::: 107 12.6\newlength::::::::::::::::::::::::::::::::::::::::::::::::: 107 12.7\newsavebox:::::::::::::::::::::::::::::::::::::::::::::::: 108 12.8\newenvironment&\renewenvironment:::::::::::::::::::: 108 12.9\newtheorem:::::::::::::::::::::::::::::::::::::::::::::::: 110 12.10\newfont:::::::::::::::::::::::::::::::::::::::::::::::::: 112 12.11\protect:::::::::::::::::::::::::::::::::::::::::::::::::: 113 12.12\ignorespaces&\ignorespacesafterend::::::::::::::::: 113 13Counters::::::::::::::::::::::::::::::::::::: 116 13.1\alph\Alph\arabic\roman\Roman\fnsymbol:Printingcounters::::::::::::::::::::::::::::::::::: 116 13.2\usecounter:::::::::::::::::::::::::::::::::::::::::::::::: 117 13.3\value:::::::::::::::::::::::::::::::::::::::::::::::::::::: 117 13.4\setcounter:::::::::::::::::::::::::::::::::::::::::::::::: 118 13.5\addtocounter::::::::::::::::::::::::::::::::::::::::::::: 118 13.6\refstepcounter::::::::::::::::::::::::::::::::::::::::::: 118 13.7\stepcounter::::::::::::::::::::::::::::::::::::::::::::::: 119 13.8\day&\month&\year:::::::::::::::::::::::::::::::::::: 119 14Lengths::::::::::::::::::::::::::::::::::::::: 120 14.1Unitsoflength:::::::::::::::::::::::::::::::::::::::::::::: 121 14.2\setlength::::::::::::::::::::::::::::::::::::::::::::::::: 122 14.3\addtolength::::::::::::::::::::::::::::::::::::::::::::::: 122 14.4\settodepth:::::::::::::::::::::::::::::::::::::::::::::::: 123 14.5\settoheight::::::::::::::::::::::::::::::::::::::::::::::: 123 14.6\settowidth:::::::::::::::::::::::::::::::::::::::::::::::: 123 15Makingparagraphs:::::::::::::::::::::::::: 125 15.1\par:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 125 15.2\indent&\noindent::::::::::::::::::::::::::::::::::::::: 126 15.3\parindent&\parskip:::::::::::::::::::::::::::::::::::: 127 15.4Marginalnotes:::::::::::::::::::::::::::::::::::::::::::::: 127 16Mathformulas::::::::::::::::::::::::::::::: 129 16.1Subscripts&superscripts:::::::::::::::::::::::::::::::::::: 130 16.2Mathsymbols::::::::::::::::::::::::::::::::::::::::::::::: 131 16.2.1Blackboardbold:::::::::::::::::::::::::::::::::::::::: 142 16.2.2Calligraphic:::::::::::::::::::::::::::::::::::::::::::: 142 16.2.3\boldmath&\unboldmath::::::::::::::::::::::::::::: 142 16.2.4Dots,horizontalorvertical::::::::::::::::::::::::::::: 143 vi 16.3Mathfunctions:::::::::::::::::::::::::::::::::::::::::::::: 144 16.4Mathaccents:::::::::::::::::::::::::::::::::::::::::::::::: 145 16.5Over-andUnderlining::::::::::::::::::::::::::::::::::::::: 146 16.6Spacinginmathmode::::::::::::::::::::::::::::::::::::::: 146 16.6.1\smash::::::::::::::::::::::::::::::::::::::::::::::::: 147 16.6.2\phantom&\vphantom&\hphantom::::::::::::::::::: 148 16.7Mathmiscellany::::::::::::::::::::::::::::::::::::::::::::: 149 16.7.1Coloncharacter:&\colon:::::::::::::::::::::::::::: 149 16.7.2\*:::::::::::::::::::::::::::::::::::::::::::::::::::::: 149 16.7.3\frac:::::::::::::::::::::::::::::::::::::::::::::::::: 149 16.7.4\left&\right:::::::::::::::::::::::::::::::::::::::: 150 16.7.5\sqrt:::::::::::::::::::::::::::::::::::::::::::::::::: 150 16.7.6\stackrel::::::::::::::::::::::::::::::::::::::::::::: 150 17Modes:::::::::::::::::::::::::::::::::::::::: 151 17.1\ensuremath:::::::::::::::::::::::::::::::::::::::::::::::: 151 18Pagestyles::::::::::::::::::::::::::::::::::: 153 18.1\maketitle::::::::::::::::::::::::::::::::::::::::::::::::: 153 18.2\pagenumbering:::::::::::::::::::::::::::::::::::::::::::: 154 18.3\pagestyle::::::::::::::::::::::::::::::::::::::::::::::::: 155 18.4\thispagestyle:::::::::::::::::::::::::::::::::::::::::::: 156 19Spaces:::::::::::::::::::::::::::::::::::::::: 157 19.1\enspace&\quad&\qquad:::::::::::::::::::::::::::::::: 157 19.2\hspace:::::::::::::::::::::::::::::::::::::::::::::::::::: 157 19.3\hfill:::::::::::::::::::::::::::::::::::::::::::::::::::::: 158 19.4\hss:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 158 19.5\spacefactor::::::::::::::::::::::::::::::::::::::::::::::: 159 19.5.1\@:::::::::::::::::::::::::::::::::::::::::::::::::::::: 160 19.5.2\frenchspacing::::::::::::::::::::::::::::::::::::::: 160 19.5.3\normalsfcodes::::::::::::::::::::::::::::::::::::::: 161 19.6Backslash-space,\:::::::::::::::::::::::::::::::::::::::::: 161 19.7~:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 161 19.8\thinspace&\negthinspace:::::::::::::::::::::::::::::: 162 19.9\/:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 163 19.10\hrulefill&\dotfill::::::::::::::::::::::::::::::::::: 163 19.11\bigskip&\medskip&\smallskip:::::::::::::::::::::: 164 19.12\bigbreak&\medbreak&\smallbreak::::::::::::::::::: 165 19.13\strut:::::::::::::::::::::::::::::::::::::::::::::::::::: 165 19.14\vspace::::::::::::::::::::::::::::::::::::::::::::::::::: 166 19.15\vfill:::::::::::::::::::::::::::::::::::::::::::::::::::: 167 19.16\addvspace:::::::::::::::::::::::::::::::::::::::::::::::: 168 vii 20Boxes::::::::::::::::::::::::::::::::::::::::: 169 20.1\mbox&\makebox:::::::::::::::::::::::::::::::::::::::::: 169 20.2\fbox&\framebox::::::::::::::::::::::::::::::::::::::::: 170 20.3\parbox:::::::::::::::::::::::::::::::::::::::::::::::::::: 171 20.4\raisebox:::::::::::::::::::::::::::::::::::::::::::::::::: 172 20.5\sbox&\savebox:::::::::::::::::::::::::::::::::::::::::: 173 20.6lrbox::::::::::::::::::::::::::::::::::::::::::::::::::::::: 174 20.7\usebox:::::::::::::::::::::::::::::::::::::::::::::::::::: 174 21Color::::::::::::::::::::::::::::::::::::::::: 175 21.1colorpackageoptions::::::::::::::::::::::::::::::::::::::: 175 21.2Colormodels:::::::::::::::::::::::::::::::::::::::::::::::: 175 21.3Commandsforcolor::::::::::::::::::::::::::::::::::::::::: 176 21.3.1De necolors::::::::::::::::::::::::::::::::::::::::::: 176 21.3.2Coloredtext:::::::::::::::::::::::::::::::::::::::::::: 176 21.3.3Coloredboxes:::::::::::::::::::::::::::::::::::::::::: 178 21.3.4Coloredpages:::::::::::::::::::::::::::::::::::::::::: 178 22Graphics:::::::::::::::::::::::::::::::::::::: 179 22.1graphicspackageoptions::::::::::::::::::::::::::::::::::: 179 22.2graphicspackagecon guration::::::::::::::::::::::::::::: 180 22.2.1\graphicspath::::::::::::::::::::::::::::::::::::::::: 180 22.2.2\DeclareGraphicsExtensions::::::::::::::::::::::::: 181 22.2.3\DeclareGraphicsRule:::::::::::::::::::::::::::::::: 182 22.3Commandsforgraphics::::::::::::::::::::::::::::::::::::: 183 22.3.1\includegraphics::::::::::::::::::::::::::::::::::::: 183 22.3.2\rotatebox:::::::::::::::::::::::::::::::::::::::::::: 188 22.3.3\scalebox::::::::::::::::::::::::::::::::::::::::::::: 189 22.3.4\resizebox:::::::::::::::::::::::::::::::::::::::::::: 189 23Specialinsertions:::::::::::::::::::::::::::: 190 23.1Reservedcharacters::::::::::::::::::::::::::::::::::::::::: 190 23.2Upperandlowercase:::::::::::::::::::::::::::::::::::::::: 190 23.3Symbolsbyfontposition:::::::::::::::::::::::::::::::::::: 191 23.4Textsymbols:::::::::::::::::::::::::::::::::::::::::::::::: 191 23.5Accents::::::::::::::::::::::::::::::::::::::::::::::::::::: 194 23.6AdditionalLatinletters::::::::::::::::::::::::::::::::::::: 195 23.7\rule::::::::::::::::::::::::::::::::::::::::::::::::::::::: 196 23.8\today:::::::::::::::::::::::::::::::::::::::::::::::::::::: 197 24Splittingtheinput::::::::::::::::::::::::::: 198 24.1\endinput:::::::::::::::::::::::::::::::::::::::::::::::::: 198 24.2\include&\includeonly:::::::::::::::::::::::::::::::::: 199 24.3\input:::::::::::::::::::::::::::::::::::::::::::::::::::::: 201 viii 25Front/backmatter::::::::::::::::::::::::::: 202 25.1Tableofcontentsetc.:::::::::::::::::::::::::::::::::::::::: 202 25.1.1\addcontentsline::::::::::::::::::::::::::::::::::::: 203 25.1.2\addtocontents::::::::::::::::::::::::::::::::::::::: 204 25.1.3\nofiles:::::::::::::::::::::::::::::::::::::::::::::: 205 25.2Indexes::::::::::::::::::::::::::::::::::::::::::::::::::::: 205 25.2.1\index::::::::::::::::::::::::::::::::::::::::::::::::: 206 25.2.2makeindex::::::::::::::::::::::::::::::::::::::::::::: 207 25.2.3\printindex::::::::::::::::::::::::::::::::::::::::::: 210 25.3Glossaries::::::::::::::::::::::::::::::::::::::::::::::::::: 210 25.3.1\newglossaryentry:::::::::::::::::::::::::::::::::::: 211 25.3.2\gls::::::::::::::::::::::::::::::::::::::::::::::::::: 212 26Letters:::::::::::::::::::::::::::::::::::::::: 213 26.1\address::::::::::::::::::::::::::::::::::::::::::::::::::: 214 26.2\cc::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 214 26.3\closing::::::::::::::::::::::::::::::::::::::::::::::::::: 214 26.4\encl::::::::::::::::::::::::::::::::::::::::::::::::::::::: 215 26.5\location:::::::::::::::::::::::::::::::::::::::::::::::::: 215 26.6\makelabels:::::::::::::::::::::::::::::::::::::::::::::::: 215 26.7\name::::::::::::::::::::::::::::::::::::::::::::::::::::::: 216 26.8\opening::::::::::::::::::::::::::::::::::::::::::::::::::: 216 26.9\ps::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 216 26.10\signature:::::::::::::::::::::::::::::::::::::::::::::::: 217 26.11\telephone:::::::::::::::::::::::::::::::::::::::::::::::: 217 27Terminalinput/output:::::::::::::::::::::: 218 27.1\typein:::::::::::::::::::::::::::::::::::::::::::::::::::: 218 27.2\typeout::::::::::::::::::::::::::::::::::::::::::::::::::: 218 28Commandline::::::::::::::::::::::::::::::: 220 28.1Commandlineoptions:::::::::::::::::::::::::::::::::::::: 220 28.2Commandlineinput:::::::::::::::::::::::::::::::::::::::: 222 28.3Recoveringfromerrors:::::::::::::::::::::::::::::::::::::: 222 AppendixADocumenttemplates::::::::::::: 224 A.1beamertemplate::::::::::::::::::::::::::::::::::::::::::::: 224 A.2articletemplate:::::::::::::::::::::::::::::::::::::::::::: 224 A.3booktemplate::::::::::::::::::::::::::::::::::::::::::::::: 225 A.4Largerbooktemplate:::::::::::::::::::::::::::::::::::::::: 225 A.5tugboattemplate:::::::::::::::::::::::::::::::::::::::::::: 226 Index:::::::::::::::::::::::::::::::::::::::::::::: 229 1 LATEX2e:AnunocialreferencemanualThisdocumentisanunocialreferencemanual(versionofOctober2018)forLATEX2e,adocumentpreparationsystem. 2 1AboutthisdocumentThisisanunocialreferencemanualfortheLATEX2edocumentpreparationsystem,whichisamacropackagefortheTEXtypesettingprogram(see Chapter2[Overview],page3 ).Thisdocument'shomepageis https://puszcza.gnu.org.ua/software/latexrefman .Thereyoucangetthesources,subscribetothemailinglistorreaditsarchives,seeotherinfrastructure,andgetthecurrentoutputinvariousformats.Inparticular,theoutputcomesintwowebformats.Probablythemostconvenientone,shownat http://latexref.xyz/ ,haspagesforeachtopicandsoisgoodforaquicklookup;seealsothenotethereabouteasy-to-rememberlinks.Theother,shownat http://svn.gnu.org.ua/viewvc/latexrefman/trunk/latex2e.html?view=co ,hasalltheinformationonsinglepage.Inthisdocument,wewillmostlyjustuse`LATEX'ratherthan`LATEX2e',sincethepreviousversionofLATEX(2.09)wasfrozendecadesago.LATEXiscurrentlymaintainedbyagroupofvolunteers( http://latex-project.org ).TheocialdocumentationwrittenbytheLATEXprojectisavailablefromtheirwebsite.ThisdocumentiscompletelyunocialandhasnotbeenreviewedbytheLATEXmaintainers.Donotsendbugreportsoranythingelseaboutthisdocumenttothem.Instead,pleasesendallcommentsto latexrefman@tug.org .Thisdocumentisareference.ThereisavastarrayofothersourcesofinformationaboutLATEX,atalllevels.Hereareafewintroductions. http://ctan.org/pkg/latex-doc-ptr TwopagesofrecommendedreferencestoLATEXdocumentation. http://ctan.org/pkg/first-latex-doc Writingyour rstdocument,withabitofbothtextandmath. http://ctan.org/pkg/usrguide TheguidefordocumentauthorsthatismaintainedaspartofLATEX.Manyotherguidesbymanyotherpeoplearealsoavailable,independentofLATEXitself;onesuchisthenextitem: http://ctan.org/pkg/lshort AshortintroductiontoLATEX,translatedtomanylanguages. http://tug.org/begin.html IntroductiontotheTEXsystem,includingLATEX,withfurtherreferences. 3 2OverviewofLATEXLATEXisasystemfortypesettingdocuments.ItwasoriginallycreatedbyLeslieLamportandisnowmaintainedbyagroupofvolunteers( http://latex-project.org ).Itiswidelyused,particularlyforcomplexandtechnicaldocuments,suchasthoseinvolvingmathematics.ALATEXuserwritesaninput lecontainingtextalongwithinterspersedcommands,forinstancecommandsdescribinghowthetextshouldbeformatted.ItisimplementedasasetofrelatedcommandsthatinterfacewithDonaldE.Knuth'sTEXtypesettingprogram(thetechnicaltermisthatLATEXisamacropackagefortheTEXengine).Theuserproducestheoutputdocumentbygivingthatinput letotheTEXengine.ThetermLATEXisalsosometimesusedtomeanthelanguageinwhichthedocumentismarkedup,thatis,tomeanthesetofcommandsavailabletoaLATEXuser.ThenameLATEXisshortfor\LamportTEX".ItispronouncedLAH-teckorLAY-teck,orsometimesLAY-tecks.Insideadocument,producethelogowith\LaTeX.Whereuseofthelogoisnotsensible,suchasinplaintext,writeitas`LaTeX'.2.1StartingandendingLATEX leshaveasimpleglobalstructure,withastandardbeginningandending.Thisisasmallexample.\documentclass{article}\begin{document}Hello,\LaTeX\world.\end{document}EveryLATEXdocumenthasa\begin{document}lineandan\end{document}line.Here,the`article'isthedocumentclass.Itisimplementedina learticle.cls.Youcanuseanydocumentclassonyoursystem.Afewdocumentclassesarede nedbyLATEXitself,andvastarrayofothersarewidelyavailable.See Chapter3[Documentclasses],page7 .YoucanincludeotherLATEXcommandsbetweenthe\documentclassandthe\begin{document}commands.Thisareaiscalledthepreamble.The\begin{document},\end{document}pairde nesanenvironment;the`document'environment(andnoothers)isrequiredinallLATEXdocuments(see Section8.6[document],page49 ).LATEXmakeavailabletoyoumanyenvironmentsthataredocumentedhere(see Chapter8[Environments],page44 ).Manymoreareavailabletoyoufromexternalpackages,mostimportantlythoseavailableatCTAN(see Section2.6[CTAN],page6 ).ThefollowingsectionsdiscusshowtoproducePDForotheroutputfromaLATEXinput le.2.2Output lesLATEXproducesamainoutput leandatleasttwoauxiliary les.Themainoutput le'snameendsineither.dvior.pdf..dviIfLATEXisinvokedwiththesystemcommandlatexthenitproducesaDeViceIndependent le,withextension.dvi.Youcanviewthis lewithacommand Chapter2:OverviewofLATEX4 suchasxdvi,orconvertittoaPostScript.ps lewithdvipsortoaPortableDocumentFormat.pdf lewithdvipdfmx.Thecontentsofthe lecanbedumpedinhuman-readableformwithdvitype.AvastarrayofotherDVIutilityprogramsareavailable( http://mirror.ctan.org/dviware )..pdfIfLATEXisinvokedviathesystemcommandpdflatex,amongothercommands(see Section2.3[TEXengines],page4 ),thenthemainoutputisaPortableDocumentFormat(PDF) le.Typicallythisisaself-contained le,withallfontsandimagesincluded.LATEXalsoproducesatleasttwoadditional les..logThistranscript lecontainssummaryinformationsuchasalistofloadedpack-ages.Italsoincludesdiagnosticmessagesandperhapsadditionalinformationforanyerrors..auxAuxiliaryinformationisusedbyLATEXforthingssuchascrossreferences.Forexample,the rsttimethatLATEX ndsaforwardreference|acrossreferencetosomethingthathasnotyetappearedinthesource|itwillappearintheoutputasadoubledquestionmark??.Whenthereferred-tospotdoeseventuallyappearinthesourcethenLATEXwritesitslocationinformationtothis.aux le.Onthenextinvocation,LATEXreadsthelocationinformationfromthis leandusesittoresolvethereference,replacingthedoublequestionmarkwiththerememberedlocation.LATEXmayproduceyetmore les,characterizedbythe lenameending.Theseincludea.lof lethatisusedtomakealistof gures,a.lot leusedtomakealistoftables,anda.toc leusedtomakeatableofcontents(see Section25.1[Tableofcontentsetc.],page202 ).Aparticularclassmaycreateothers;thelistisopen-ended.2.3TEXenginesLATEXisde nedtobeasetofcommandsthatarerunbyaTEXimplementation(see Chapter2[Overview],page3 ).Thissectiongivesaterseoverviewofthemainprograms(seealso Chapter28[Commandline],page220 ).latexpdflatexInTEXLive( http://tug.org/texlive ),ifLATEXisinvokedviaeitherthesystemcommandlatexorpdflatex,thenthepdfTEXengineisrun( http://ctan.org/pkg/pdftex ).Wheninvokedaslatex,themainoutputisa.dvi le;aspdflatex,themainoutputisa.pdf le.pdfTEXincorporatesthee-TEXextensionstoKnuth'soriginalprogram( http://ctan.org/pkg/etex ),includingadditionalprogrammingfeaturesandbi-directionaltypesetting,andhasplentyofextensionsofitsown.e-TEXisavailableonitsownasthesystemcommandetex,butthisisplainTEX(andproduces.dvi).InotherTEXdistributions,latexmayinvokee-TEXratherthanpdfTEX.Inanycase,thee-TEXextensionscanbeassumedtobeavailableinLATEX.lualatexIfLATEXisinvokedviathesystemcommandlualatex,theLuaTEXengineisrun( http://ctan.org/pkg/luatex ).Thisprogramallowscodewritten Chapter2:OverviewofLATEX5 inthescriptinglanguageLua( http://luatex.org )tointeractwithTEX'stypesetting.LuaTEXhandlesUTF-8Unicodeinputnatively,canhandleOpen-TypeandTrueTypefonts,andproducesa.pdf lebydefault.Thereisalsodvilualatextoproducea.dvi le,butthisisrarelyused.xelatexIfLATEXisinvokedwiththesystemcommandxelatex,theXeTEXengineisrun( http://tug.org/xetex ).LikeLuaTEX,XeTEXnativelysupportsUTF-8UnicodeandTrueTypeandOpenTypefonts,thoughtheimplementationiscompletelydi erent,mainlyusingexternallibrariesinsteadofinternalcode.XeTEXproducesa.pdf leasoutput;itdoesnotsupportDVIoutput.Internally,XeTEXcreatesan.xdv le,avariantofDVI,andtranslatesthattoPDFusingthe(x)dvipdfmxprogram,butthisprocessisautomatic.The.xdv leisonlyusefulfordebugging.OthervariantsofLATEXandTEXexist,e.g.,toprovideadditionalsupportforJapaneseandotherlanguages([u]pTEX, http://ctan.org/pkg/ptex , http://ctan.org/pkg/uptex ).2.4LATEXcommandsyntaxIntheLATEXinput le,acommandnamestartswithabackslashcharacter,\.Thenameitselfthenconsistsofeither(a)astringoflettersor(b)asinglenon-letter.LATEXcommandsnamesarecasesensitivesothat\pagebreakdi ersfrom\Pagebreak(thelatterisnotastandardcommand).Mostcommandsarelowercase,butinanyeventyoumustenterallcommandsinthesamecaseastheyarede ned.Acommandmaybefollowedbyzero,one,ormorearguments.Theseargumentsmaybeeitherrequiredoroptional.Requiredargumentsarecontainedincurlybraces,{...}.Optionalargumentsarecontainedinsquarebrackets,[...].Generally,butnotuniversally,ifthecommandacceptsanoptionalargument,itcomes rst,beforeanyrequiredarguments.Insideofanoptionalargument,tousethecharacterclosesquarebracket(])hideitinsidecurlybraces,asin\item[closingbracket{]}].Similarly,ifanoptionalargumentcomeslast,withnorequiredargumentafterit,thentomakethe rstcharacterofthefollowingtextbeanopensquarebracket,hideitinsidecurlybraces.SomeofLATEX'scommandsareadeclaration.Suchacommandchangesthevaluethemeaningofsomeothercommandorparameter.Forinstance,the\mainmatterdeclarationchangesthetypesettingofpagenumbersfromromannumeralstoarabic(see Section6.7[\frontmatter&\mainmatter&\backmatter],page37 ).LATEXhastheconventionthatsomecommandshavea*formthatisrelatedtotheformwithouta*,suchas\chapterand\chapter*.Theexactdi erenceinbehaviorvariesfromcommandtocommand.Thismanualdescribesallacceptedoptionsand*-formsforthecommandsitcovers(barringunintentionalomissions,a.k.a.bugs).2.5EnvironmentSynopsis:\begin{environmentname} Chapter2:OverviewofLATEX6 ...\end{environmentname}AnareaofLATEXsource,insideofwhichthereisadistinctbehavior.Forinstance,forpoetryinLATEXputthelinesbetween\begin{verse}and\end{verse}.\begin{verse}ThereoncewasamanfromNantucket\\...\end{verse}See Chapter8[Environments],page44, foralistofenvironments.ParticularlynotableisthateveryLATEXdocumentmusthaveadocumentenvironment,a\begin{document}...\end{document}pair.Theenvironmentnameatthebeginningmustexactlymatchthatattheend.Thisincludesthecasewhereenvironmentnameendsinastar(*);boththe\beginand\endtextsmustincludethestar.Environmentsmayhavearguments,includingoptionalarguments.Thisexamplepro-ducesatable.The rstargumentisoptional(andcausesthetabletobealignedonitstoprow)whilethesecondargumentisrequired(itspeci estheformattingofcolumns).\begin{tabular}[t]{r|l}...rowsoftable...\end{tabular}2.6CTAN:theComprehensiveTEXArchiveNetworkTheComprehensiveTEXArchiveNetwork,CTAN,istheTEXandLATEXcommunity'srepositoryoffreematerial.ItisasetofInternetsitesaroundtheworldthato ermaterialrelatedtoLATEXfordownload.VisitCTANonthewebat https://ctan.org .Thismaterialisorganizedintopackages,discretebundlesthattypicallyo ersomeco-herentfunctionalityandaremaintainedbyonepersonorasmallnumberofpeople.Forinstance,manypublishershaveapackagethatallowsauthorstoformatpaperstothatpublisher'sspeci cations.Inadditiontothemassiveholdings,thewebsiteo ersfeaturessuchassearchbynameorbyfunctionality.CTANisnotasinglesite,butinsteadisasetofsites.Oneofthesitesisthecore.Thissiteactivelymanagesthematerial,forinstance,byacceptinguploadsofneworupdatedpackages.ItishostedbytheGermanTEXgroupDANTEe.V.Othersitesaroundtheworldhelpoutbymirroring,thatis,automaticallysyncingtheircollectionswiththecoresiteandtheninturnmakingtheircopiespubliclyavailable.Thisgivesusersclosetotheirlocationbetteraccessandrelievestheloadonthecoresite.Thelistofmirrorsisat https://ctan.org/mirrors . 7 3DocumentclassesThedocument'soverallclassisde nedwiththiscommand,whichisnormallythe rstcommandinaLATEXsource le.\documentclass[options]{class}ThefollowingdocumentclassnamesarebuiltintoLATEX.(Manyotherdocumentclassesareavailableasseparatepackages;see Chapter2[Overview],page3 .)articleForajournalarticle,apresentation,andmiscellaneousgeneraluse.bookFull-lengthbooks,includingchaptersandpossiblyincludingfrontmatter,suchasapreface,andbackmatter,suchasanappendix(see Chapter25[Front/backmatter],page202 ).letterMail,optionallyincludingmailinglabels(see Chapter26[Letters],page213 ).reportFordocumentsoflengthbetweenanarticleandabook,suchastechnicalreportsortheses,whichmaycontainseveralchapters.slidesForslidepresentations|rarelyusedtoday.Initsplacethebeamerpackageisperhapsthemostprevalent(see SectionA.1[beamertemplate],page224 ).Standardoptionsaredescribedinthenextsection.3.1DocumentclassoptionsYoucanspecifyglobaloptionsorclassoptionstothe\documentclasscommandbyen-closingtheminsquarebrackets.Tospecifymorethanoneoption,separatethemwithacomma.\documentclass[option1,option2,...]{class}Hereisthelistofthestandardclassoptions.Allofthestandardclassesexceptslidesacceptthefollowingoptionsforselectingthetypefacesize(defaultis10pt):10pt11pt12ptAllofthestandardclassesaccepttheseoptionsforselectingthepapersize(theseshowheightbywidth):a4paper210by297mm(about8.25by11.75inches)a5paper148by210mm(about5.8by8.3inches)b5paper176by250mm(about6.9by9.8inches)executivepaper7.25by10.5incheslegalpaper8.5by14inchesletterpaper8.5by11inches(thedefault) Chapter3:Documentclasses8 WhenusingoneoftheenginespdfLATEX,LuaLATEX,orXeLATEX(see Section2.3[TEXengines],page4 ),optionsotherthanletterpapersettheprintareabutyoumustalsosetthephysicalpapersize.Onewaytodothatistoput\pdfpagewidth=\paperwidthand\pdfpageheight=\paperheightinyourdocument'spreamble.Thegeometrypackageprovides exiblewaysofsettingtheprintareaandphysicalpagesize.Miscellaneousotheroptions:draftfinalMark(draft)ordonotmark(final)overfullboxeswithablackboxinthemargin;defaultisfinal.fleqnPutdisplayedformulas ushleft;defaultiscentered.landscapeSelectslandscapeformat;defaultisportrait.leqnoPutequationnumbersontheleftsideofequations;defaultistherightside.openbibUse\open"bibliographyformat.titlepagenotitlepageSpeci eswhetherthereisaseparatepageforthetitleinformationandfortheabstractalso,ifthereisone.Thedefaultforthereportclassistitlepage,fortheotherclassesitisnotitlepage.Thefollowingoptionsarenotavailablewiththeslidesclass.onecolumntwocolumnTypesetinoneortwocolumns;defaultisonecolumn.onesidetwosideSelectsone-ortwo-sidedlayout;defaultisoneside,exceptthatinthebookclassthedefaultistwoside.Forone-sidedprinting,thetextiscenteredonthepage.Fortwo-sidedprint-ing,the\evensidemargin(\oddsidemargin)parameterdeterminesthedis-tanceoneven(odd)numberedpagesbetweentheleftsideofthepageandthetext'sleftmargin,with\oddsidemarginbeing40%ofthedi erencebetween\paperwidthand\textwidth,and\evensidemarginistheremainder.openrightopenanyDeterminesifachaptershouldstartonaright-handpage;defaultisopenrightforbook,andopenanyforreport.Theslidesclasso erstheoptionclockforprintingthetimeatthebottomofeachnote.3.2AdditionalpackagesLoadapackagepkg,withthepackageoptionsgiveninthecomma-separatedlistoptions,ashere.\usepackage[options]{pkg}. Chapter3:Documentclasses9 Tospecifymorethanonepackageyoucanseparatethemwithacomma,asin\usepackage{pkg1,pkg2,...},orusemultiple\usepackagecommands.Anyoptionsgiveninthe\documentclasscommandthatareunknowntotheselecteddocumentclassarepassedontothepackagesloadedwith\usepackage.3.3ClassandpackageconstructionYoucancreatenewdocumentclassesandnewpackages.Forinstance,ifyourmemosmustsatisfysomelocalrequirements,suchasastandardheaderforeachpage,thenyoucouldcre-ateanewclasssmcmemo.clsandbeginyourdocumentswith\documentclass{smcmemo}.Whatseparatesapackagefromadocumentclassisthatthecommandsinapackageareusefulacrossclasseswhilethoseinadocumentclassarespeci ctothatclass.Thus,acommandtosetpageheadersisforapackagewhileacommandtomakethepageheaderssayMemofromtheSMCMathDepartmentisforaclass.Insideofaclassorpackage leyoucanusetheat-sign@asacharacterincommandnameswithouthavingtosurroundthecodecontainingthatcommandwith\makeatletterand\makeatother.See Section12.3[\makeatletter&\makeatother],page105 .Thisallowyoutocreatecommandsthatuserswillnotaccidentallyrede ne.Anothertechniqueistoprefaceclass-orpackage-speci ccommandswithsomestringtopreventyourclassorpackagefrominterferingwithothers.Forinstance,theclasssmcmemomighthavecommands\smc@tolist,\smc@fromlist,etc.3.3.1ClassandpackagestructureAclass leorpackage letypicallyhasfourparts.1.Intheidenti cationpart,the lesaysthatitisaLATEXpackageorclassandde-scribesitself,usingthe\NeedsTeXFormatand\ProvidesClassor\ProvidesPackagecommands.2.Thepreliminarydeclarationspartdeclaressomecommandsandcanalsoloadother les.Usuallythesecommandswillbethoseneededforthecodeusedinthenextpart.Forexample,ansmcmemoclassmightbecalledwithanoptiontoreadina lewithalistofpeoplefortheto-head,as\documentclass[mathto]{smcmemo},andthereforeneedstode neacommand\newcommand{\setto}[1]{\def\@tolist{#1}}usedinthat le.3.Inthehandleoptionsparttheclassorpackagedeclaresandprocessesitsoptions.Classoptionsallowausertostarttheirdocumentas\documentclass[optionlist]{classname},tomodifythebehavioroftheclass.Anexampleiswhenyoudeclare\documentclass[11pt]{article}tosetthedefaultdocumentfontsize.4.Finally,inthemoredeclarationsparttheclassorpackageusuallydoesmostofitswork:declaringnewvariables,commandsandfonts,andloadingother les.Hereisastartingclass le,whichshouldbesavedasstub.clswhereLATEXcan ndit,forexampleinthesamedirectoryasthe.tex le.\NeedsTeXFormat{LaTeX2e}\ProvidesClass{stub}[2017/07/06stubtostartbuildingclassesfrom]\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}\ProcessOptions\relax\LoadClass{article} Chapter3:Documentclasses10 Itidenti esitself,handlestheclassoptionsviathedefaultofpassingthemalltothearticleclass,andthenloadsthearticleclasstoprovidethebasisforthisclass'scode.Formore,seetheocialguideforclassandpackagewriters,theClassGuide,at http://www.latex-project.org/help/documentation/clsguide.pdf (muchofthedescriptionsherederivefromthisdocument),orthetutorial https://www.tug.org/TUGboat/tb26-3/tb84heff.pdf .3.3.2ClassandpackagecommandsThesearethecommandsdesignedtohelpwritersofclassesorpackages.\AtBeginDvi{specials}Saveinaboxregisterthingsthatarewrittentothe.dvi leatthebeginningoftheshipoutofthe rstpageofthedocument.\AtEndOfClass{code}\AtEndOfPackage{code}HooktoinsertcodetobeexecutedwhenLATEX nishesprocessingthecurrentclassorpackage.Youcanusethesehooksmultipletimes;thecodewillbeexecutedintheorderthatyoucalledit.Seealso Section8.6.1[\AtBeginDoc-ument],page49 .\CheckCommand{cmd}[num][default]{definition}\CheckCommand*{cmd}[num][default]{definition}Like\newcommand(see Section12.1[\newcommand&\renewcommand],page103 )butdoesnotde necmd;insteaditchecksthatthecurrentde nitionofcmdisexactlyasgivenbyde nitionandisorisnotlongasexpected.Alongcommandisacommandthataccepts\parwithinanargument.Thecmdcommandisexpectedtobelongwiththeunstarredversionof\CheckCommand.Raisesanerrorwhenthecheckfails.Thisallowsyoutocheckbeforeyoustartrede ningcmdyourselfthatnootherpackagehasalreadyrede nedthiscommand.\ClassError{classname}{errortext}{helptext}\PackageError{packagename}{errortext}{helptext}\ClassWarning{classname}{warningtext}\PackageWarning{packagename}{warningtext}\ClassWarningNoLine{classname}{warningtext}\PackageWarningNoLine{packagename}{warningtext}\ClassInfo{classname}{infotext}\PackageInfo{packagename}{infotext}\ClassInfoNoLine{classname}{infotext}\PackageInfoNoLine{packagename}{infotext}Produceanerrormessage,orwarningorinformationalmessages.For\ClassErrorand\PackageErrorthemessageiserrortext,followedbyTEX's?errorprompt.Iftheuserthenasksforhelpbytypingh,theyseethehelptext.Thefourwarningcommandsaresimilarexceptthattheywritewarningtextonthescreenwithnoerrorprompt.Thefourinfocommandswriteinfotext Chapter3:Documentclasses11 onlyinthetranscript le.TheNoLineversionsdonotshowthenumberofthelinegeneratingthemessage,whiletheotherversionsdoshowthatnumber.Toformatthemessages,includingthehelptext:use\protecttostopacom-mandfromexpanding,getalinebreakwith\MessageBreak,andgetaspacewith\spacewhenaspacecharacterdoesnotallowit,likeafteracommand.NotethatLATEXappendsaperiodtothemessages.\CurrentOptionExpandstothenameofthecurrently-being-processedoption.Canonlybeusedwithinthecodeargumentofeither\DeclareOptionor\DeclareOption*.\DeclareOption{option}{code}\DeclareOption*{code}Makeanoptionavailabletoausertoinvokeintheir\documentclasscommand.Forexample,thesmcmemoclasscouldhaveanoption\documentclass[logo]{smcmemo}allowinguserstoputtheinstitutionallogoonthe rstpage.Theclass lemustcontain\DeclareOption{logo}{code}(andlater,\ProcessOptions).Ifyourequestanoptionthathasnotbeendeclared,bydefaultthiswillproduceawarninglikeUnusedglobaloption(s):[badoption].Changethisbehaviourwiththestarredversion\DeclareOption*{code}.Forexample,manyclassesextendanexistingclass,usingadeclarationsuchas\LoadClass{article},andforpassingextraoptionstotheunderlyingclassusecodesuchasthis.\DeclareOption*{%\PassOptionsToClass{\CurrentOption}{article}%}Anotherexampleisthattheclasssmcmemomayallowuserstokeeplistsofmemorecipientsinexternal les.Thentheusercouldinvoke\documentclass[math]{smcmemo}anditwillreadthe lemath.memo.Thiscodehandlesthe leifitexistsandotherwisepassestheoptiontothearticleclass.\DeclareOption*{\InputIfFileExists{\CurrentOption.memo}{}{%\PassOptionsToClass{\CurrentOption}{article}}}\DeclareRobustCommand{cmd}[num][default]{definition}\DeclareRobustCommand*{cmd}[num][default]{definition}Like\newcommandand\newcommand*(see Section12.1[\newcommand&\re-newcommand],page103 )butthesedeclarearobustcommand,evenifsomecodewithinthede nitionisfragile.(Foradiscussionofrobustandfragilecommandssee Section12.11[\protect],page113 .)Usethiscommandtode- nenewrobustcommandsortorede neexistingcommandsandmakethemrobust.Unlike\newcommandthesedonotgiveanerrorifmacrocmdalreadyexists;instead,alogmessageisputintothetranscript leifacommandisrede ned.Commandsde nedthiswayareabitlessecientthanthosede nedusing\newcommandsounlessthecommand'sdataisfragileandthecommandisusedwithinamovingargument,use\newcommand. Chapter3:Documentclasses12 Theetoolboxpackageo ersthecommands\newrobustcmd,\newrobustcmd*,aswellasthecommands\renewrobustcmd,\renewrobustcmd*,andthecommands\providerobustcmd,and\providerobustcmd*.Thesearesimilarto\newcommand,\newcommand*,\renewcommand,\renewcommand*,\providecommand,and\providecommand*,butde nearobustcmdwithtwoadvantagesascomparedto\DeclareRobustCommand:1.Theyusethelow-levele-TEXprotectionmechanismratherthanthehigherlevelLATEX\protectmechanism,sotheydonotincurtheslightlossofperformancementionedabove,and2.Theymakethesamedistinctionbetween\new...,\renew...,and\provide...,asthestandardcommands,sotheydonotjustmakealogmessagewhenyourede necmdthatalreadyexists,inthatcaseyouneedtouseeither\renew...or\provide...oryougetanerror.\IfFileExists{filename}{truecode}{falsecode}\InputIfFileExists{filename}{truecode}{falsecode}ExecutetruecodeifLATEX ndsthe lefilenameorfalsecodeotherwise.Inthe rstcaseitexecutingtruecodeandtheninputsthe le.Thusthecommand\IfFileExists{img.pdf}{%\includegraphics{img.pdf}}{\typeout{!!img.pdfnotfound}willincludethegraphicimg.pdfifitisfoundandotherwisegiveawarning.Thiscommandlooksforthe leinallsearchpathsthatLATEXuses,notonlyinthecurrentdirectory.Tolookonlyinthecurrentdirectorydosomethinglike\IfFileExists{./filename}{truecode}{falsecode}.Ifyouaskfora lenamewithouta.texextensionthenLATEXwill rstlookforthe lebyap-pendingthe.tex;formoreonhowLATEXhandles leextensionssee Section24.3[\input],page201 .\LoadClass[optionslist]{classname}[releasedate]\LoadClassWithOptions{classname}[releasedate]Loadaclass,aswith\documentclass[optionslist]{classname}[releaseinfo].Anexampleis\LoadClass[twoside]{article}.Theoptionslist,ifpresent,isacomma-separatedlist.Thereleasedateisoptional.IfpresentitmusthavetheformYYYY/MM/DD.Ifyourequestareleasedateandthedateofthepackageinstalledonyoursystemisearlier,thenyougetawarningonthescreenandintheloglikethis.Youhaverequested,oninputline4,version`2038/01/19'ofdocumentclassarticle,butonlyversion`2014/09/29v1.4hStandardLaTeXdocumentclass'isavailable.Thecommandversion\LoadClassWithOptionsusesthelistofoptionsforthecurrentclass.Thismeansitignoresanyoptionspassedtoitvia\PassOptionsToClass.Thisisaconveniencecommandthatletsyoubuildclassesonexistingones,suchasthestandardarticleclass,withouthavingtotrackwhichoptionswerepassed. Chapter3:Documentclasses13 \ExecuteOptions{options-list}Foreachoptionoptionintheoptions-list,inorder,thiscommandexecutesthecommand\ds@option.Ifthiscommandisnotde nedthenthatoptionissilentlyignored.Itcanbeusedtoprovideadefaultoptionlistbefore\ProcessOptions.Forexample,ifinaclass leyouwantthedefaulttobe11ptfontsthenyoucouldspecify\ExecuteOptions{11pt}\ProcessOptions\relax.\NeedsTeXFormat{format}[formatdate]Speci estheformatthatthisclassmustberununder.Oftenissuedasthe rstlineofaclass le,andmostoftenusedas:\NeedsTeXFormat{LaTeX2e}.Whenadocumentusingthatclassisprocessed,theformatnamegivenheremustmatchtheformatthatisactuallybeingrun(includingthattheformatstringiscasesensitive).Ifitdoesnotmatchthenexecutionstopswithanerrorlike`Thisfileneedsformat`LaTeX2e'butthisis`xxx'.'Tospecifyaversionoftheformatthatyouknowtohavecertainfeatures,includetheoptionalformatdateonwhichthosefeatureswereimplemented.IfpresentitmustbeintheformYYYY/MM/DD.Iftheformatversioninstalledonyoursystemisearlierthanformatdatethenyougetawarninglikethis.Youhaverequestedrelease`2038/01/20'ofLaTeX,butonlyrelease`2016/02/01'isavailable.\OptionNotUsedAddsthecurrentoptiontothelistofunusedoptions.Canonlybeusedwithinthecodeargumentofeither\DeclareOptionor\DeclareOption*.\PassOptionsToClass{optionlist}{classname}\PassOptionsToPackage{optionlist}{packagename}Addstheoptionsinthecomma-separatedlistoptionlisttotheoptionsusedbyanyfuture\RequirePackageor\usepackagecommandforpackagepackagenameortheclassclassname.Thereasonforthesecommandsis:youmayloadapackageanynumberoftimeswithnooptionsbutifyouwantoptionsthenyoumayonlysupplythemwhenyou rstloadthepackage.LoadingapackagewithoptionsmorethanoncewillgetyouanerrorlikeOptionclashforpackagefoo.(LATEXthrowsanerrorevenifthereisnocon ictbetweentheoptions.)Ifyourowncodeisbringinginapackagetwicethenyoucancollapsethattoonce,forexamplereplacingthetwo\RequirePackage[landscape]{geometry}and\RequirePackage[margins=1in]{geometry}withthesinglecommand\RequirePackage[landscape,margins=1in]{geometry}.However,imaginethatyouareloadingfirstpkgandinsidethatpackageitloadssecondpkg,andyouneedthesecondpackagetobeloadedwithoptiondraft.Thenbeforedoingthe rstpackageyoumustqueueuptheoptionsforthesecondpackage,likethis.\PassOptionsToPackage{draft}{secondpkg}\RequirePackage{firstpkg} Chapter3:Documentclasses14 (Iffirstpkg.styloadsanoptionincon ictwithwhatyouwantthenyoumayhavetoalteritssource.)Thesecommandsareusefulforgeneralusersaswellasclassandpackagewrit-ers.Forinstance,supposeauserwantstoloadthegraphicxpackagewiththeoptiondraftandalsowantstouseaclassfoothatloadsthegraphicxpackage,butwithoutthatoption.TheusercouldstarttheirLATEX lewith\PassOptionsToPackage{draft}{graphicx}\documentclass{foo}.\ProcessOptions\ProcessOptions*\@optionsExecutethecodeforeachoptionthattheuserhasinvoked.Includeitintheclass leas\ProcessOptions\relax(becauseoftheexistenceofthestarredcommand).Optionscomeintwotypes.Localoptionshavebeenspeci edforthispartic-ularpackageintheoptionsargumentof\PassOptionsToPackage{options},\usepackage[options],or\RequirePackage[options].Globaloptionsarethosegivenbytheclassuserin\documentclass[options](Ifanoptionisspeci edbothlocallyandgloballythenitislocal.)When\ProcessOptionsiscalledforapackagepkg.sty,thefollowinghappens:1.Foreachoptionoptionsofardeclaredwith\DeclareOption,itlookstoseeifthatoptioniseitheraglobaloralocaloptionforpkg.Ifsothenitexecutesthedeclaredcode.Thisisdoneintheorderinwhichtheseoptionsweregiveninpkg.sty.2.Foreachremaininglocaloption,itexecutesthecommand\ds@optionifithasbeende nedsomewhere(otherthanbya\DeclareOption);otherwise,itexecutesthedefaultoptioncodegivenin\DeclareOption*.Ifnodefaultoptioncodehasbeendeclaredthenitgivesanerrormessage.Thisisdoneintheorderinwhichtheseoptionswerespeci ed.When\ProcessOptionsiscalledforaclassitworksinthesamewayex-ceptthatalloptionsarelocal,andthedefaultcodefor\DeclareOption*is\OptionNotUsedratherthananerror.Thestarredversion\ProcessOptions*executestheoptionsintheorderspeci- edinthecallingcommands,ratherthanintheorderofdeclarationintheclassorpackage.Forapackagethismeansthattheglobaloptionsareprocessed rst.\ProvidesClass{classname}[releasedatebriefadditionalinformation]\ProvidesClass{classname}[releasedate]\ProvidesPackage{packagename}[releasedatebriefadditionalinformation]\ProvidesPackage{packagename}[releasedate]Identi estheclassorpackage,printingamessagetothescreenandthelog le.Whenyouloadaclassorpackage,forexamplewith\documentclass{smcmemo}or\usepackage{test},LATEXinputsa le.Ifthenameofthe ledoesnotmatchtheclassorpackagenamedeclaredinitthenyougetawarning.Thus,ifyouinvoke\documentclass{smcmemo},andthe lesmcmemo.clshasthestate-ment\ProvidesClass{xxx}thenyougetawarninglikeYouhaverequesteddocumentclass`smcmemo',butthedocumentclassprovides'xxx'.This Chapter3:Documentclasses15 warningdoesnotpreventLATEXfromprocessingtherestoftheclass lenor-mally.Ifyouincludetheoptionalargumentthenyoumustincludeadate,beforeanyspaces,oftheformYYYY/MM/DD.Therestoftheoptionalargumentisfree-form,althoughittraditionallyidenti estheclass,andiswrittentothescreenduringcompilationandtothelog le.Thus,ifyour lesmcmemo.clscontainstheline\ProvidesClass{smcmemo}[2008/06/01v1.0SMCmemoclass]andyourdocument's rstlineis\documentclass{smcmemo}thenyouwillseeDocumentClass:smcmemo2008/06/01v1.0SMCmemoclass.Thedateintheoptionalargumentallowsclassandpackageuserstoasktobewarnediftheversionoftheclassorpackageisearlierthanreleasedate.Forinstance,ausercouldenter\documentclass{smcmemo}[2018/10/12]or\usepackage{foo}[[2017/07/07]]torequireaclassorpackagewithcertainfeaturesbyspecifyingthatitmustbereleasednoearlierthanthegivendate.(Although,inpracticepackageusersonlyrarelyincludeadate,andclassusersalmostneverdo.)\ProvidesFile{filename}[additionalinformation]Declarea leotherthanthemainclassandpackage les,suchascon guration lesorfontde nition les.Putthiscommandinthat leandyougetinthelogastringlikeFile:test.config2017/10/12configfilefortest.clsfor lenameequalto`test.config'andadditionalinformationequalto`2017/10/12configfilefortest.cls'.\RequirePackage[optionlist]{packagename}[releasedate]\RequirePackageWithOptions{packagename}[releasedate]Loadapackage,likethecommand\usepackage(see Section3.2[Additionalpackages],page8 ).TheLATEXdevelopmentteamstronglyrecommendsuseofthesecommandsoverPlainTEX's\input;seetheClassGuide.Anexampleis\RequirePackage[landscape,margin=1in]{geometry}.Theoptionlist,ifpresent,isacomma-separatedlist.Thereleasedate,ifpresent,musthavetheformYYYY/MM/DD.Ifthereleasedateofthepack-ageasinstalledonyoursystemisearlierthanreleasedatethenyougetawarninglikeYouhaverequested,oninputline9,version`2017/07/03'ofpackagejhtest,butonlyversion`2000/01/01'isavailable.The\RequirePackageWithOptionsversionusesthelistofoptionsforthecurrentclass.Thismeansitignoresanyoptionspassedtoitvia\PassOptionsToClass.Thisisaconveniencecommandtoalloweasilybuildingclassesonexistingoneswithouthavingtotrackwhichoptionswerepassed.Thedi erencebetween\usepackageand\RequirePackageissmall.The\usepackagecommandisintendedforthedocument lewhile\RequirePackageisintendedforpackageandclass les.Thus,using\usepackagebeforethe\documentclasscommandcausesLATEXtogiveerrorlike\usepackagebefore\documentclass,butyoucanuse\RequirePackagethere. 16 4FontsTwoimportantaspectsofselectingafontarespecifyingasizeandastyle.TheLATEXcommandsfordoingthisaredescribedhere.4.1FontstylesThefollowingtypestylecommandsaresupportedbyLATEX.Inthetablebelowthelistedcommands,the\text...commands,isusedwithanargu-ment,asin\textit{text}.Thisisthepreferredform.Butshownafterit,inparenthesis,isthecorrespondingdeclarationform,whichissometimesuseful.Thisformtakesnoargu-ments,asin{\itshapetext}.Thescopeofthedeclarationformlastsuntilthenexttypestylecommandortheendofthecurrentgroup.Inaddition,eachhasanenvironmentformsuchas\begin{itshape}...\end{itshape}.Thesecommands,inboththeargumentformandthedeclarationform,arecumula-tive;forinstanceyoucangetboldsansserifbysayingeitherof\sffamily\bfseriesor\bfseries\sffamily.Oneadvantageofthesecommandsisthattheyautomaticallyinsertitaliccorrectionsifneeded(see Section19.9[\/],page163 ).Speci cally,theyinserttheitaliccorrectionunlessthefollowingcharacterisinthelist\nocorrlist,whichbydefaultconsistsofaperiodandacomma.Tosuppresstheautomaticinsertionofitaliccorrection,use\nocorratthestartorendofthecommandargument,suchas\textit{\nocorrtext}or\textsc{text\nocorr}.\textrm(\rmfamily)Roman.\textit(\itshape)Italics.\textmd(\mdseries)Mediumweight(default).\textbf(\bfseries)Boldface.\textup(\upshape)Upright(default).\textsl(\slshape)Slanted.\textsf(\sffamily)Sansserif.\textsc(\scshape)Smallcaps.\texttt(\ttfamily)Typewriter.\textnormal(\normalfont)Maindocumentfont. Chapter4:Fonts17 Althoughitalsochangesfonts,the\emph{text}commandissemantic,fortexttobeemphasized,andshouldnotbeusedasasubstitutefor\textit.Forexample,\emph{starttext\emph{middletext}endtext}willresultinthestarttextandendtextinitalics,butmiddletextwillbeinroman.LATEXalsoprovidesthefollowingcommands,whichunconditionallyswitchtothegivenstyle,thatis,arenotcumulative.Theyareusedasdeclarations:{\cmd...}insteadof\cmd{...}.(Theunconditionalcommandsbelowareanolderversionoffontswitching.Theearliercommandsareanimprovementinmostcircumstances.Butsometimesanunconditionalfontswitchispreciselywhatyouwant.)\bfSwitchtoboldface.\calSwitchtocalligraphiclettersformath.\itItalics.\rmRoman.\scSmallcaps.\sfSansserif.\slSlanted(oblique).\ttTypewriter(monospace, xed-width).The\emcommandistheunconditionalversionof\emph.Thefollowingcommandsareforuseinmathmode.Theyarenotcumulative,so\mathbf{\mathit{symbol}}doesnotcreateaboldfaceanditalicsymbol;instead,itwilljustbeinitalics.Thisisbecausetypicallymathsymbolsneedconsistenttypographictreatment,regardlessofthesurroundingenvironment.\mathrmRoman,foruseinmathmode.\mathbfBoldface,foruseinmathmode.\mathsfSansserif,foruseinmathmode.\mathttTypewriter,foruseinmathmode.\mathit(\mit)Italics,foruseinmathmode.\mathnormalForuseinmathmode,e.g.,insideanothertypestyledeclaration.\mathcalCalligraphicletters,foruseinmathmode.Inaddition,thecommand\mathversion{bold}canbeusedforswitchingtoboldlettersandsymbolsinformulas.\mathversion{normal}restoresthedefault.Finally,thecommand\oldstylenums{numerals}willtypesetso-called\old-style"nu-merals,whichhavedi eringheightsanddepths(andsometimeswidths)fromthestandard\lining"numerals,whichallhavethesameheightasuppercaseletters.LATEX'sdefaultfontssupportthis,andwillrespect\textbf(butnototherstyles;therearenoitalicold-stylenumeralsinComputerModern).Manyotherfontshaveold-stylenumeralsalso;sometimesthetextcomppackagemustbeloaded,andsometimespackageoptionsareprovidedtomakethemthedefault.FAQentry: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=osf . Chapter4:Fonts18 4.2FontsizesThefollowingstandardtypesizecommandsaresupportedbyLATEX.Thetableshowsthecommandnameandthecorrespondingactualfontsizeused(inpoints)withthe`10pt',`11pt',and`12pt'documentsizeoptions,respectively(see Section3.1[Documentclassoptions],page7 ).Command10pt11pt12pt\tiny566\scriptsize788\footnotesize8910\small91010.95\normalsize(default)1010.9512\large121214.4\Large14.414.417.28\LARGE17.2817.2820.74\huge20.7420.7424.88\Huge24.8824.8824.88Thecommandsarelistedhereindeclarationforms.Youusethembydeclaringthem,aswiththisexample.\begin{quotation}\smallTheTaothatcanbenamedisnottheeternalTao.\end{quotation}Thescopeofthe\smalllastsuntiltheendofthequotationenvironment.Itwouldalsoendatthenexttypestylecommandortheendofthecurrentgroup,soyoucouldencloseitinextracurlybraces{\smallWearehere,wearehere,wearehere!}.Youcaninsteadusetheenvironmentformofthesecommands;forinstance,\begin{tiny}...\end{tiny}.4.3Low-levelfontcommandsThesecommandsareprimarilyintendedforwritersofmacrosandpackages.Thecommandslistedhereareonlyasubsetoftheavailableones.\fontencoding{encoding}Selectthefontencoding,theencodingoftheoutputfont.Therearealargenum-berofvalidencodings.ThemostcommonareOT1,Knuth'soriginalencodingforComputerModern(thedefault),andT1,alsoknownastheCorkencoding,whichhassupportfortheaccentedcharactersusedbythemostwidespreadEuropeanlanguages(German,French,Italian,Polishandothers),whichallowsTEXtohyphenatewordscontainingaccentedletters.Formore,see https://ctan.org/pkg/encguide .\fontfamily{family}Selectthefontfamily.Thewebpage http://www.tug.dk/FontCatalogue/ providesonewaytobrowsethroughmanyofthefontseasilyusedwithLATEX.Hereareexamplesofsomecommonfamilies.pagAvantGardefvsBitstreamVeraSans Chapter4:Fonts19 pbkBookmanbchCharterccrComputerConcretecmrComputerModerncmssComputerModernSansSerifcmttComputerModernTypewriterpcrCourierphvHelveticafi4InconsolatalmrLatinModernlmssLatinModernSanslmttLatinModernTypewriterpncNewCenturySchoolbookpplPalatinoptmTimesunclUncialputUtopiapzcZapfChancery\fontseries{series}Selectthefontseries.Aseriescombinesaweightandawidth.Typically,afontsupportsonlyafewofthepossiblecombinations.Somecommoncombinedseriesvaluesinclude:mMedium(normal)bBoldcCondensedbcBoldcondensedbxBoldextendedThepossiblevaluesforweight,individually,are:ulUltralightelExtralightlLightslSemilightmMedium(normal)sbSemiboldbBoldebExtraboldubUltraboldThepossiblevaluesforwidth,individually,are(themeaningandrelationshipofthesetermsvarieswithindividualtypefaces):ucUltracondensedecExtracondensedcCondensedscSemicondensedmMediumsxSemiexpanded Chapter4:Fonts20 xExpandedexExtraexpandeduxUltraexpandedWhenformingtheseriesstringfromtheweightandwidth,dropthemthatstandsformediumweightormediumwidth,unlessbothweightandwidtharem,inwhichcaseusejustone(`m').\fontshape{shape}Selectfontshape.Validshapesare:nUpright(normal)itItalicslSlanted(oblique)scSmallcapsuiUprightitalicsolOutlineThetwolastshapesarenotavailableformostfontfamilies,andsmallcapsareoftenmissingaswell.\fontsize{size}{skip}Setthefontsizeandthelinespacing.Theunitofbothparametersdefaultstopoints(pt).Thelinespacingisthenominalverticalspacebetweenlines,baselinetobaseline.Itisstoredintheparameter\baselineskip.Thedefault\baselineskipfortheComputerModerntypefaceis1.2timesthe\fontsize.Changing\baselineskipdirectlyisinadvisablesinceitsvalueisreseteverytimeasizechangehappens;see\baselinestretch,next.\baselinestretchLATEXmultipliesthelinespacingbythevalueofthe\baselinestretchparam-eter;thedefaultfactoris1.Achangetakese ectwhen\selectfont(seebe-low)iscalled.Youcanmakealineskipchangehappenfortheentiredocument,forinstancedoublingit,bydoing\renewcommand{\baselinestretch}{2.0}inthepreamble.However,thebestwaytodouble-spaceadocumentistousethesetspacepackage.Inadditiontoo eringanumberofspacingoptions,thispackagekeepsthelinespacingsingle-spacedinplaceswherethatistypicallydesirable,suchasfootnotesand gurecaptions.Seethepackagedocumentation.\linespread{factor}Equivalentto\renewcommand{\baselinestretch}{factor},andthereforemustbefollowedby\selectfonttohaveanye ect.Bestspeci edinthepreamble,orusethesetspacepackage,asjustdescribed.\selectfontThee ectsofthefontcommandsdescribedabovedonothappenuntil\selectfontiscalled,asin\fontfamily{familyname}\selectfont.Itisoftenusefultoputthisinamacro:\newcommand*{\myfont}{\fontfamily{familyname}\selectfont}(see Section12.1[\newcommand&\renewcommand],page103 ). 21 \usefont{enc}{family}{series}{shape}Thesameasinvoking\fontencoding,\fontfamily,\fontseriesand\fontshapewiththegivenparameters,followedby\selectfont.Forexample:\usefont{ot1}{cmr}{m}{n} 22 5LayoutCommandsforcontrollingthegeneralpagelayout.5.1\onecolumnSynopsis:\onecolumnStartanewpageandproducesingle-columnoutput.Ifthedocumentisgiventheclassoptiononecolumnthenthisisthedefaultbehavior(see Section3.1[Documentclassoptions],page7 ).Thiscommandisfragile(see Section12.11[\protect],page113 ).5.2\twocolumnSynopses:\twocolumn\twocolumn[prelimonecolumntext]Startanewpageandproducetwo-columnoutput.Ifthedocumentisgiventheclassoptiontwocolumnthenthisisthedefault(see Section3.1[Documentclassoptions],page7 ).Thiscommandisfragile(see Section12.11[\protect],page113 ).Iftheoptionalprelimonecolumntextargumentispresent,itistypesetinone-columnmodebeforethetwo-columntypesettingstarts.Theseparameterscontroltypesettingintwo-columnoutput:\columnsepThedistancebetweencolumns.Thedefaultis35pt.Changeitwithacommandsuchas\setlength{\columnsep}{40pt}Youmustchangeitbeforethetwocolumnenvironmentstarts;inthepreambleisagoodplace.\columnsepruleThewidthoftherulebetweencolumns.Theruleappearshalfwaybetweenthetwocolumns.Thedefaultis0pt,meaningthatthereisnorule.Changeitwithacommandsuchas\setlength{\columnseprule}{0.4pt},beforethetwo-columnenvironmentstarts.\columnwidthThewidthofasinglecolumn.Inone-columnmodethisisequalto\textwidth.Intwo-columnmodebydefaultLATEXsetsthewidthofeachofthetwocolumnstobehalfof\textwidthminus\columnsep.Inatwo-columndocument,thestarredenvironmentstable*andfigure*aretwocolumnswide,whereastheunstarredenvironmentstableandfiguretakeuponlyonecolumn(see Section8.10[ gure],page52, andsee Section8.22[table],page76 ).LATEXplacesstarred oatsatthetopofapage.Thefollowingparameterscontrol oatbehavioroftwo-columnoutput.\dbltopfractionThemaximumfractionatthetopofatwo-columnpagethatmaybeoccupiedbytwo-columnwide oats.Thedefaultis0.7,meaningthattheheightofa Chapter5:Layout23 table*orfigure*environmentmustnotexceed0.7\textheight.Iftheheightofyourstarred oatenvironmentexceedsthisthenyoucantakeoneofthefollowingactionstopreventitfrom oatingallthewaytothebackofthedocument:Usethe[tp]locationspeci ertotellLaTeXtotrytoputthebulky oatonapagebyitself,aswellasatthetopofapage.Usethe[t!]locationspeci ertooverridethee ectof\dbltopfractionforthisparticular oat.Increasethevalueof\dbltopfractiontoasuitablylargenumber,toavoidgoingto oatpagessosoon.Youcanrede neit,aswith\renewcommand{\dbltopfraction}{0.9}.\dblfloatpagefractionFora oatpageoftwo-columnwide oats,thisistheminimumfractionthatmustbeoccupiedby oats,limitingtheamountofblankspace.LATEX'sdefaultis0.5.Changeitwith\renewcommand.\dblfloatsepOna oatpageoftwo-columnwide oats,thislengthisthedistancebetween oats,atboththetopandbottomofthepage.Thedefaultis12ptplus2ptminus2ptforadocumentsetat10ptor11pt,and14ptplus2ptminus4ptforadocumentsetat12pt.\dbltextfloatsepThislengthisthedistancebetweenamulti-column oatatthetoporbottomofapageandthemaintext.Thedefaultis20ptplus2ptminus4pt.\dbltopnumberOna oatpageoftwo-columnwide oats,thiscountergivesthemaximumnumberof oatsallowedatthetopofthepage.TheLATEXdefaultis2.Thisexampleuses\twocolumn'soptionalargumentoftocreateatitlethatspansthetwo-columnarticle:\documentclass[twocolumn]{article}\newcommand{\authormark}[1]{\textsuperscript{#1}}\begin{document}\twocolumn[{%insidethisoptionalargumentgoesone-columntext\centering\LARGETheTitle\\[1.5em]\largeAuthorOne\authormark{1},AuthorTwo\authormark{2},AuthorThree\authormark{1}\\[1em]\normalsize\begin{tabular}{p{.2\textwidth}@{\hspace{2em}}p{.2\textwidth}}\authormark{1}Departmentone&\authormark{2}Departmenttwo\\Schoolone&Schooltwo\end{tabular}\\[3em]%spacebelowtitlepart}] Chapter5:Layout24 Twocolumntexthere.5.3\flushbottomMakeallpagesinthedocumentsafterthisdeclarationhavethesameheight,bystretchingtheverticalspacewherenecessaryto lloutthepage.Thisismostoftenusedwhenmakingtwo-sideddocumentssincethedi erencesinfacingpagescanbeglaring.IfTEXcannotsatisfactorilystretchtheverticalspaceinapagethenyougetamessagelike`Underfull\vbox(badness10000)hasoccurredwhile\outputisactive'.Ifyougetthat,oneoptionistochangeto\raggedbottom(see Section5.4[\raggedbottom],page24 ).Alternatively,youcanadjustthetextheighttomakecompatiblepages,oryoucanaddsomeverticalstretchgluebetweenlinesorbetweenparagraphs,asin\setlength{\parskip}{0explus0.1ex}.Yourlastoptionisto,ina naleditingstage,adjusttheheightofindividualpages(see Section10.3[\enlargethispage],page96 ).The\flushbottomstateisthedefaultonlyifyouselectthetwosidedocumentclassoption(see Section3.1[Documentclassoptions],page7 ).5.4\raggedbottomMakealllaterpagesthenaturalheightofthematerialonthatpage;norubberverticallengthswillbestretched.Thus,inatwo-sideddocumentthefacingpagesmaybedi er-entheights.Thiscommandcangoatanypointinthedocumentbody.See Section5.3[\ ushbottom],page24 .Thisisthedefaultunlessyouselectthetwosidedocumentclassoption(see Section3.1[Documentclassoptions],page7 ).5.5Pagelayoutparameters\columnsep\columnseprule\columnwidthThedistancebetweenthetwocolumns,thewidthofarulebetweenthecolumns,andthewidthofthecolumns,whenthedocumentclassoptiontwocolumnisine ect(see Section3.1[Documentclassoptions],page7 ).See Section5.2[\twocolumn],page22 .\headheightHeightoftheboxthatcontainstherunninghead.Thedefaultinthearticle,report,andbookclassesis`12pt',atalltypesizes.\headsepVerticaldistancebetweenthebottomoftheheaderlineandthetopofthemaintext.Thedefaultinthearticleandreportclassesis`25pt'.Inthebookclassthedefaultis:ifthedocumentissetat10ptthenitis`0.25in',andat11ptand12ptitis`0.275in'.\footskipDistancefromthebaselineofthelastlineoftexttothebaselineofthepagefooter.Thedefaultinthearticleandreportclassesis`30pt'.Inthebook Chapter5:Layout25 classthedefaultis:whenthetypesizeis10ptthedefaultis`0.35in',whileat11ptitis`0.38in',andat12ptitis`30pt'.\linewidthWidthofthecurrentline,decreasedforeachnestedlist(see Section8.16[list],page57 ).Thatis,thenominalvaluefor\linewidthistoequal\textwidthbutforeachnestedlistthe\linewidthisdecreasedbythesumofthatlist's\leftmarginand\rightmargin(see Section8.14[itemize],page55 ).\marginparpush\marginsep\marginparwidthTheminimumverticalspacebetweentwomarginalnotes,thehorizontalspacebetweenthetextbodyandthemarginalnotes,andthehorizontalwidthofthenotes.Normallymarginalnotesappearontheoutsideofthepage,butthedeclaration\reversemarginparchangesthat(and\normalmarginparchangesitback).Thedefaultsfor\marginparpushinbothbookandarticleclassesare:`7pt'ifthedocumentissetat12pt,and`5pt'ifthedocumentissetat11ptor10pt.For\marginsep,inarticleclassthedefaultis`10pt'exceptifthedocumentissetat10ptandintwo-columnmodewherethedefaultis`11pt'.For\marginsepinbookclassthedefaultis`10pt'intwo-columnmodeand`7pt'inone-columnmode.For\marginparwidthinbothbookandarticleclasses,intwo-columnmodethedefaultis60%of\paperwidth�\textwidth,whileinone-columnmodeitis50%ofthatdistance.\oddsidemargin\evensidemarginThe\oddsidemarginistheextradistancebetweentheleftsideofthepageandthetext'sleftmargin,onodd-numberedpageswhenthedocumentclassoptiontwosideischosenandonallpageswhenonesideisine ect.Whentwosideisine ect,oneven-numberedpagestheextradistanceontheleftisevensidemargin.LATEX'sdefaultisthat\oddsidemarginis40%ofthedi erencebetween\paperwidthand\textwidth,and\evensidemarginistheremainder.\paperheightTheheightofthepaper,asdistinctfromtheheightoftheprintarea.Normallysetwithadocumentclassoption,asin\documentclass[a4paper]{article}(see Section3.1[Documentclassoptions],page7 ).\paperwidthThewidthofthepaper,asdistinctfromthewidthoftheprintarea.Normallysetwithadocumentclassoption,asin\documentclass[a4paper]{article}(see Section3.1[Documentclassoptions],page7 ).\textheightThenormalverticalheightofthepagebody.Ifthedocumentissetatanominaltypesizeof10ptthenforanarticleorreportthedefaultis Chapter5:Layout26 `43\baselineskip',whileforabookitis`41\baselineskip'.Atatypesizeof11ptthedefaultis`38\baselineskip'foralldocumentclasses.At12ptitis`36\baselineskip'forallclasses.\textwidthThefullhorizontalwidthoftheentirepagebody.Foranarticleorreportdocument,thedefaultis`345pt'whenthechosentypesizeis10pt,thedefaultis`360pt'at11pt,anditis`390pt'at12pt.Forabookdocument,thedefaultis`4.5in'atatypesizeof10pt,and`5in'at11ptor12pt.Inmulti-columnoutput,\textwidthremainsthewidthoftheentirepagebody,while\columnwidthisthewidthofonecolumn(see Section5.2[\twocolumn],page22 ).Inlists(see Section8.16[list],page57 ),\textwidthremainsthewidthoftheentirepagebody(and\columnwidththewidthoftheentirecolumn),while\linewidthmaydecreasefornestedlists.Insideaminipage(see Section8.18[minipage],page63 )or\parbox(see Section20.3[\parbox],page171 ),allthewidth-relatedparametersaresettothespeci edwidth,andreverttotheirnormalvaluesattheendoftheminipageor\parbox.\hsizeThisentryisincludedforcompleteness:\hsizeistheTEXprimitiveparameterusedwhentextisbrokenintolines.ItshouldnotbeusedinnormalLATEXdocuments.\topmarginSpacebetweenthetopoftheTEXpage(oneinchfromthetopofthepa-per,bydefault)andthetopoftheheader.Thevalueiscomputedbasedonmanyotherparameters:\paperheight�2in�\headheight�\headsep�\textheight�\footskip,andthendividedbytwo.\topskipMinimumdistancebetweenthetopofthepagebodyandthebaselineofthe rstlineoftext.Forthestandardclasses,thedefaultisthesameasthefontsize,e.g.,`10pt'atatypesizeof10pt.5.6FloatsSometypographicelements,suchas guresandtables,cannotbebrokenacrosspages.Theymustbetypesetoutsideofthenormal owoftext,forinstance oatingtothetopofalaterpage.LATEXcanhaveanumberofdi erentclassesof oatingmaterial.Thedefaultisthetwoclasses,figure(see Section8.10[ gure],page52 )andtable(see Section8.22[table],page76 ),butyoucancreateanewclasswiththepackagefloat.Withinanyone oatclassLATEXalwaysrespectstheorder,sothatthe rst gureinadocumentsourcemustbetypesetbeforethesecond gure.However,LATEXmaymixtheclasses,soitcanhappenthatwhilethe rsttableappearsinthesourcebeforethe rst gure,itappearsintheoutputafterit.Theplacementof oatsissubjecttoparameters,givenbelow,thatlimitthenumberof oatsthatcanappearatthetopofapage,andthebottom,etc.Ifsomany oatsare Chapter5:Layout27 queuedthatthelimitspreventthemallfrom ttingonapagethenLATEXplaceswhatitcananddeferstheresttothenextpage.Inthisway, oatsmayendupbeingtypesetfarfromtheirplaceinthesource.Inparticular,a oatthatisbigmaymigratetotheendofthedocument.Inwhichevent,becauseall oatsinaclassmustappearinsequentialorder,everyfollowing oatinthatclassalsoappearsattheend.Inadditiontochangingtheparameters,foreach oatyoucantweakwherethe oatplacementalgorithmtriestoplaceitbyusingitsplacementargument.Thepossiblevaluesareasequenceofthelettersbelow.Thedefaultforbothfigureandtable,inbotharticleandbookclasses,istbp.t(Top)|atthetopofatextpage.b(Bottom)|atthebottomofatextpage.(However,bisnotallowedforfull-width oats(figure*)withdouble-columnoutput.Toamelioratethis,usethestfloatsordblfloatfixpackage,butseethediscussionatcaveatsintheFAQ: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=2colfloat .h(Here)|atthepositioninthetextwherethefigureenvironmentappears.However,hisnotallowedbyitself;tisautomaticallyadded.Toabsolutelyforcea oattoappear\here",youcan\usepackage{float}andusetheHspeci erwhichitde nes.Forfurtherdiscussion,seetheFAQentryat http://www.tex.ac.uk/cgi-bin/texfaq2html?label=figurehere .p(Pageof oats)|onaseparate oatpage,whichisapagecontainingnotext,only oats.!Usedinadditiontooneoftheabove;forthis oatonly,LATEXignoresthere-strictionsonboththenumberof oatsthatcanappearandtherelativeamountsof oatandnon- oattextonthepage.The!speci erdoesnotmean\putthe oathere";seeabove.Note:theorderinwhichlettersappearintheplacementargumentdoesnotchangetheorderinwhichLATEXtriestoplacethe oat;forinstance,btphasthesamee ectastbp.Allthatplacementdoesisthatifaletterisnotpresentthenthealgorithmdoesnottrythatlocation.Thus,LATEX'sdefaultoftbpistotryeverylocationexceptplacingthe oatwhereitoccursinthesource.TopreventLATEXfrommoving oatstotheendofthedocumentorachapteryoucanusea\clearpagecommandtostartanewpageandinsertallpending oats.Ifapagebreakisundesirablethenyoucanusetheafterpagepackageandissue\afterpage{\clearpage}.Thiswillwaituntilthecurrentpageis nishedandthen ushalloutstanding oats.LATEXcantypeseta oatbeforewhereitappearsinthesource(althoughonthesameoutputpage)ifthereisatspeci erintheplacementparameter.Ifthisisnotdesired,anddeletingthetisnotacceptableasitkeepsthe oatfrombeingplacedatthetopofthenextpage,thenyoucanpreventitbyeitherusingtheflafterpackageorusingthecommand\suppressfloats[t],whichcauses oatsforthetoppositiononthispagetomovedtothenextpage.Parametersrelatingtofractionsofpagesoccupiedby oatandnon- oattext(changethemwith\renewcommand{parameter}{decimalbetween0and1}): Chapter5:Layout28 \bottomfractionThemaximumfractionofthepageallowedtobeoccupiedby oatsatthebottom;default`.3'.\floatpagefractionTheminimumfractionofa oatpagethatmustbeoccupiedby oats;default`.5'.\textfractionMinimumfractionofapagethatmustbetext;if oatstakeuptoomuchspacetopreservethismuchtext, oatswillbemovedtoadi erentpage.Thedefaultis`.2'.\topfractionMaximumfractionatthetopofapagethatmaybeoccupiedbefore oats;default`.7'.Parametersrelatingtoverticalspacearound oats(changethemwithacommandoftheform\setlength{parameter}{lengthexpression}):\floatsepSpacebetween oatsatthetoporbottomofapage;default`12ptplus2ptminus2pt'.\intextsepSpaceaboveandbelowa oatinthemiddleofthemaintext;default`12ptplus2ptminus2pt'for10pointand11pointdocuments,and`14ptplus4ptminus4pt'for12pointdocuments.\textfloatsepSpacebetweenthelast( rst) oatatthetop(bottom)ofapage;default`20ptplus2ptminus4pt'.Countersrelatingtothenumberof oatsonapage(changethemwithacommandoftheform\setcounter{ctrname}{naturalnumber}):bottomnumberMaximumnumberof oatsthatcanappearatthebottomofatextpage;default1.dbltopnumberMaximumnumberoffull-sized oatsthatcanappearatthetopofatwo-columnpage;default2.topnumberMaximumnumberof oatsthatcanappearatthetopofatextpage;default2.totalnumberMaximumnumberof oatsthatcanappearonatextpage;default3.TheprincipalTEXFAQentryrelatingto oats http://www.tex.ac.uk/cgi-bin/texfaq2html?label=floats containssuggestionsforrelaxingLATEX'sdefaultparameterstoreducetheproblemof oatsbeingpushedtotheend.Afullexplanationofthe oat Chapter5:Layout29 placementalgorithmisinFrankMittelbach'sarticle\Howtoin uencethepositionof oatenvironmentslike gureandtableinLATEX?"( http://latex-project.org/papers/tb111mitt-float.pdf ). 30 6SectioningStructureyourtextintodivisions:parts,chapters,sections,etc.Allsectioningcommandshavethesameform,oneof:sectioning-command{title}sectioning-command*{title}sectioning-command[toc-title]{title}Forinstance,declarethestartofasubsectionaswith\subsection{Motivation}.Thetablehaseachsectioning-commandinLATEX.AllareavailableinallofLATEX'sstan-darddocumentclassesbook,report,andarticle,exceptthat\chapterisnotavailableinarticle.SectioningunitCommandLevelPart\part-1(book,report),0(article)Chapter\chapter0Section\section1Subsection\subsection2Subsubsection\subsubsection3Paragraph\paragraph4Subparagraph\subparagraph5Allthesecommandshavea*-formthatprintstitleasusualbutisnotnumberedanddoesnotmakeanentryinthetableofcontents.Anexampleofusingthisisforanappendixinanarticle.Theinput\appendix\section{Appendix}givestheoutput`AAppendix'(see Section6.6[\appendix],page36 ).Youcanlosethenumbering`A'byinsteadentering\section*{Appendix}(articlesoftenomitatableofcontentsandhavesimplepageheaderssotheotherdi erencesfromthe\sectioncommandmaynotmatter).Thesectiontitletitleprovidestheheadinginthemaintext,butitmayalsoappearinthetableofcontentsandintherunningheadorfoot(see Chapter18[Pagestyles],page153 ).Youmaynotwantthesametextintheseplacesasinthemaintext.Allofthesecommandshaveanoptionalargumenttoc-titlefortheseotherplaces.Thelevelnumberinthetableabovedetermineswhichsectionalunitsarenumbered,andwhichappearinthetableofcontents.Ifthesectioningcommand'slevelislessthanorequaltothevalueofthecountersecnumdepththenthetitlesforthissectioningcommandwillbenumbered(see [Sectioning/secnumdepth],page30 ).And,iflevelislessthanorequaltothevalueofthecountertocdepththenthetableofcontentswillhaveanentryforthissectioningunit(see [Sectioning/tocdepth],page31 ).LATEXexpectsthatbeforeyouhavea\subsectionyouwillhavea\sectionand,inabook,thatbeforea\sectionyouwillhavea\chapter.Otherwiseyoucangetasomethinglikeasubsectionnumbered`3.0.1'.Twocountersrelatetotheappearanceofsectioningcommands.secnumdepthControlswhichsectioningcommandsarenumbered.Suppressnumberingofsectioningatanydepthgreaterthanlevel\setcounter{secnumdepth}{level}(see Section13.4[\setcounter],page118 ).Seetheabovetableforthe Chapter6:Sectioning31 levelnumbers.Forinstance,ifthesecnumdepthis1inanarticlethena\section{Introduction}commandwillproduceoutputlike`1Introduction'while\subsection{Discussion}willproduceoutputlike`Discussion',withoutthenumber.LATEX'sdefaultsecnumdepthis3inarticleclassand2inthebookandreportclasses.tocdepthControlswhichsectioningunitsarelistedinthetableofcontents.Thesetting\setcounter{tocdepth}{level}makesthesectioningunitsatlevelbethesmallestoneslisted(see Section13.4[\setcounter],page118 ).Seetheabovetableforthelevelnumbers.Forinstance,iftocdepthis1thenthetableofcontentswilllistsectionsbutnotsubsections.LATEX'sdefaultsecnumdepthis3inarticleclassand2inthebookandreportclasses.6.1\partSynopsis,oneof:\part{title}\part*{title}\part[toc-title]{title}Startadocumentpart.ThestandardLATEXclassesbook,report,andarticle,allhavethiscommand.Thisproducesadocumentpart,inabook.\part{VOLUMEI\\PERSONALMEMOIRSOFU.\S.\GRANT}\chapter{ANCESTRY--BIRTH--BOYHOOD.}MyfamilyisAmerican,andhasbeenforgenerations,inallitsbranches,directandcollateral.Ineachstandardclassthe\partcommandoutputsapartnumbersuchas`PartI',aloneonitsline,inboldface,andinlargetype.ThenLATEXoutputstitle,alsoaloneonitsline,inboldandinevenlargertype.Inclassbook,theLATEXdefaultputseachpartaloneonitsownpage.Ifthebookistwo-sidedthenLATEXwillskipapageifneededtohavethenewpartonanodd-numberedpage.Inreportitisagainaloneonapage,butLATEXwon'tforceitontoanodd-numberedpage.InanarticleLATEXdoesnotputitonafreshpage,butinsteadoutputsthepartnumberandparttitleontothemaindocumentpage.The*formshowstitlebutitdoesnotshowthepartnumber,doesnotincrementthepartcounter,andproducesnotableofcontentsentry.Theoptionalargumenttoc-titlewillappearastheparttitleinthetableofcontents(see Section25.1[Tableofcontentsetc.],page202 )andinrunningheaders(see Chapter18[Pagestyles],page153 ).Ifitisnotpresentthentitlewillbethere.Thisexampleputsalinebreakintitlebutleavesoutthebreakinthetableofcontents.\part[Upfromthebottom;mylife]{Upfromthebottom\\mylife}Fordeterminingwhichsectionalunitsarenumberedandwhichappearinthetableofcontents,thelevelnumberofapartis-1(see [Sectioning/secnumdepth],page30, andsee [Sectioning/tocdepth],page31 ).Intheclassarticle,ifaparagraphimmediatelyfollowstheparttitlethenitisnotindented.Togetanindentyoucanusethepackageindentfirst. Chapter6:Sectioning32 Onepackagetochangethebehaviorof\partistitlesec.SeeitsdocumentationonCTAN.6.2\chapterSynopsis,oneof:\chapter{title}\chapter*{title}\chapter[toc-title]{title}Startachapter.ThestandardLATEXclassesbookandreporthavethiscommandbutarticledoesnot.Thisproducesachapter.\chapter{Loomings}CallmeIshmael.Someyearsago---nevermindhowlongprecisely---havinglittleornomoneyinmypurse,andnothingparticulartointerestmeonshore,IthoughtIwouldsailaboutalittleandseethewaterypartoftheworld.TheLATEXdefaultstartseachchapteronafreshpage,anodd-numberedpageifthedocumentistwo-sided.Itproducesachapternumbersuchas`Chapter1'inlargeboldfacetype(thesizeis\huge).Itthenputstitleonafreshline,inboldfacetypethatisstilllarger(size\Huge).Italsoincrementsthechaptercounter,addsanentrytothetableofcontents(see Section25.1[Tableofcontentsetc.],page202 ),andsetstherunningheaderinformation(see Chapter18[Pagestyles],page153 ).The*formshowstitleonafreshline,inboldface.Butitdoesnotshowthechapternumber,doesnotincrementthechaptercounter,producesnotableofcontentsentry,anddoesnota ecttherunningheader.(Ifyouusethepagestyleheadingsinatwo-sideddocumentthentheheaderwillbefromthepriorchapter.)Thisexampleillustrates.\chapter*{Preamble}Theoptionalargumenttoc-titlewillappearasthechaptertitleinthetableofcontents(see Section25.1[Tableofcontentsetc.],page202 )andinrunningheaders(see Chapter18[Pagestyles],page153 ).Ifitisnotpresentthentitlewillbethere.Thisshowsthefullnameinthechaptertitle,\chapter[Weyl]{HermannKlausHugo(Peter)Weyl(1885--1955)}butonly`Weyl'onthecontentspage.Thisputsalinebreakinthetitlebutthatdoesn'tworkwellwithrunningheaderssoitomitsthebreakinthecontents\chapter[Givenitall\\mystory]{Givenitall\\mystory}Fordeterminingwhichsectionalunitsarenumberedandwhichappearinthetableofcontents,thelevelnumberofachapteris0(see [Sectioning/secnumdepth],page30, andsee [Sectioning/tocdepth],page31 ).Theparagraphthatfollowsthechaptertitleisnotindented,asisastandardtypograph-icalpractice.Togetanindentusethepackageindentfirst. Chapter6:Sectioning33 Youcanchangewhatisshownforthechapternumber.Tochangeittosomethinglike`Lecture1',putinthepreambleeither\renewcommand{\chaptername}{Lecture}orthis(see Section12.3[\makeatletter&\makeatother],page105 ).\makeatletter\renewcommand{\@chapapp}{Lecture}\makeatotherTomakethischangebecauseoftheprimarylanguageforthedocument,seethepackagebabel.Inatwo-sideddocumentLATEXputsachapteronodd-numberedpage,ifnecessaryleavinganeven-numberedpagethatisblankexceptforanyrunningheaders.Tomakethatpagecompletelyblank,see Section10.1[\clearpage&\cleardoublepage],page95 .Tochangethebehaviorofthe\chaptercommand,youcancopyitsde nitionfromtheLATEXformat leandmakeadjustments.ButtherearealsomanypackagesonCTANthataddressthis.Oneistitlesec.Seeitsdocumentation,buttheexamplebelowgivesasenseofwhatitcando.\usepackage{titlesec}%inpreamble\titleformat{\chapter}{\Huge\bfseries}%formatoftitle{}%label,suchas1.2forasubsection{0pt}%lengthofseparationbetweenlabelandtitle{}%before-codehookThisomitsthechapternumber`Chapter1'fromthepagebutunlike\chapter*itkeepsthechapterinthetableofcontentsandtherunningheaders.6.3\sectionSynopsis,oneof:\section{title}\section*{title}\section[toc-title]{title}Startasection.ThestandardLATEXclassesarticle,book,andreportallhavethiscommand.Thisproducesasection.InthisPartwetendtobemoreinterestedinthefunction,intheinput-outputbehavior,thaninthedetailsofimplementingthatbehavior.\section{Turingmachines}Despitethisdesiretodownplayimplementation,wefollowtheapproachofA~Turingthatthefirststeptowarddefiningthesetofcomputablefunctionsistoreflectonthedetailsofwhatmechanismscando.ForthestandardLATEXclassesbookandreportthedefaultoutputislike`1.2title'(forchapter1,section2),aloneonitslineand ushleft,inboldfaceandalargertype(the Chapter6:Sectioning34 typesizeis\Large).Thesameholdsinarticleexceptthattherearenochaptersinthatclasssoitlookslike`2title'.The*formshowstitle.Butitdoesnotshowthesectionnumber,doesnotincrementthesectioncounter,producesnotableofcontentsentry,anddoesnota ecttherunningheader.(Ifyouusethepagestyleheadingsinatwo-sideddocumentthentheheaderwillbefromthepriorsection.)Theoptionalargumenttoc-titlewillappearasthesectiontitleinthetableofcontents(see Section25.1[Tableofcontentsetc.],page202 )andinrunningheaders(see Chapter18[Pagestyles],page153 ).Ifitisnotpresentthentitlewillbethere.Thisshowsthefullnameinthetitleofthesection,\section[Elizabeth~II]{ElizabeththeSecond,bytheGraceofGodoftheUnitedKingdom,CanadaandHerotherRealmsandTerritoriesQueen,HeadoftheCommonwealth,DefenderoftheFaith.}butonly`ElizabethII'onthecontentspageandintheheaders.Thishasalinebreakintitlebutthatdoesnotworkwithheaderssoitisomittedfromthecontentsandheaders.\section[Truthis,Icheated;mylifestory]{Truthis,Icheated\\mylifestory}Fordeterminingwhichsectionalunitsarenumberedandwhichappearinthetableofcontents,thelevelnumberofasectionis1(see [Sectioning/secnumdepth],page30, andsee [Sectioning/tocdepth],page31 ).Theparagraphthatfollowsthesectiontitleisnotindented,asisastandardtypograph-icalpractice.Onewaytogetanindentistousethepackageindentfirst.Ingeneral,tochangethebehaviorofthe\sectioncommand,thereareanumberofoptions.Oneisthe\@startsectioncommand(see Section6.8[\@startsection],page37 ).TherearealsomanypackagesonCTANthataddressthis,includingtitlesec.Seethedocumentationbuttheexamplebelowgivesasenseofwhattheycando.\usepackage{titlesec}%inpreamble\titleformat{\section}{\normalfont\Large\bfseries}%formatoftitle{\makebox[1pc][r]{\thesection\hspace{1pc}}}%label{0pt}%lengthofseparationbetweenlabelandtitle{}%before-codehook\titlespacing*{\section}{-1pc}{18pt}{10pt}[10pc]Thatputsthesectionnumberinthemargin.6.4\subsectionSynopsis,oneof:\subsection{title}\subsection*{title}\subsection[toc-title]{title}Startasubsection.ThestandardLATEXclassesarticle,book,andreportallhavethiscommand. Chapter6:Sectioning35 Thisproducesasubsection.WewillshowthattherearemorefunctionsthanTuringmachinesandthatthereforesomefunctionshavenoassociatedmachine.\subsection{Cardinality}Wewillbeginwithtwoparadoxesthatdramatizethechallengetoourintuitionposedbycomparingthesizesofinfinitesets.ForthestandardLATEXclassesbookandreportthedefaultoutputislike`1.2.3title'(forchapter1,section2,subsection3),aloneonitslineand ushleft,inboldfaceandalargertype(thetypesizeis\large).Thesameholdsinarticleexceptthattherearenochaptersinthatclasssoitlookslike`2.3title'.The*formshowstitle.Butitdoesnotshowthesectionnumber,doesnotincrementthesectioncounter,andproducesnotableofcontentsentry.Theoptionalargumenttoc-titlewillappearasthesectiontitleinthetableofcontents(see Section25.1[Tableofcontentsetc.],page202 ).Ifitisnotpresentthentitlewillbethere.Thisshowsthefullnameinthetitleofthesection,\subsection[$\alpha,\beta,\gamma$paper]{\textit{TheOriginofChemicalElements}byR.A.~Alpher,H.~Bethe,andG.~Gamow}butonly` , , paper'onthecontentspage.Fordeterminingwhichsectionalunitsarenumberedandwhichappearinthetableofcontents,thelevelnumberofasubsectionis2(see [Sectioning/secnumdepth],page30, andsee [Sectioning/tocdepth],page31 ).Theparagraphthatfollowsthesubsectiontitleisnotindented,asisastandardtypo-graphicalpractice.Onewaytogetanindentistousethepackageindentfirst.Thereareanumberofwaystochangethebehaviorofthe\subsectioncommand.Oneisthe\@startsectioncommand(see Section6.8[\@startsection],page37 ).TherearealsomanypackagesonCTANthataddressthis,includingtitlesec.Seethedocumentationbuttheexamplebelowgivesasenseofwhattheycando.\usepackage{titlesec}%inpreamble\titleformat{\subsection}[runin]{\normalfont\normalsize\bfseries}%formatofthetitle{\thesubsection}%label{0.6em}%spacebetweenlabelandtitle{}%before-codehookThatputsthesubsectionnumberandtitleinthe rstlineoftext.6.5\subsubsection,\paragraph,\subparagraphSynopsis,oneof:\subsubsection{title}\subsubsection*{title}\subsubsection[toc-title]{title}oroneof:\paragraph{title} Chapter6:Sectioning36 \paragraph*{title}\paragraph[toc-title]{title}oroneof:\subparagraph{title}\subparagraph*{title}\subparagraph[toc-title]{title}Startasubsubsection,paragraph,orsubparagraph.ThestandardLATEXclassesarticle,book,andreportallhavethesecommands,althoughtheyarenotcommonlyused.Thisproducesasubsubsection.\subsubsection{Pistonringcompressors:structuralperformance}Provideexterior/interiorwallcladdingassembliescapableofwithstandingtheeffectsofloadandstressesfromconsumer-gradegasolineenginepistonrings.ThedefaultoutputofeachofthethreedoesnotchangeoverthestandardLATEXclassesarticle,book,andreport.For\subsubsectionthetitleisaloneonitsline,inboldfaceandnormalsizetype.For\paragraphthetitleisinlinewiththetext,notindented,inboldfaceandnormalsizetype.For\subparagraphthetitleisinlinewiththetext,withaparagraphindent,inboldfaceandnormalsizetype(Becauseanarticlehasnochaptersitssubsubsectionsarenumberedandsoitlookslike`1.2.3title',forsection1,subsection2,andsubsubsection3.Theothertwodivisionsarenotnumbered.)The*formshowstitle.Butitdoesnotincrementtheassociatedcounterandproducesnotableofcontentsentry(anddoesnotshowthenumberfor\subsubsection).Theoptionalargumenttoc-titlewillappearasthedivisiontitleinthetableofcontents(see Section25.1[Tableofcontentsetc.],page202 ).Ifitisnotpresentthentitlewillbethere.Fordeterminingwhichsectionalunitsarenumberedandwhichappearinthetableofcontents,thelevelnumberofasubsubsectionis3,ofaparagraphis4,andofasubparagraphis5(see [Sectioning/secnumdepth],page30, andsee [Sectioning/tocdepth],page31 ).Theparagraphthatfollowsthesubsubsectiontitleisnotindented,asisastandardtypographicalpractice.Onewaytogetanindentistousethepackageindentfirst.Thereareanumberofwaystochangethebehaviorofthethesecommands.Oneisthe\@startsectioncommand(see Section6.8[\@startsection],page37 ).TherearealsomanypackagesonCTANthataddressthis,includingtitlesec.SeethedocumentationonCTAN.6.6\appendixSynopsis:\appendixThisdoesnotdirectlyproduceanyoutput.Butinabookorreportitdeclaresthatsubsequent\chaptercommandsstartanappendix.Inanarticleitdoesthesame,for\sectioncommands.Italsoresetsthechapterandsectioncountersto0inabookorreport,andinanarticleresetsthesectionandsubsectioncounters. Chapter6:Sectioning37 Inthisbook\chapter{One}...\chapter{Two}......\appendix\chapter{Three}...\chapter{Four}...the rsttwowillgenerateoutputnumbered`Chapter1'and`Chapter2'.Afterthe\appendixthenumberingwillbe`AppendixA'and`AppendixB'.See SectionA.4[Largerbooktemplate],page225, foranotherexample.Theappendixpackageaddsthecommand\appendixpagetoputaseparate`Appendices'inthedocumentbodybeforethe rstappendix,andthecommand\addappheadtotoctodothesameinthetableofcontents.Youcanresetthename`Appendix'withacommandlike\renewcommand{\appendixname}{Specification},aswellasanumberofotherfeatures.SeethedocumentationonCTAN.6.7\frontmatter,\mainmatter,\backmatterSynopsis,oneof:\frontmatter\mainmatter\backmatterFormatabookclassdocumentdi erentlyaccordingtowhichpartofthedocumentisbeingproduced.Allthreecommandsareoptional.Traditionally,abook'sfrontmattercontainssuchthingsasthetitlepage,anabstract,atableofcontents,apreface,alistofnotations,alistof gures,andalistoftables.(Someofthesefrontmatterpages,suchasthetitlepage,aretraditionallynotnumbered.)Thebackmattermaycontainsuchthingsasaglossary,notes,abibliography,andanindex.The\frontmatterdeclarationmakesthepagesnumberedinlowercaseroman,andmakeschaptersnotnumbered,althougheachchapter'stitleappearsinthetableofcontents;ifyouuseothersectioningcommandshere,usethe*-version(see Chapter6[Sectioning],page30 ).The\mainmatterchangesthebehaviorbacktotheexpectedversion,andresetsthepagenumber.The\backmatterleavesthepagenumberingalonebutswitchesthechaptersbacktobeingnotnumbered.See SectionA.4[Largerbooktemplate],page225, foranexampleusingthethree.6.8\@startsectionSynopsis:\@startsection{name}{level}{indent}{beforeskip}{afterskip}{style}Usedtohelprede nethebehaviorofcommandsthatstartsectioningdivisionssuchas\sectionor\subsection.Notethatthetitlesecpackagemakesmanipulationofsectioningeasier.Further,whilemostrequirementsforsectioningcommandscanbesatis edwith\@startsection,somecannot.Forinstance,inthestandardLATEXbookandreportclassesthecommands Chapter6:Sectioning38 \chapterand\reportarenotconstructedinthisway.Tomakesuchacommandyoumaywanttousethe\secdefcommand.Technically,\@startsectionhastheform\@startsection{name}{level}{indent}{beforeskip}{afterskip}{style}*[toctitle]{title}sothatissuing\renewcommand{\section}{\@startsection{name}{level}{indent}{beforeskip}{afterskip}{style}}rede nes\sectiontohavetheform\section*[toctitle]{title}(heretoo,thestar*isoptional).See Chapter6[Sectioning],page30 .Thisimpliesthatwhenyouwriteacommandlike\renewcommand{section}{...},the\@startsection{...}mustcomelastinthede nition.Seetheexamplesbelow.nameNameofthecounterusedtonumberthesectioningheader.Thiscountermustbede nedseparately.Mostcommonlythisiseithersection,subsection,orparagraph.Althoughinthosecasesthecounternameisthesameasthesectioningcommanditself,youdon'thavetousethesamename.Then\thenamedisplaysthetitlenumberand\namemarkisforthepagehead-ers.Seethethirdexamplebelow.levelAnintegergivingthedepthofthesectioningcommand.See Chapter6[Sec-tioning],page30, forthelistofstandardlevelnumbers.Iflevelislessthanorequaltothevalueofthecountersecnumdepththentitlesforthissectioningcommandwillbenumbered(see [Sectioning/secnumdepth],page30 ).Forinstance,ifsecnumdepthis1inanarticlethenthecommand\section{Introduction}willproduceoutputlike\1Introduction"while\subsection{Discussion}willproduceoutputlike\Discussion",withoutthenumberpre x.Iflevelislessthanorequaltothevalueofthecountertocdepththenthetableofcontentswillhaveanentryforthissectioningunit(see [Sectioning/tocdepth],page31 ).Forinstance,inanarticle,iftocdepthis1thenthetableofcontentswilllistsectionsbutnotsubsections.indentAlengthgivingtheindentationofallofthetitlelineswithrespecttotheleftmargin.Tohavethetitle ushwiththemarginuse0pt.Anegativeindentationsuchas-\parindentwillmovethetitleintotheleftmargin.beforeskipTheabsolutevalueofthislengthistheamountofverticalspacethatisinsertedbeforethissectioningunit'stitle.Thisspacewillbediscardedifthesectioning Chapter6:Sectioning39 unithappenstostartatthetopofafreshpage.Ifthisnumberisnegativethenthe rstparagraphfollowingtheheaderisnotindented,ifitisnon-negativethenthe rstparagraphisindented.(Notethatthenegativeof1ptplus2ptminus3ptis-1ptplus-2ptminus-3pt.)Forexample,ifbeforeskipis-3.5explus-1exminus-0.2exthentostartthenewsectioningunit,LATEXwilladdabout3.5timestheheightofaletterxinverticalspace,andthe rstparagraphinthesectionwillnotbeindented.Usingarubberlength,withplusandminus,isgoodpracticeheresinceitgivesLATEXmore exibilityinmakingupthepage(see Chapter14[Lengths],page120 ).Thefullaccountingoftheverticalspacebetweenthebaselineofthelinepriortothissectioningunit'sheaderandthebaselineoftheheaderisthatitisthesumofthe\parskipofthetextfont,the\baselineskipofthetitlefont,andtheabsolutevalueofthebeforeskip.Thisspaceistypicallyrubbersoitmaystretchorshrink.(IfthesectioningunitstartsonafreshpagesothattheverticalspaceisdiscardedthenthebaselineoftheheadertextwillbewhereLATEXwouldputthebaselineofthe rsttextlineonthatpage.)afterskipThisisalength.Ifafterskipisnon-negativethenthisistheverticalspaceinsertedafterthesectioningunit'stitleheader.Ifitisnegativethenthetitleheaderbecomesarun-inheader,sothatitbecomespartofthenextparagraph.Inthiscasetheabsolutevalueofthelengthgivesthehorizontalspacebetweentheendofthetitleandthebeginningofthefollowingparagraph.(Notethatthenegativeof1ptplus2ptminus3ptis-1ptplus-2ptminus-3pt.)Aswithbeforeskip,usingarubberlength,withplusandminuscomponents,isgoodpracticeheresinceitgivesLATEXmore exibilityinputtingtogetherthepage.Ifafterskipisnon-negativethenthefullaccountingoftheverticalspacebetweenthebaselineofthesectioningunit'sheaderandthebaselineofthe rstlineofthefollowingparagraphisthatitisthesumofthe\parskipofthetitlefont,the\baselineskipofthetextfont,andthevalueofafter.Thatspaceistypicallyrubbersoitmaystretchorshrink.(Notethatbecausethesignofafterskipchangesthesectioningunitheader'sfromstandalonetorun-in,youcannotuseanegativeafterskiptocancelpartofthe\parskip.)styleControlsthestylingofthetitle.Seetheexamplesbelow.Typicalcommandstousehereare\centering,\raggedright,\normalfont,\hrule,or\newpage.Thelastcommandinstylemaybeonethattakesoneargument,suchas\MakeUppercaseor\fboxthattakesoneargument.Thesectiontitlewillbesuppliedastheargumenttothiscommand.Forinstance,settingstyleto\bfseries\MakeUppercasewouldproducetitlesthatareboldanduppercase.TheseareLATEX'sdefaultsforthe rstthreesectioningunitsthatarede nedwith\@startsection,forthearticle,book,andreportclasses.Forsection,thelevelis1,theindentis0pt,thebeforeskipis-3.5explus-1exminus-0.2ex,theafterskipis2.3explus0.2ex,andthestyleis\normalfont\Large\bfseries.Forsubsection,thelevelis2,theindentis0pt,thebeforeskipis-3.25explus-1exminus-0.2ex,theafterskipis1.5explus0.2ex,andthestyleis\normalfont\large\bfseries.Forsubsubsection,thelevel Chapter6:Sectioning40 is3,theindentis0pt,thebeforeskipis-3.25explus-1exminus-0.2ex,theafterskipis1.5explus0.2ex,andthestyleis\normalfont\normalsize\bfseries.Hereareexamples.Theygoeitherinapackageorclass leorinthepreambleofaLATEXdocument.Ifyouputtheminthepreambletheymustgobetweena\makeatlettercommandanda\makeatother.(ProbablytheerrormessageYoucan'tuse`\spacefactor'inverticalmode.meansthatyouforgotthis.)See Section12.3[\makeatletter&\makeatother],page105 .Thiswillputsectiontitlesinlargeboldfacetype,centered.Itsays\renewcommandbecauseLATEX'sstandardclasseshavealreadyde neda\section.Forthesamereasonitdoesnotde neasectioncounter,orthecommands\thesectionand\l@section.\renewcommand\section{%\@startsection{section}% [name],page38 {1}% [level],page38 {0pt}% [indent],page38 {-3.5explus-1exminus-.2ex}% [beforeskip],page38 {2.3explus.2ex}% [afterskip],page39 {\centering\normalfont\Large\bfseries}% [style],page39 }Thiswillputsubsectiontitlesinsmallcapstype,inlinewiththeparagraph.\renewcommand\subsection{%\@startsection{subsection}% [name],page38 {2}% [level],page38 {0em}% [indent],page38 {-1explus0.1exminus-0.05ex}% [beforeskip],page38 {-1emplus0.2em}% [afterskip],page39 {\scshape}% [style],page39 }Thepriorexamplesrede nedexistingsectionalunittitlecommands.Thisde nesanewone,illustratingtheneededcounterandmacrostodisplaythatcounter.\setcounter{secnumdepth}{6}%showcountersthisfardown\newcounter{subsubparagraph}[subparagraph]%counterfornumbering\renewcommand{\thesubsubparagraph}%howtodisplay{\thesubparagraph.\@arabic\c@subsubparagraph}%numbering\newcommand{\subsubparagraph}{\@startsection{subsubparagraph}%{6}%{0em}%{\baselineskip}%{0.5\baselineskip}%{\normalfont\normalsize}}\newcommand*\l@subsubparagraph{\@dottedtocline{6}{10em}{5em}}%fortoc\newcommand{\subsubparagraphmark}[1]{}%forpageheaders 41 7CrossreferencesWeoftenwantsomethinglike`SeeTheorem~31'.Butby-handtypingthe31ispoorpractice.Insteadyoushouldwritealabelsuchas\label{eq:GreensThm}andthenreferenceit,aswithSeeequation~\ref{eq:GreensThm}.LATEXwillautomaticallyworkoutthenumber,putitintotheoutput,andwillchangethatnumberlaterifneeded.WewillseethiswithTheorem~\ref{th:GreensThm}.%forwardreference...\begin{theorem}\label{th:GreensThm}...\end{theorem}...SeeTheorem~\ref{th:GreensThm}onpage~\pageref{th:GreensThm}.LATEXtrackscrossreferenceinformationina lehavingtheextension.auxandwiththesamebasenameasthe lecontainingthe\label.Soif\labelisincalculus.texthentheinformationisincalculus.aux.LATEXputstheinformationinthat leeverytimeitrunsacrossa\label.Thebehaviordescribedinthepriorparagraphresultsinaquirkthathappenswhenyourdocumenthasaforwardreference,a\refthatappearsbeforetheassociated\label.Ifthisisthe rsttimethatyouarecompilingthedocumentthenyouwillget`LaTeXWarning:Label(s)mayhavechanged.Reruntogetcrossreferencesright'andintheoutputtheforwardreferencewillappearastwoquestionmarks`??',inboldface.Asimilarthinghappensifyouchangesomethingssothereferenceschanges;yougetthesamewarningandtheoutputcontainstheoldreferenceinformation.Inbothcases,resolvethisbycompilingthedocumentasecondtime.ThecleverefpackageenhancesLATEX'scrossreferencingfeatures.Youcanarrangethatifyouenter\begin{thm}\label{th:Nerode}...\end{thm}then\cref{th:Nerode}willoutput`Theorem3.21',withoutyouhavingtoenterthe\Theorem."7.1\labelSynopsis:\label{key}Assignareferencenumbertokey.Inordinarytext\label{key}assignstokeythenumberofthecurrentsectionalunit.Insideanenvironmentwithnumbering,suchasatableortheoremenvironment,\label{key}assignstokeythenumberofthatenviron-ment.Retrievetheassignednumberwiththe\ref{key}command(see Section7.3[\ref],page42 ).Akeynamecanconsistofanysequenceofletters,digits,orcommonpunctuationchar-acters.Upperandlowercaselettersaredistinguished,asusual.Acommonconventionistouselabelsconsistingofapre xandasuxseparatedbyacolonorperiod.Thus,\label{fig:Post}isalabelfora gurewithaportraitofEmilPost.Thishelpstoavoidaccidentallycreatingtwolabelswiththesamename,andmakesyoursourcemorereadable.Somecommonly-usedpre xes:chforchapters Chapter7:Crossreferences42 secsubsecforlower-levelsectioningcommandsfigfor gurestabfortableseqforequationsIntheauxiliary lethereferenceinformationiskeptasthetextofacommandoftheform\newlabel{label}{{currentlabel}{pagenumber}}.Herecurrentlabelisthecurrentvalueofthemacro\@currentlabelthatisusuallyupdatedwheneveryoucall\refstepcounter{counter}.Below,thekeysec:testwillgetthenumberofthecurrentsectionandthekeyfig:testwillgetthenumberofthe gure.(Incidentally,putlabelsaftercaptionsin guresandtables.)\section{sectionname}\label{sec:test}ThisisSection~\ref{sec:test}.\begin{figure}...\caption{captiontext}\label{fig:test}\end{figure}SeeFigure~\ref{fig:test}.7.2\pagerefSynopsis:\pageref{key}Producethepagenumberoftheplaceinthetextwherethecorresponding\labelfkeygcommandappears.Ifthereisno\label{key}thenyougetsomethinglike`LaTeXWarning:Reference`th:GrensThm'onpage1undefinedoninputline11.'Below,the\label{eq:main}isusedbothfortheformulanumberandforthepagenumber.(Notethatthetworeferencesareforwardreferencessothisdocumentwouldneedtobecompiledtwicetoresolvethose.)Themainresultisformula~\ref{eq:main}onpage~\pageref{eq:main}....\begin{equation}\label{eq:main}\mathbf{P}=\mathbf{NP}\end{equation}7.3\refSynopsis:\ref{key} Chapter7:Crossreferences43 Producesthenumberofthesectionalunit,equation,footnote, gure,...,ofthecor-responding\labelcommand(see Section7.1[\label],page41 ).Itdoesnotproduceanytext,suchastheword`Section'or`Figure',justthebarenumberitself.Ifthereisno\label{key}thenyougetsomethinglike`LaTeXWarning:Reference`th:GrensThm'onpage1undefinedoninputline11.'Inthisexamplethe\ref{popular}produces`2'.Notethatitisaforwardreferencesinceitcomesbefore\label{popular}sothisdocumentwouldhavetobecompiledtwice.Themostwidely-usedformatisitemnumber~\ref{popular}.\begin{enumerate}\itemPlain\TeX\item\label{popular}\LaTeX\itemCon\TeXt\end{enumerate}Thecleverefpackageincludestextsuchas`Theorem'inthereference.Seethedocu-mentationonCTAN. 44 8EnvironmentsLATEXprovidesmanyenvironmentsfordelimitingcertainbehavior.Anenvironmentbeginswith\beginandendswith\end,likethis:\begin{environment-name}...\end{environment-name}Theenvironment-nameatthebeginningmustexactlymatchthatattheend.Forinstance,theinput\begin{table*}...\end{table}willcauseanerrorlike:`!LaTeXError:\begin{table*}oninputline5endedby\end{table}.'Environmentsareexecutedwithinagroup.8.1abstractSynopsis:\begin{abstract}...\end{abstract}Produceanabstract,possiblyofmultipleparagraphs.Thisenvironmentisonlyde nedinthearticleandreportdocumentclasses(see Chapter3[Documentclasses],page7 ).Usingtheexamplebelowinthearticleclassproducesadisplayedparagraph.Docu-mentclassoptiontitlepagecausestheabstracttobeonaseparatepage(see Section3.1[Documentclassoptions],page7 );thisisthedefaultonlyinthereportclass.\begin{abstract}WecompareallknownaccountsoftheproposalmadebyPorterAlexandertoRobertELeeattheAppomattoxCourtHousethatthearmycontinueinaguerrillawar,whichLeerefused.\end{abstract}Thenextexampleproducesaonecolumnabstractinatwocolumndocument(foramore exiblesolution,usethepackageabstract).\documentclass[twocolumn]{article}...\begin{document}\title{BabeRuthasCulturalProgenitor:aAtavisticApproach}\author{Smith\\Jones\\Robinson\thanks{Railroadtrackinggrant.}}\twocolumn[\begin{@twocolumnfalse}\maketitle\begin{abstract}RuthwasnotjusttheSultanofSwat,hewastheentireswatteam.\end{abstract}\end{@twocolumnfalse}]{%by-handinsertafootnoteatpagebottom Chapter8:Environments45 \renewcommand{\thefootnote}{\fnsymbol{footnote}}\footnotetext[1]{Thanksforallthefish.}}8.2arraySynopsis:\begin{array}{cols}column1entry&column2entry...&columnnentry\\...\end{array}or:\begin{array}[pos]{cols}column1entry&column2entry...&columnnentry\\...\end{array}Produceamathematicalarray.Thisenvironmentcanonlybeusedinmathmode,andnormallyappearswithinadisplayedmathematicsenvironmentsuchasequation(see Section8.9[equation],page51 ).Insideofeachrowthecolumnentriesareseparatedbyanampersand,(&).Rowsareterminatedwithdouble-backslashes(see Section9.1[\\],page90 ).Thisexampleshowsathreebythreearray.\begin{equation*}\chi(x)=\left|%verticalbarfence\begin{array}{ccc}x-a&-b&-c\\-d&x-e&-f\\-g&-h&x-i\end{array}\right|\end{equation*}Therequiredargumentcolsdescribesthenumberofcolumns,theiralignment,andtheformattingoftheintercolumnregions.Forinstance,\begin{array}{rcl}...\end{array}givesthreecolumns:the rst ushright,thesecondcentered,andthethird ushleft.See Section8.23[tabular],page77, forthecompletedescriptionofcolsandoftheothercommonfeaturesofthetwoenvironments,includingtheoptionalposargument.Therearetwowaysthatarraydivergesfromtabular.The rstisthatarrayentriesaretypesetinmathmode,intextstyle(see Chapter17[Modes],page151 )exceptifthecolsde nitionspeci esthecolumnwithp{...},whichcausestheentrytobetypesetintextmode.Thesecondisthat,insteadoftabular'sparameter\tabcolsep,LATEX'sintercolumnspaceinanarrayisgovernedby\arraycolsep,whichgiveshalfthewidthbetweencolumns.Thedefaultforthisis`5pt'sothatbetweentwocolumnscomes10ptofspace.Toobtainarrayswithbracesthestandardistousetheamsmathpackage.Itcomeswithenvironmentspmatrixforanarraysurroundedbyparentheses(...),bmatrixfor Chapter8:Environments46 anarraysurroundedbysquarebrackets[...],Bmatrixforanarraysurroundedbycurlybraces{...},vmatrixforanarraysurroundedbyverticalbars|...|,andVmatrixforanarraysurroundedbydoubleverticalbars||...||,alongwithanumberofotherarrayconstructs.Thenextexampleusestheamsmathpackage.\usepackage{amsmath}%inpreamble\begin{equation}\begin{vmatrix}{cc}%arraywithvertlinesa&b\\c&d\end{vmatrix}=ad-bc\end{equation}Therearemanypackagesconcerningarrays.Thearraypackagehasmanyusefulexten-sions,includingmorecolumntypes.Thedcolumnpackageaddsacolumntypetocenteronadecimalpoint.ForbothseethedocumentationonCTAN.8.3centerSynopsis:\begin{center}line1\\line2\\...\end{center}Createanewparagraphconsistingofasequenceoflinesthatarecenteredwithintheleftandrightmargins.Usedouble-backslash,\\,togetalinebreak(see Section9.1[\\],page90 ).Ifsometextistoolongto tonalinethenLATEXwillinsertlinebreaksthatavoidhyphenationandavoidstretchingorshrinkinganyinterwordspace.Thisenvironmentinsertsspaceaboveandbelowthetextbody.See Section8.3.1[\cen-tering],page47, toavoidsuchspace,forexampleinsideafigureenvironment.Thisexampleproducesthreecenteredlines.Thereisextraverticalspacebetweenthelasttwolines.\begin{center}AThesisSubmittedinPartialFufillment\\oftheRequirementsof\\[0.5ex]theSchoolofEnvironmentalEngineering\end{center}Inthisexample,dependingonthepage'slinewidth,LATEXmaychoosealinebreakforthepartbeforethedoublebackslash.Ifso,itwillcentereachofthetwolinesandifnotitwillcenterthesingleline.ThenLATEXwillbreakatthedoublebackslash,andwillcentertheending.\begin{center}Myfatherconsideredthatanyonewhowenttochapelanddidn'tdrinkalcoholwasnottobetolerated.\\ Chapter8:Environments47 Igrewupinthatbelief.--RichardBurton\end{center}Adoublebackslashafterthe nallineisoptional.Ifpresentitdoesn'taddanyverticalspace.Inatwo-columndocumentthetextiscenteredinacolumn,notintheentirepage.8.3.1\centeringSynopsis:{\centering...}or\begin{group}\centering...\end{group}Centerthematerialinitsscope.Itismostoftenusedinsideanenvironmentsuchasfigure,orinaparbox.Thisexample's\centeringdeclarationcausesthegraphictobehorizontallycentered.\begin{figure}\centering\includegraphics[width=0.6\textwidth]{ctan_lion.png}\caption{CTANLion}\label{fig:CTANLion}\end{figure}Thescopeofthis\centeringendswiththe\end{figure}.Unlikethecenterenvironment,the\centeringcommanddoesnotaddverticalspaceaboveandbelowthetext.That'sitsadvantageintheaboveexample;thereisnotanexcessofspace.Italsodoesnotstartanewparagraph;itsimplychangeshowLATEXformatsparagraphunits.Ifww{\centeringxx\\yy}zzissurroundedbyblanklinesthenLATEXwillcreateaparagraphwhose rstline`wwxx'iscenteredandwhosesecondline,notcentered,contains`yyzz'.Usuallywhatisdesiredisforthescopeofthedeclarationtocontainablanklineorthe\endcommandofanenvironmentsuchasfigureortablethatendstheparagraphunit.Thus,if{\centeringxx\\yy\par}zzissurroundedbyblanklinesthenitmakesanewparagraphwithtwocenteredlines`xx'and`yy',followedbyanewparagraphwith`zz'thatisformattedasusual.8.4descriptionSynopsis:\begin{description}\item[labeloffirstitem]textoffirstitem\item[labelofseconditem]textofseconditem...\end{description}Environmenttomakealistoflabeleditems.Eachitem'slabelistypesetinboldandis ushleft,sothatlonglabelscontinueintothe rstlineoftheitemtext.Theremust Chapter8:Environments48 beatleastoneitem;havingnonecausestheLATEXerror`Something'swrong--perhapsamissing\item'.Thisexampleshowstheenvironmentusedforasequenceofde nitions.\begin{definition}\item[lama]Apriest.\item[llama]Abeast.\end{definition}Thelabels`lama'and`llama'areoutputinboldface,withtheleftedgeontheleftmargin.Startlistitemswiththe\itemcommand(see Section8.16.1[\item],page61 ).Usetheoptionallabels,asin\item[Mainpoint],becausethereisnosensibledefault.Followingthe\itemisoptionaltext,whichmaycontainmultipleparagraphs.Sincethelabelsareinboldstyle,ifthelabeltextcallsforafontchangegiveninargumentstyle(see Section4.1[Fontstyles],page16 )thenitwillcomeoutbold.Forinstance,ifthelabeltextcallsfortypewriterwith\item[\texttt{labeltext}]thenitwillappearinboldtypewriter,ifthatisavailable.Thesimplestwayaroundthis,inthisexampletogetnon-boldtypewriter,istousedeclarativestyle:\item[{\ttlabeltext}].Similarly,getthestandardromanfontwith\item[{\rmlabeltext}].ForothermajorLATEXlabelledlistenvironments,see Section8.14[itemize],page55, and Section8.7[enumerate],page49 .Unlikethoseenvironments,nestingdescriptionenvironmentsdoesnotchangethedefaultlabel;itisboldfaceand ushleftatalllevels.Forinformationaboutlistlayoutparameters,includingthedefaultvalues,andforinfor-mationaboutcustomizinglistlayout,see Section8.16[list],page57 .Thepackageenumitemisusefulforcustomizinglists.Thisexamplechangesthedescriptionlabelstosmallcaps.\renewcommand{\descriptionlabel}[1]{%{\hspace{\labelsep}\textsc{#1}}}8.5displaymathSynopsis:\begin{displaymath}mathematicaltext\end{displaymath}Environmenttotypesetthemathtextonitsownline,indisplaystyleandcentered.Tomakethetextbe ush-leftusetheglobaloptionfleqn;see Section3.1[Documentclassoptions],page7 .Inthedisplaymathenvironmentnoequationnumberisaddedtothemathtext.Onewaytogetanequationnumberistousetheequationenvironment(see Section8.9[equa-tion],page51 ).LATEXwillnotbreakthemathtextacrosslines.Notethattheamsmathpackagehassigni cantlymoreextensivedisplayedequationfacil-ities.Forexample,thereareanumberofwaysinthatpackageforhavingmathtextbrokenacrosslines. Chapter8:Environments49 Theconstruct\[mathtext\]isessentiallyasynonymfor\begin{displaymath}mathtext\end{displaymath}butthelatteriseasiertoworkwithinthesource le;forinstance,searchingforasquarebracketmaygetfalsepositivesbuttheworddisplaymathwilllikelybeunique.(Theconstruct$$mathtext$$fromPlainTEXissometimesmistakenlyusedasasynonymfordisplaymath.Itisnotasynonym,becausethedisplaymathenvironmentchecksthatitisn'tstartedinmathmodeandthatitendsinmathmodebegunbythematchingenvironmentstart,becausethedisplaymathenvironmenthasdi erentverticalspacing,andbecausethedisplaymathenvironmenthonorsthefleqnoption.)Theoutputfromthisexampleiscenteredandaloneonitsline.\begin{displaymath}\int_1^2x^2\,dx=7/3\end{displaymath}Also,theintegralsignislargerthantheinlineversion\(\int_1^2x^2\,dx=7/3\)pro-duces.8.6documentThedocumentenvironmentenclosestheentirebodyofadocument.ItisrequiredineveryLATEXdocument.See Section2.1[Startingandending],page3 .8.6.1\AtBeginDocumentSynopsis:\AtBeginDocument{code}Savecodeandexecuteitwhen\begin{document}isexecuted,attheveryendofthepreamble.Thecodeisexecutedafterthefontselectiontableshavebeensetup,sothenormalfontforthedocumentisthecurrentfont.However,thecodeisexecutedaspartofthepreamblesoyoucannotdoanytypesettingwithit.Youcanissuethiscommandmorethanonce;thesuccessivecodelineswillbeexecutedintheorderthatyougavethem.8.6.2\AtEndDocumentSynopsis:\AtEndDocument{code}Savecodeandexecuteitneartheendofthedocument.Speci cally,itisexecutedwhen\end{document}isexecuted,beforethe nalpageis nishedandbeforeanyleftover oatingenvironmentsareprocessed.Ifyouwantsomeofthecodetobeexecutedafterthesetwoprocessesthenincludea\clearpageattheappropriatepointincode.Youcanissuethiscommandmorethanonce;thesuccessivecodelineswillbeexecutedintheorderthatyougavethem.8.7enumerateSynopsis:\begin{enumerate}\item[optionallabeloffirstitem]textoffirstitem Chapter8:Environments50 \item[optionallabelofseconditem]textofseconditem...\end{enumerate}Environmenttoproduceanumberedlistofitems.Theformatofthelabelnumberingdependsonthenestinglevelofthisenvironment;seebelow.Thedefaulttop-levelnumberingis`1.',`2.',etc.Eachenumeratelistenvironmentmusthaveatleastoneitem;havingnonecausestheLATEXerror`Something'swrong--perhapsamissing\item'.Thisexamplegivesthe rsttwo nishersinthe1908Olympicmarathon.Asatop-levellistthelabelswouldcomeoutas`1.'and`2.'.\begin{enumerate}\itemJohnnyHayes(USA)\itemCharlesHefferon(RSA)\end{enumerate}Startlistitemswiththe\itemcommand(see Section8.16.1[\item],page61 ).Ifyougive\itemanoptionalargumentbyfollowingitwithsquarebrackets,asin\item[Interstitiallabel],thenthenextitemwillcontinuetheinterruptedsequence(see Section8.16.1[\item],page61 ).Thatis,youwillgetlabelslike`1.',then`Interstitiallabel',then`2.'.Followingthe\itemisoptionaltext,whichmaycontainmultipleparagraphs.Enumerationsmaybenestedwithinotherenumerateenvironments,orwithinanyparagraph-makingenvironmentsuchasitemize(see Section8.14[itemize],page55 ),uptofourlevelsdeep.ThisgivesLATEX'sdefaultfortheformatateachnestinglevel,where1isthetoplevel,theoutermostlevel.1.arabicnumberfollowedbyaperiod:`1.',`2.',...2.lowercaseletterinsideparentheses:`(a)',`(b)'...3.lowercaseromannumeralfollowedbyaperiod:`i.',`ii.',...4.uppercaseletterfollowedbyaperiod:`A.',`B.',...Theenumerateenvironmentusesthecounters\enumithrough\enumiv(see Chapter13[Counters],page116 ).ForothermajorLATEXlabeledlistenvironments,see Section8.4[description],page47, and Section8.14[itemize],page55 .Forinformationaboutlistlayoutparameters,includingthedefaultvalues,andforinformationaboutcustomizinglistlayout,see Section8.16[list],page57 .Thepackageenumitemisusefulforcustomizinglists.Tochangetheformatofthelabeluse\renewcommand(see Section12.1[\newcommand&\renewcommand],page103 )onthecommands\labelenumithrough\labelenumiv.Forinstance,this rstlevellistwillbelabelledwithuppercaseletters,inboldface,andwithoutatrailingperiod.\renewcommand{\labelenumi}{\textbf{\Alph{enumi}}}\begin{enumerate}\itemShowsasboldfaceA\itemShowsasboldfaceB\end{enumerate}Foralistofcounter-labelingcommandssee Section13.1[\alph\Alph\arabic\roman\Roman\fnsymbol],page116 . Chapter8:Environments51 8.8eqnarrayTheeqnarrayenvironmentisobsolete.Ithasinfelicities,includingspacingthatisin-consistentwithothermathematicselements.(See\Avoideqnarray!"byLarsMadsen http://tug.org/TUGboat/tb33-1/tb103madsen.pdf ).Newdocumentsshouldincludetheamsmathpackageandusethedisplayedmathematicsenvironmentsprovidedthere,suchasthealignenvironment.Weincludeadescriptiononlyforcompletenessandforworkingwitholddocuments.Synopsis:\begin{eqnarray}firstformulaleft&firstformulamiddle&firstformularight\\...\end{eqnarray}or\begin{eqnarray*}firstformulaleft&firstformulamiddle&firstformularight\\...\end{eqnarray*}Displayasequenceofequationsorinequalities.Theleftandrightsidesaretypesetindisplaymode,whilethemiddleistypesetintextmode.Itissimilartoathree-columnarrayenvironment,withitemswithinarowseparatedbyanampersand(&),andwithrowsseparatedbydoublebackslash\\).Thestarredformoflinebreak(\\*)canalsobeusedtoseparateequations,andwilldisallowapagebreakthere(see Section9.1[\\],page90 ).Theunstarredformeqnarrayplacesanequationnumberoneveryline(usingtheequationcounter),unlessthatlinecontainsa\nonumbercommand.Thestarredformeqnarray*omitsequationnumbering,whileotherwisebeingthesame.Thecommand\lefteqnisusedforsplittinglongformulasacrosslines.Ittypesetsitsargumentindisplaystyle ushleftinaboxofzerowidth.Thisexampleshowsthreelines.The rsttwolinesmakeaninequality,whilethethirdlinehasnotentryontheleftside.\begin{eqnarray*}\lefteqn{x_1+x_2+\cdots+x_n}\\&\leq&y_1+y_2+\cdots+y_n\\&=&z+y_3+\cdots+y_n\end{eqnarray*}8.9equationSynopsis:\begin{equation}mathematicaltext\end{equation}Thesameasadisplaymathenvironment(see Section8.5[displaymath],page48 )exceptthatLATEXputsanequationnumber ushtotherightmargin.Theequationnumberisgeneratedusingtheequationcounter. Chapter8:Environments52 Youshouldhavenoblanklinesbetween\begin{equation}and\begin{equation},orLATEXwilltellyouthatthereisamissingdollarsign.Thepackageamsmathpackagehasextensivedisplayedequationfacilities.Newdocu-mentsshouldincludethispackage.8.10figureSynopsis:\begin{figure}[placement]figurebody\caption[loftitle]{title}%optional\label{label}%optional\end{figure}or:\begin{figure*}[placement]figurebody\caption[loftitle]{title}%optional\label{label}%optional\end{figure*}Figuresareformaterialthatisnotpartofthenormaltext.Anexampleismaterialthatyoucannothavesplitbetweentwopages,suchasagraphic.Becauseofthis,LATEXdoesnottypeset guresinsequencewithnormaltextbutinstead\ oats"themtoaconvenientplace,suchasthetopofafollowingpage(see Section5.6[Floats],page26 ).The gurebodycanconsistofimportedgraphics(see Chapter22[Graphics],page179 ),ortext,LATEXcommands,etc.Itistypesetinaparboxofwidth\textwidth.Thepossiblevaluesofplacementarehfor`here',tfor`top',bfor`bottom',andpfor`onaseparatepageoffloats'.Forthee ectoftheseoptionsonthe oatplacementalgorithm,see Section5.6[Floats],page26 .Thestarredformfigure*isusedwhenadocumentisindouble-columnmode(see Section5.2[\twocolumn],page22 ).Itproducesa gurethatspansbothcolumns,atthetopofthepage.Toaddthepossibilityofplacingatapagebottomseethediscussionofplacementbin Section5.6[Floats],page26 .Thelabelisoptional;itisusedforcrossreferences(see Chapter7[Crossreferences],page41 ).Theoptional\captioncommandspeci escaptiontextforthe gure.Bydefaultitisnumbered.Ifloftitleispresent,itisusedinthelistof guresinsteadoftitle(see Section25.1[Tableofcontentsetc.],page202 ).Thisexamplemakesa gureoutofagraphic.LATEXwillplacethatgraphicanditscaptionatthetopofapageor,ifitispushedtotheendofthedocument,onapageof oats.\usepackage{graphicx}%inpreamble...\begin{figure}[t]\centering\includegraphics[width=0.5\textwidth]{CTANlion.png}\caption{TheCTANlion,byDuaneBibby} Chapter8:Environments53 \end{figure}8.11filecontents:Writeanexternal leSynopsis:\begin{filecontents}{filename}text\end{filecontents}or\begin{filecontents*}{filename}text\end{filecontents*}Createa lenamed lenameand llitwithtext.Theunstarredversionoftheenviron-mentfilecontentspre xesthecontentofthecreated lewithaheader;seetheexamplebelow.Thestarredversionfilecontents*doesnotincludetheheader.Thisenvironmentcanbeusedanywhereinthepreamble,althoughitoftenappearsbeforethe\documentclasscommand.Itistypicallyusedwhenasource lerequiresanonstandardstyleorclass le.Theenvironmentwillwritethat letothedirectorycontainingthesourceandthusmakethesource leself-contained.Anotheruseistoincludebibreferencesinthe le,againtomakeitself-contained.Theenvironmentcheckswhethera leofthatnamealreadyexistsandifso,doesnotdoanything.Thereisafilecontentspackagethatrede nesthefilecontentsenvironmentsothatinsteadofdoingnothinginthatcase,itwilloverwritetheexisting le.Forexample,thisdocument\documentclass{article}\begin{filecontents}{JH.sty}\newcommand{\myname}{JimHef{}feron}\end{filecontents}\usepackage{JH}\begin{document}Articleby\myname.\end{document}producesthis leJH.sty.%%LaTeX2efile`JH.sty'%%generatedbythe`filecontents'environment%%fromsource`test'on2015/10/12.%%\newcommand{\myname}{JimHef{}feron}8.12flushleftSynopsis:\begin{flushleft}line1\\line2\\ Chapter8:Environments54 ...\end{flushleft}Anenvironmentthatcreatesaparagraphwhoselinesare ushtotheleft-handmargin,andraggedright.IfyouhavelinesthataretoolongthenLATEXwilllinebreaktheminawaythatavoidshyphenationandstretchingorshrinkingspaces.Toforceanewlineuseadoublebackslash,\\.Forthedeclarationformsee Section8.12.1[\raggedright],page54 .Thiscreatesaboxoftextthatisatmost3incheswide,withthetext ushleftandraggedright.\noindent\begin{minipage}{3in}\begin{flushleft}Alongsentencethatwillbebrokenby\LaTeX{}ataconvenientspot.\\And,afreshlineforcedbythedoublebackslash.\end{flushleft}\end{minipage}8.12.1\raggedrightSynopses:{\raggedright...}or\begin{environment}\raggedright...\end{environment}Adeclarationwhichcauseslinestobe ushtotheleftmarginandraggedright.Itcanbeusedinsideanenvironmentsuchasquoteorinaparbox.Fortheenvironmentformsee Section8.12[ ushleft],page53 .Unliketheflushleftenvironment,the\raggedrightcommanddoesnotstartanewparagraph;itonlychangeshowLATEXformatsparagraphunits.Toa ectaparagraphunit'sformat,thescopeofthedeclarationmustcontaintheblanklineor\endcommandthatendstheparagraphunit.Here\raggedrightineachsecondcolumnkeepsLATEXfromdoingveryawkwardtype-settingto tthetextintothenarrowcolumn.Notethat\raggedrightisinsidethecurlybraces{...}todelimititse ect.\begin{tabular}{rp{2in}}Teamalpha&{\raggedrightThisteamdoesalltherealwork.}\\Teambeta&{\raggedrightThisteamensuresthatthewatercoolerisneverempty.}\\\end{tabular}8.13flushright\begin{flushright}line1\\line2\\... Chapter8:Environments55 \end{flushright}Anenvironmentthatcreatesaparagraphwhoselinesare ushtotheright-handmarginandraggedleft.Ifyouhavelinesthataretoolongto tthemarginsthenLATEXwilllinebreaktheminawaythatavoidshyphenationandstretchingorshrinkingspaces.Toforceanewlineuseadoublebackslash,\\.Forthedeclarationformsee Section8.13.1[\raggedleft],page55 .Foranexamplerelatedtothisenvironment,see Section8.12[ ushleft],page53 .8.13.1\raggedleftSynopses:{\raggedleft...}or\begin{environment}\raggedleft...\end{environment}Adeclarationwhichcauseslinestobe ushtotherightmarginandraggedleft.Itcanbeusedinsideanenvironmentsuchasquoteorinaparbox.Fortheenvironmentformsee Section8.13[ ushright],page54 .Unliketheflushrightenvironment,the\raggedleftcommanddoesnotstartanewparagraph;itonlychangeshowLATEXformatsparagraphunits.Toa ectaparagraphunit'sformat,thescopeofthedeclarationmustcontaintheblanklineor\endcommandthatendstheparagraphunit.Foranexamplerelatedtothisenvironment,see Section8.12.1[\raggedright],page54 .8.14itemizeSynopsis:\begin{itemize}\item[optionallabeloffirstitem]textoffirstitem\item[optionallabelofseconditem]textofseconditem...\end{itemize}Producealistthatisunordered,sometimescalledabulletlist.Theenvironmentmusthaveatleastone\item;havingnonecausestheLATEXerror`Something'swrong--perhapsamissing\item'.Thisgivesatwo-itemlist.\begin{itemize}\itemPencilandwatercolorsketchbyCassandra\itemRiceportrait\end{itemize}Asatop-levellisteachlabelwouldcomeoutasabullet,.Theformatofthelabelingdependsonthenestinglevel;seebelow.Startlistitemswiththe\itemcommand(see Section8.16.1[\item],page61 ).Ifyougive\itemanoptionalargumentbyfollowingitwithsquarebrackets,asin\item[Optional Chapter8:Environments56 label],thenbydefaultitwillappearinboldandbe ushright,soitcouldextendintotheleftmargin.Forlabelsthatare ushleftseethe Section8.4[description],page47, environment.Followingthe\itemisoptionaltext,whichmaycontainmultipleparagraphs.Itemizedlistscanbenestedwithinoneanother,uptofourlevelsdeep.Theycanalsobenestedwithinotherparagraph-makingenvironments,suchasenumerate(see Section8.7[enumerate],page49 ).Theitemizeenvironmentusesthecommands\labelitemithrough\labelitemivtoproducethedefaultlabel(thisalsousestheconventionoflowercaseromannumeralsattheendofthecommandnamesthatsignifythenestinglevel).Thesearethedefaultmarksateachlevel.1.(bullet,from\textbullet)2.--(bolden-dash,from\normalfont\bfseries\textendash)3.*(asterisk,from\textasteriskcentered)4.(centereddot,from\textperiodcentered)Changethelabelswith\renewcommand.Forinstance,thismakesthe rstlevelusediamonds.\renewcommand{\labelitemi}{$\diamond$}Thedistancebetweentheleftmarginoftheenclosingenvironmentandtheleftmarginoftheitemizelistisdeterminedbytheparameters\leftmarginithrough\leftmarginvi.(Notetheconventionofusinglowercaseromannumeralsatheendofthecommandnametodenotethenestinglevel.)Thedefaultsare:2.5eminlevel1(2emintwo-columnmode),2.2eminlevel2,1.87eminlevel3,and1.7eminlevel4,withsmallervaluesformoredeeplynestedlevels.ForothermajorLATEXlabeledlistenvironments,see Section8.4[description],page47, and Section8.7[enumerate],page49 .Forinformationaboutlistlayoutparameters,includ-ingthedefaultvalues,andforinformationaboutcustomizinglistlayout,see Section8.16[list],page57 .Thepackageenumitemisusefulforcustomizinglists.Thisexamplegreatlyreducesthemarginspaceforoutermostitemizedlists.\setlength{\leftmargini}{1.25em}%default2.5emEspeciallyforlistswithshortitems,itmaybedesirabletoelidespacebetweenitems.Hereisanexamplede ninganitemize*environmentwithnoextraspacingbetweenitems,orbetweenparagraphswithinasingleitem(\parskipisnotlist-speci c,see Section15.3[\parindent&\parskip],page127 ):\newenvironment{itemize*}%{\begin{itemize}%\setlength{\itemsep}{0pt}%\setlength{\parsep}{0pt}}%\setlength{\parskip}{0pt}}%{\end{itemize}}8.15letterenvironment:writinglettersThisenvironmentisusedforcreatingletters.See Chapter26[Letters],page213 . Chapter8:Environments57 8.16listSynopsis:\begin{list}{labeling}{spacing}\item[optionallabeloffirstitem]textoffirstitem\item[optionallabelofseconditem]textofseconditem...\end{list}Anenvironmentforconstructinglists.Notethatthisenvironmentdoesnottypicallyappearinthedocumentbody.MostlistscreatedbyLATEXauthorsaretheonesthatcomestandard:thedescription,enumerate,anditemizeenvironments(see Section8.4[description],page47 , Section8.7[enumerate],page49 ,and Section8.14[itemize],page55 ).Instead,thelistenvironmentismostoftenusedinmacros.Forexample,manystandardLATEXenvironmentsthatdonotimmediatelyappeartobelistsareinfactconstructedusinglist,includingquotation,quote,andcenter(see Section8.20[quotation"e],page73 ,see Section8.3[center],page46 ).Thisusesthelistenvironmenttode neanewcustomenvironment.\newcounter{namedlistcounter}%numbertheitems\newenvironment{named}{\begin{list}{Item~\Roman{namedlistcounter}.}%labeling{\usecounter{namedlistcounter}%setcounter\setlength{\leftmargin}{3.5em}}%setspacing}{\end{list}}\begin{named}\itemShowsas``Item~I.''\item[Speciallabel.]Showsas``Speciallabel.''\itemShowsas``Item~II.''\end{named}Themandatory rstargumentlabelingspeci esthedefaultlabelingoflistitems.ItcancontaintextandLATEXcommands,asabovewhereitcontainsboth`Item'and`\Roman{...}'.LATEXformsthelabelbyputtingthelabelingargumentinaboxofwidth\labelwidth.Ifthelabeliswiderthanthat,theadditionalmaterialextendstotheright.Whenmakinganinstanceofalistyoucanoverridethedefaultlabelingbygiving\itemanoptionalargumentbyincludingsquarebracesandthetext,asintheabove\item[Speciallabel.];see Section8.16.1[\item],page61 .Themandatorysecondargumentspacinghasalistofcommands.Thislistcanbeempty.Acommandthatcangoinhereis\usecounter{countername}(see Section13.2[\usecounter],page117 ).UsethistotellLATEXtonumbertheitemsusingthegivencounter.ThecounterwillberesettozeroeachtimeLATEXenterstheenvironment,andthecounterisincrementedbyoneeachtimeLATEXencountersan\itemthatdoesnothaveanoptionalargument. Chapter8:Environments58 Anothercommandthatcangoinspacingis\makelabel,whichconstructsthela-belbox.Bydefaultitputsthecontents ushright.Itsonlyargumentisthelabel,whichittypesetsinLRmode(see Chapter17[Modes],page151 ).Oneexampleofchangingitsde nitionisthattotheabovenamedexample,beforethede nitionoftheenvironmentadd\newcommand{\namedmakelabel}[1]{\textsc{#1}},andbetweenthe\setlengthcommandandtheparenthesisthatclosesthespacingargumentalsoadd\let\makelabel\namedmakelabel.Thentheitemswillbetypesetinsmallcaps.Sim-ilarly,changingthesecondcodelineto\let\makelabel\fboxputsthelabelsinsideaframedbox.Anotherexampleofthe\makelabelcommandisbelow,inthede nitionoftheredlabelenvironment.Alsoofteninspacingarecommandstorede nethespacingforthelist.Belowarethespacingparameterswiththeirdefaultvalues.(Defaultvaluesforderivedenvironmentssuchasitemizecanbedi erentthanthevaluesshownhere.)Seealsothe gurethatfollowsthelist.Eachisalength(see Chapter14[Lengths],page120 ).Theverticalspacesarenormallyrubberlengths,withplusandminuscomponents,togiveTEX exibilityinsettingthepage.Changeeachwithacommandsuchas\setlength{itemsep}{2ptplus1ptminus1pt}.Forsomee ectstheselengthsshouldbezeroornegative.\itemindentExtrahorizontalspaceindentation,beyondleftmargin,ofthe rstlineeachitem.Itsdefaultvalueis0pt.\itemsepVerticalspacebetweenitems,beyondthe\parsep.Thedefaultsforthe rstthreelevelsinLATEX's`article',`book',and`report'classesat10pointsizeare:4ptplus2ptminus1pt,\parsep(thatis,2ptplus1ptminus1pt),and\topsep(thatis,2ptplus1ptminus1pt).Thedefaultsat11pointare:4.5ptplus2ptminus1pt,\parsep(thatis,2ptplus1ptminus1pt),andtopsep(thatis,2ptplus1ptminus1pt).Thedefaultsat12pointare:5ptplus2.5ptminus1pt,\parsep(thatis,2.5ptplus1ptminus1pt),and\topsep(thatis,2.5ptplus1ptminus1pt).\labelsepHorizontalspacebetweenthelabelandtextofanitem.ThedefaultforLATEX's`article',`book',and`report'classesis0.5em.\labelwidthHorizontalwidth.Theboxcontainingthelabelisnominallythiswide.If\makelabelreturnstextthatiswiderthanthisthenthe rstlineoftheitemwillbeindentedtomakeroomforthisextramaterial.If\makelabelreturnstextofwidthlessthanorequalto\labelwidththenLATEX'sdefaultisthatthelabelistypeset ushrightinaboxofthiswidth.Theleftedgeofthelabelboxis\leftmargin+\itemindent-\labelsep-\labelwidthfromtheleftmarginoftheenclosingenvironment.ThedefaultforLATEX's`article',`book',and`report'classesatthetoplevelis\leftmargini-\labelsep,(whichis2eminonecolumnmodeand1.5emintwocolumnmode).Atthesecondlevelitis\leftmarginii-\labelsep,andatthethirdlevelitis\leftmarginiii-\labelsep.Thesede nitionsmakethelabel'sleftedgecoincidewiththeleftmarginoftheenclosingenvironment. Chapter8:Environments59 \leftmarginHorizontalspacebetweentheleftmarginoftheenclosingenvironment(ortheleftmarginofthepageifthisisatop-levellist),andtheleftmarginofthislist.Itmustbenon-negative.InthestandardLATEXdocumentclasses,atop-levellisthasthissettothevalueof\leftmargini,whilealistthatisnestedinsideatop-levellisthasthismarginsetto\leftmarginii.Moredeeplynestedlistsgetthevaluesof\leftmarginiiithrough\leftmarginvi.(Nestinggreaterthanlevel vegeneratestheerrormessage`Toodeeplynested'.)Thedefaultsforthe rstthreelevelsinLATEX's`article',`book',and`report'classesare:\leftmarginiis2.5em(intwocolumnmode,2em),\leftmarginiiis2.2em,and\leftmarginiiiis1.87em.\listparindentHorizontalspaceofadditionallineindentation,beyond\leftmargin,forsecondandsubsequentparagraphswithinalistitem.Anegativevaluemakesthisan\outdent".Itsdefaultvalueis0pt.\parsepVerticalspacebetweenparagraphswithinanitem.Inthe`book'and`article'classesThedefaultsforthe rstthreelevelsinLATEX's`article',`book',and`report'classesat10pointsizeare:4ptplus2ptminus1pt,2ptplus1ptminus1pt,and0pt.Thedefaultsat11pointsizeare:4.5ptplus2ptminus1pt,2ptplus1ptminus1pt,and0pt.Thedefaultsat12pointsizeare:5ptplus2.5ptminus1pt,2.5ptplus1ptminus1pt,and0pt.\partopsepVerticalspaceadded,beyond\topsep+\parskip,tothetopandbottomoftheentireenvironmentifthelistinstanceisprecededbyablankline.(AblanklineintheLATEXsourcebeforethelistchangesspacingatboththetopandbottomofthelist;whetherthelinefollowingthelistisblankdoesnotmatter.)Thedefaultsforthe rstthreelevelsinLATEX's`article',`book',and`report'classesat10pointsizeare:2ptplus1minus1pt,2ptplus1ptminus1pt,and1ptplus0ptminus1pt.Thedefaultsat11pointare:3ptplus1ptminus1pt,3ptplus1ptminus1pt,and1ptplus0ptminus1pt).Thedefaultsat12pointare:3ptplus2ptminus3pt,3ptplus2ptminus2pt,and1ptplus0ptminus1pt.\rightmarginHorizontalspacebetweentherightmarginofthelistandtherightmarginoftheenclosingenvironment.Itsdefaultvalueis0pt.Itmustbenon-negative.\topsepVerticalspaceaddedtoboththetopandbottomofthelist,inadditionto\parskip(see Section15.3[\parindent&\parskip],page127 ).Thedefaultsforthe rstthreelevelsinLATEX's`article',`book',and`report'classesat10pointsizeare:8ptplus2ptminus4pt,4ptplus2ptminus1pt,and2ptplus1ptminus1pt.Thedefaultsat11pointare:9ptplus3ptminus5pt,4.5ptplus2ptminus1pt,and2ptplus1ptminus1pt.Thedefaultsat12pointare:10ptplus4ptminus6pt,5ptplus2.5ptminus1pt,and2.5ptplus1ptminus1pt. Chapter8:Environments60 Thisshowsthehorizontalandverticaldistances. Thelengthsshownarelistedbelow.Thekeyrelationshipisthattherightedgeofthebracketforh1equalstherightedgeofthebracketforh4,sothattheleftedgeofthelabelboxisath3+h4-(h0+h1).v0\topsep+\parskipifthelistenvironmentdoesnotstartanewparagraph,and\topsep+\parskip+\partopsepifitdoesv1\parsepv2\itemsep+\parsepv3Sameasv0.(Thisspaceisa ectedbywhetherablanklineappearsinthesourceabovetheenvironment;whetherablanklineappearsinthesourcebelowtheenvironmentdoesnotmatter.)h0\labelwidthh1\labelseph2\listparindenth3\leftmarginh4\itemindenth5\rightmarginThelist'sleftandrightmargins,shownaboveash3andh5,arewithrespecttotheonesprovidedbythesurroundingenvironment,orwithrespecttothepagemarginsforatop-levellist.Thelinewidthusedfortypesettingthelistitemsis\linewidth(see Section5.5[Pagelayoutparameters],page24 ).Forinstance,setthelist'sleftmargintobeonequarterofthedistancebetweentheleftandrightmarginsoftheenclosingenvironmentwith\setlength{\leftmargin}{0.25\linewidth}.Pagebreakinginaliststructureiscontrolledbythethreeparametersbelow.Foreach,theLATEXdefaultis-\@lowpenalty,thatis,-51.Becauseitisnegative,itsomewhat Chapter8:Environments61 encouragesapagebreakateachspot.Changeitwith,e.g.,\@beginparpenalty=9999;avalueof10000prohibitsapagebreak.\@beginparpenaltyThepagebreakingpenaltyforbreakingbeforethelist(default-51).\@itempenaltyThepagebreakingpenaltyforbreakingbeforealistitem(default-51).\@endparpenaltyThepagebreakingpenaltyforbreakingafteralist(default-51).Thepackageenumitemisusefulforcustomizinglists.Thisexamplehasthelabelsinred.Theyarenumbered,andtheleftedgeofthelabellinesupwiththeleftedgeoftheitemtext.See Section13.2[\usecounter],page117 .\usepackage{color}\newcounter{cnt}\newcommand{\makeredlabel}[1]{\textcolor{red}{#1.}}\newenvironment{redlabel}{\begin{list}{\arabic{cnt}}{\usecounter{cnt}\setlength{\labelwidth}{0em}\setlength{\labelsep}{0.5em}\setlength{\leftmargin}{1.5em}\setlength{\itemindent}{0.5em}%equals\labelwidth+\labelsep\let\makelabel=\makeredlabel}}{\end{list}}8.16.1\item:AnentryinalistSynopsis:\itemtextofitemor\item[optional-label]textofitemAnentryinalist.Theentriesarepre xedbyalabel,whosedefaultdependsonthelisttype.Becausetheoptionallabelissurroundedbysquarebrackets`[...]',ifyouhaveanitemwhosetextstartswith`[',youhavetohidethebracketinsidecurlybraces,asin:\item{[}isanopensquarebracket;otherwise,LATEXwillthinkitmarksthestartofanoptionallabel.Similarly,iftheitemdoeshavetheoptionallabelandyouneedaclosesquarebracketinsidethatlabel,youmusthideitinthesameway:\item[Closesquarebracket,{]}].See Section2.4[LATEXcommandsyntax],page5 .Inthisexampletheenumeratelisthastwoitemsthatusethedefaultlabelandonethatusestheoptionallabel.\begin{enumerate} Chapter8:Environments62 \itemMoe\item[sometimes]Shemp\itemLarry\end{enumerate}The rstitemislabelled`1.',theseconditemislabelled`sometimes',andthethirditemislabelled`2.'.Becauseoftheoptionallabelintheseconditem,thethirditemisnotlabelled`3.'.8.16.2trivlist:ArestrictedformoflistSynopsis:\begin{trivlist}...\end{trivlist}Arestrictedversionofthelistenvironment,inwhichmarginsarenotindentedandan\itemwithoutanoptionalargumentproducesnotext.Itismostoftenusedinmacros,tode neanenvironmentwherethe\itemcommandaspartoftheenvironment'sde nition.Forinstance,thecenterenvironmentisde nedessentiallylikethis:\newenvironment{center}{\begin{trivlist}\centering\item\relax}{\end{trivlist}}Usingtrivlistinthiswayallowsthemacrotoinheritsomecommoncode:combin-ingverticalspaceoftwoadjacentenvironments;detectingwhetherthetextfollowingtheenvironmentshouldbeconsideredanewparagraphoracontinuationofthepreviousone;adjustingtheleftandrightmarginsforpossiblenestedlistenvironments.Speci cally,trivlistusesthecurrentvaluesofthelistparameters(see Section8.16[list],page57 ),exceptthat\parsepissettothevalueof\parskip,and\leftmargin,\labelwidth,and\itemindentaresettozero.Thisexampleoutputstheitemsastwoparagraphs,exceptthat(bydefault)theyhavenoparagraphindentandareverticallyseparated.\begin{trivlist}\itemThe\textit{Surprise}isnotold;noonewouldcallherold.\itemShehasabluffbow,lovelylines.\end{trivlist}8.17mathSynopsis:\begin{math}math\end{math}Themathenvironmentinsertsgivenmathmaterialwithintherunningtext.\(...\)and$...$aresynonyms.See Chapter16[Mathformulas],page129 . Chapter8:Environments63 8.18minipageSynopses:\begin{minipage}{width}contents\end{minipage}or\begin{minipage}[position][height][inner-pos]{width}contents\end{minipage}Putcontentsintoaboxthatiswidthwide.Thisislikeasmallversionofapage;itcancontainitsownfootnotes,itemizedlists,etc.(Therearesomerestrictions,includingthatitcannothave oats.)Thisboxwillnotbebrokenacrosspages.Sominipageissimilarto\parbox(see Section20.3[\parbox],page171 )buthereyoucanhaveparagraphs.Thisexamplewillbe3incheswide,andhastwoparagraphs.\begin{minipage}{3in}StephenKleenewasafounderoftheTheoryofComputation.HewasastudentofChurch,wrotethreeinfluentialtexts,wasPresidentoftheAssociationforSymbolicLogic,andwontheNationalMedalofScience.\end{minipage}Seebelowforadiscussionoftheparagraphindentinsideaminipage.Therequiredargumentwidthisarigidlength(see Chapter14[Lengths],page120 ).Itgivesthewidthoftheboxintowhichcontentsaretypeset.Therearethreeoptionalarguments,position,height,andinner-pos.Youneednotincludeallthree.Forexample,getthedefaultpositionandsettheheightwith\begin{minipage}[c][2.54cm]contents\end{minipage}.(Getthenaturalheightwithanemptyargument,[].)Theoptionalargumentpositiongovernshowtheminipageverticallyalignswiththesurroundingmaterial.c(synonymm)Default.Positionstheminipagesoitsverticalcenterlinesupwiththecenteroftheadjacenttextline(whatPlainTEXcalls\vcenter).tMatchthetoplineintheminipagewiththebaselineofthesurroundingtext(PlainTEX's\vtop.bMatchthebottomlineintheminipagewiththebaselineofthesurroundingtext(PlainTEX's\vbox.Toseethee ectsofthese,contrastrunningthis---\begin{minipage}[c]{0.25in}first\\second\\third\end{minipage}withtheresultsofchangingctobort. Chapter8:Environments64 Theoptionalargumentheightisarigidlength(see Chapter14[Lengths],page120 ).Itsetstheheightoftheminipage.Youcanenteranyvaluelargerthan,orequalto,orsmallerthantheminipage'snaturalheightandLATEXwillnotgiveanerrororwarning.Youcanalsosetittoaheightofzerooranegativevalue.The naloptionalargumentinner-poscontrolstheplacementofcontentinsidethebox.Thesearethepossiblevaluesare(thedefaultisthevalueofposition).tPlacecontentatthetopofthebox.cPlaceitintheverticalcenter.bPlaceitattheboxbottom.sStretchcontentsoutvertically;itmustcontainverticallystretchablespace.Theinner-posargumentmakessensewhentheheightoptionissettoavaluelargerthantheminipage'snaturalheight.Toseethee ectoftheoptions,runthisexamplewiththevariouschoicesinplaceofb.Textbefore\begin{center}---\begin{minipage}[c][3in][b]{0.25\textwidth}first\\second\\third\end{minipage}\end{center}TextafterBydefaultparagraphsarenotindentedinaminipage.Changethatwithacommandsuchas\setlength{\parindent}{1pc}atthestartofcontents.Footnotesinaminipageenvironmentarehandledinawaythatisparticularlyusefulforputtingfootnotesin guresortables.A\footnoteor\footnotetextcommandputsthefootnoteatthebottomoftheminipageinsteadofatthebottomofthepage,anditusesthe\mpfootnotecounterinsteadoftheordinaryfootnotecounter(see Chapter13[Counters],page116 ).Thisputsthefootnoteatthebottomofthetable,notthebottomofthepage.\begin{center}%centertheminipageontheline\begin{minipage}{2.5in}\begin{center}%centerthetableinsidetheminipage\begin{tabular}{ll}\textsc{Monarch}&\textsc{Reign}\\\hlineElizabethII&63years\footnote{todate}\\Victoria&63years\\GeorgeIII&59years\end{tabular}\end{center}\end{minipage}\end{center}Ifyounestminipagesthenthereisanoddnesswhenusingfootnotes.Footnotesappearatthebottomofthetextendedbythenext\end{minipage}whichmaynotbetheirlogicalplace. Chapter8:Environments65 Thisputsatablecontainingdatasidebysidewithamapgraphic.Theyareverticallycentered.\newcommand*{\vcenteredhbox}[1]{\begin{tabular}{@{}c@{}}#1\end{tabular}}...\begin{center}\vcenteredhbox{\includegraphics[width=0.3\textwidth]{nyc.png}}\hspace{0.1\textwidth}\begin{minipage}{0.5\textwidth}\begin{tabular}{r|l}\multicolumn{1}{r}{Borough}&Pop(million)\\\hlineTheBronx&$1.5$\\Brooklyn&$2.6$\\Manhattan&$1.6$\\Queens&$2.3$\\StatenIsland&$0.5$\end{tabular}\end{minipage}\end{center}8.19pictureSynopses:\begin{picture}(width,height)picturecommands\end{picture}or\begin{picture}(width,height)(xoffset,yoffset)picturecommands\end{picture}Anenvironmenttocreatesimplepicturescontaininglines,arrows,boxes,circles,andtext.Notethatwhilethisenvironmentisnotobsolete,newdocumentstypicallyusemuchmorepowerfulgraphicscreationsystems,suchasTikZ,PSTricks,MetaPost,orAsymptote.Thesearenotcoveredinthisdocument;seeCTAN.Thisshowstheparallelogramlawforaddingvectors.\setlength{\unitlength}{1cm}\begin{picture}(6,6)%pictureboxwillbe6cmwideby6cmtall\put(0,0){\vector(2,1){4}}%forevery2overthisvectorgoes1up\put(2,1){\makebox(0,0)[l]{\firstleg}}\put(4,2){\vector(1,2){2}}\put(5,4){\makebox(0,0)[l]{\secondleg}}\put(0,0){\line(1,1){6}}\put(3,3){\makebox(0,0)[r]{sum\}}\end{picture}Youcanalsousethisenvironmenttoplacearbitrarymaterialatanexactlocation.\usepackage{color,graphicx}%inpreamble Chapter8:Environments66 ...\begin{center}\setlength{\unitlength}{\textwidth}\begin{picture}(1,1)%leavespace,\textwidthwideandtall\put(0,0){\includegraphics[width=\textwidth]{desertedisland.jpg}}\put(0.25,0.35){\textcolor{red}{XTreasurehere}}\end{picture}\end{center}TheredXwillbepreciselyaquarterofthe\linewidthfromtheleftmargin,and0.35\linewidthupfromthebottom.Anotherexampleofthisusageistoputsimilarcodeinthepageheadertogetrepeatmaterialoneachofadocument'spages.Thepictureenvironmenthasonerequiredargument,apairofnumbers(width,height).Multiplythesebythevalue\unitlengthtogetthenominalsizeoftheoutput,thespacethatLATEXreservesontheoutputpage.Thisnominalsizeneednotbehowlargethepicturereallyis;LATEXwilldrawthingsfromthepictureoutsidethepicture'sbox.Thisenvironmentalsohasanoptionalargument(xo set,yo set).Itisusedtoshifttheorigin.Unlikemostoptionalarguments,thisoneisnotcontainedinsquarebrackets.Aswiththerequiredargument,itconsistsoftworealnumbers.Multiplytheseby\unitlengthtogetthepointatthelower-leftcornerofthepicture.Forexample,if\unitlengthhasbeensetto1mm,thecommand\begin{picture}(100,200)(10,20)producesaboxofwidth100millimetersandheight200millimeters.Thepicture'soriginisthepoint(10mm,20mm)andsothelower-leftcorneristhere,andtheupper-rightcornerisat(110mm,220mm).Whenyou rstdrawapictureyoutypicallyomittheoptionalargument,leavingtheoriginatthelower-leftcorner.Ifyouthenwanttomodifyyourpicturebyshiftingeverything,youcanjustaddtheappropriateoptionalargument.EachpicturecommandtellsLATEXwheretoputsomethingbynamingitsposition.Apositionisapairsuchas(2.4,-5)givingthex-andy-coordinates.Acoordinateisanotalength,itisarealnumber(itmayhaveadecimalpointoraminussign).Itspeci esalengthinmultiplesoftheunitlength\unitlength,soif\unitlengthhasbeensetto1cm,thenthecoordinate2.54speci esalengthof2.54centimeters.LATEX'sdefaultfor\unitlengthis1pt.itisarigidlength(see Chapter14[Lengths],page120 ).Changeitwiththe\setlengthcommand(see Section14.2[\setlength],page122 ).Makethischangeonlyoutsideofapictureenvironment.Coordinatesaregivenwithrespecttoanorigin,whichisnormallyatthelower-leftcornerofthepicture.Notethatwhenapositionappearsasanargument,aswith\put(1,2){...},itisnotenclosedinbracessincetheparenthesesservetodelimittheargument.Also,unlikeinsomecomputergraphicssystems,largery-coordinatesarefurtherupthepage.Therearefourwaystoputthingsinapicture:\put,\multiput,\qbezier,and\graphpaper.Themostoftenusedis\put.This\put(11.3,-0.3){...}placestheobjectwithitsreferencepointatcoordinates(11:3;�0:3).Thereferencepointsforvariousobjectswillbedescribedbelow.The\putcommandcreatesanLRbox(see Chapter17[Modes],page151 ).Anythingthatcangoinan\mbox(see Section20.1[\mbox Chapter8:Environments67 &\makebox],page169 )cangointhetextargumentofthe\putcommand.Thereferencepointwillbethelowerleftcornerofthebox.Inthispicture\setlength{\unitlength}{1cm}...\begin{picture}(1,1)\put(0,0){\line(1,0){1}}\put(0,0){\line(1,1){1}}\end{picture}thethreedotsarejustslightlyleftofthepointoftheangleformedbythetwolines.(Also,\line(1,1){1}doesnotcallforalineoflengthone;ratherthelinehasachangeinthexcoordinateof1.)The\multiput,qbezier,andgraphpapercommandsaredescribedbelow.Thisdrawsarectanglewithawavytop,using\qbezierforthatcurve.\begin{picture}(3,1.5)\put(0,0){\vector(1,0){8}}%xaxis\put(0,0){\vector(0,1){4}}%yaxis\put(2,0){\line(0,1){3}}%leftsiderectangle\put(4,0){\line(0,1){3.5}}%rightside\qbezier(2,3)(2.5,2.9)(3,3.25)\qbezier(3,3.25)(3.5,3.6)(4,3.5)\thicklines%belowhere,linesaretwiceasthick\put(2,3){\line(4,1){2}}\put(4.5,2.5){\framebox{TrapezoidalRule}}\end{picture}8.19.1\putSynopsis:\put(xcoord,ycoord){content}Placecontentatthecoordinate(xcoord,ycoord).Seethediscussionofcoordinatesand\unitlengthin Section8.19[picture],page65 .ThecontentisprocessedinLRmode(see Chapter17[Modes],page151 )soitcannotcontainlinebreaks.Thisincludesthetextintothepicture.\put(4.5,2.5){Applythe\textit{unpoke}move}Thereferencepoint,thelocation(4.5,2.5),isthelowerleftofthetext,atthebottomleftofthe`A'.8.19.2\multiputSynopsis:\multiput(x,y)(delta_x,delta_y){num-copies}{obj}Copyobjatotalofnum-copiestimes,withanincrementofdelta x,delta y.Theobj rstappearsatposition(x;y),thenat(x+x;y+y),andsoon.Thisdrawsasimplegridwithevery fthlineinbold(seealso Section8.19.4[\graphpa-per],page68 ).\begin{picture}(10,10) Chapter8:Environments68 \linethickness{0.05mm}\multiput(0,0)(1,0){10}{\line(0,1){10}}\multiput(0,0)(0,1){10}{\line(1,0){10}}\linethickness{0.5mm}\multiput(0,0)(5,0){3}{\line(0,1){10}}\multiput(0,0)(0,5){3}{\line(1,0){10}}\end{picture}8.19.3\qbezierSynopsis:\qbezier(x1,y1)(x2,y2)(x3,y3)\qbezier[num](x1,y1)(x2,y2)(x3,y3)DrawaquadraticBeziercurvewhosecontrolpointsaregivenbythethreerequiredarguments(x1,y1),(x2,y2),and(x3,y3).Thatis,thecurverunsfrom(x1,y1)to(x3,y3),isquadratic,andissuchthatthetangentlineat(x1,y1)passesthrough(x2,y2),asdoesthetangentlineat(x3,y3).Thisdrawsacurvefromthecoordinate(1,1)to(1,0).\qbezier(1,1)(1.25,0.75)(1,0)Thecurve'stangentlineat(1,1)contains(1.25,0.75),asdoesthecurve'stangentlineat(1,0).Theoptionalargumentnumgivesthenumberofcalculatedintermediatepoints.Thedefaultistodrawasmoothcurvewhosemaximumnumberofpointsis\qbeziermax(changethisvaluewith\renewcommand).8.19.4\graphpaperSynopsis:\graphpaper(x_init,y_init)(x_dimen,y_dimen)\graphpaper[spacing](x_init,y_init)(x_dimen,y_dimen)Drawacoordinategrid.Requiresthegraphpappackage.Thegrid'soriginis(x_init,y_init).Gridlinescomeeveryspacingunits(thedefaultis10).Thegridextendsx dimenunitstotherightandy dimenunitsup.Allargumentsmustbepositiveintegers.Thismakeagridwithsevenverticallinesandelevenhorizontallines.\usepackage{graphpap}%inpreamble...\begin{picture}(6,20)%indocumentbody\graphpaper[2](0,0)(12,20)\end{picture}Thelinesarenumberedeverytenunits.8.19.5\lineSynopsis:\line(x_run,y_rise){travel}Drawaline.Itslopessuchthatitverticallyrisesy riseforeveryhorizontalx run.Thetravelisthetotalhorizontalchange|itisnotthelengthofthevector,itisthechange Chapter8:Environments69 inx.Inthespecialcaseofverticallines,where(x run,y rise)=(0,1),thetravelgivesthechangeiny.Thisdrawsalinestartingatcoordinates(1,3).\put(1,3){\line(2,5){4}}Foreveryover2,thislinewillgoup5.Becausetravelspeci esthatthisgoesover4,itmustgoup10.Thusitsendpointis(1;3)+(4;10)=(5;13).Inparticular,notethattravel=4isnotthelengthoftheline,itisthechangeinx.Theargumentsx runandy riseareintegersthatcanbepositive,negative,orzero.(Ifbothare0thenLATEXtreatsthesecondas1.)With\put(x_init,y_init){\line(x_run,y_rise){travel}},ifx runisnegativethentheline'sendingpointhasa rstcoordi-natethatislessthanx init.Ify riseisnegativethentheline'sendingpointhasasecondcoordinatethatislessthany init.IftravelisnegativethenyougetLaTeXError:Bad\lineor\vectorargument.StandardLATEXcanonlydrawlineswithalimitedrangeofslopesbecausetheselinesaremadebyputtingtogetherlinesegmentsfrompre-madefonts.Thetwonumbersx runandy risemusthaveintegervaluesfrom�6through6.Also,theymustberelativelyprime,sothat(x run,y rise)canbe(2,1)butnot(4,2)(ifyouchoosethelattertheninsteadoflinesyougetsequencesofarrowheads;thesolutionistoswitchtotheformer).Togetlinesofarbitraryslopeandplentyofothershapesinasystemlikepicture,seethepackagepict2eonCTAN.Anothersolutionistouseafull-featuredgraphicssystemsuchasTikZ,orPSTricks,orMetaPost,orAsymptote8.19.6\linethicknessSynopsis:\linethickness{dim}Declaresthethicknessofsubsequenthorizontalandverticallinesinapicturetobedim,whichmustbeapositivelength(see Chapter14[Lengths],page120 ).Itdi ersfrom\thinlinesand\thicklinesinthatitdoesnota ectthethicknessofslantedlines,circles,orovals.8.19.7\thinlinesDeclarationtosetthethicknessofsubsequentlines,circles,andovalsinapictureenviron-menttobe0.4pt.Thisisthedefaultthickness,sothiscommandisunnecessaryunlessthethicknesshasbeenchangedwitheither Section8.19.6[\linethickness],page69, or Section8.19.8[\thicklines],page69 .8.19.8\thicklinesDeclarationtosetthethicknessofsubsequentlines,circles,andovalsinapictureenvi-ronmenttobe0.8pt.Seealso Section8.19.6[\linethickness],page69, and Section8.19.7[\thinlines],page69 .ThiscommandisillustratedintheTrapezoidalRuleexampleof Section8.19[picture],page65 .8.19.9\circleSynopsis:\circle{diameter} Chapter8:Environments70 \circle*{diameter}Producesacirclewithadiameterascloseaspossibletothespeci edone.The*formproducesa lled-incircle.Thisdrawsacircleofradius6,centeredat(5,7).\put(5,7){\circle{6}}Theavailableradiiforcircleare,inpoints,theevennumbersfrom2to20,inclusive.Forcircle*theyarealltheintegersfrom1to15.8.19.10\ovalSynopsis:\oval(width,height)\oval(width,height)[portion]Producearectanglewithroundedcorners.Theoptionalargumentportionallowsyoutoproduceonlyhalforaquarteroftheoval.Forhalfanovaltakeportiontobeoneofthese.ttophalfbbottomhalfrrighthalfllefthalfProduceonlyonequarteroftheovalbysettingportiontotr,br,bl,ortl.Thisdrawsthetophalfofanovalthatis3wideand7tall.\put(5,7){\oval(3,7)[t]}The(5,7)isthecenteroftheentireoval,notjustthecenterofthetophalf.Theseshapesarenotellipses.Theyarerectangleswhosecornersaremadewithquartercircles.Thesecircleshaveamaximumradiusof20pt(see Section8.19.9[\circle],page69, forthesizes).Thuslargeovalsarejustboxeswithasmallamountofcornerrounding.8.19.11\shortstackSynopsis:\shortstack[position]{line1\\...}Produceaverticalstackofobjects.Thislabelstheyaxis.\put(0,0){\vector(1,0){4}}%xaxis\put(0,0){\vector(0,1){2}}%y\put(-0.25,2){\makebox[0][r]{\shortstack[r]{$y$\\axis}}}Forashortstack,thereferencepointisthelowerleftofthestack.Intheaboveexamplethe Section20.1[\mbox&\makebox],page169, putsthestack ushrightinazerowidthboxsointotaltheshortstacksitsslightlytotheleftoftheyaxis.Thevalidpositionsare:rMakeobjects ushrightlMakeobjects ushleft Chapter8:Environments71 cCenterobjects(default)Separateobjectsintolineswith\\.Thesestacksareshortinthat,unlikeinatabularorarrayenvironment,heretherowsarenotspacedouttobeofevenheights.Thus,in\shortstack{X\\o\\o\\X}the rstandlastrowsaretallerthanthemiddletwo.Youcanadjustrowheightseitherbyputtingintheusualinterlinespacingwith\shortstack{X\\\struto\\o\\X},orbyhand,viaanexplicitzero-widthbox\shortstack{X\\\rule{0pt}{12pt}o\\o\\X}orbyusing\\'soptionalargument\shortstack{X\\[2pt]o\\o\\X}.The\shortstackcommandisalsoavailableoutsidethepictureenvironment.8.19.12\vectorSynopsis:\vector(x_run,y_rise){travel}Drawalineendinginanarrow.Theslopeofthatlineis:itverticallyrisesy riseforeveryhorizontalx run.Thetravelisthetotalhorizontalchange|itisnotthelengthofthevector,itisthechangeinx.Inthespecialcaseofverticalvectors,if(x run,y rise)=(0,1),thentravelgivesthechangeiny.Foranexamplesee Section8.19[picture],page65 .Forelaborationonx runandy risesee Section8.19.5[\line],page68 .Asthere,thevaluesofx runandy risearelimited.For\vectoryoumustchoosesintegersbetween�4and4,inclusive.Also,thetwoyouchoosemustberelativelyprime.Thus,\vector(2,1){4}isacceptablebut\vector(4,2){4}isnot(ifyouusethelatterthenyougetasequenceofarrowheads).8.19.13\makebox(picture)Synopsis:\makebox(rec-width,rec-height){text}\makebox(rec-width,rec-height)[position]{text}Makeaboxtoholdtext.Thiscommand tswiththepictureenvironment,althoughyoucanuseitoutsideofthere,becauserec-widthandrec-heightarenumbersspecifyingdistancesintermsofthe\unitlength(see Section8.19[picture],page65 ).Thiscommandissimilartothenormal\makeboxcommand(see Section20.1[\mbox&\makebox],page169 )exceptherethatyoumustspecifythewidthandheight.Thiscommandisfragile(see Section12.11[\protect],page113 ).Thismakesaboxoflength3.5times\unitlengthandheight4times\unitlength.\put(1,2){\makebox(3.5,4){...}}Theoptionalargumentpositionspeci eswhereintheboxthetextappears.Thedefaultistocenterit,bothhorizontallyandvertically.Toplaceitsomewhereelse,useastringwithoneortwooftheseletters.tPutstextthetopofthebox.bPuttextatthebottom.lPuttextontheleft.rPuttextontheright. Chapter8:Environments72 8.19.14\framebox(picture)Synopsis:\framebox(rec-width,rec-height){text}\framebox(rec-width,rec-height)[position]{text}Thisisthesameas Section8.19.13[\makebox(picture)],page71, exceptthatitputsaframearoundtheoutsideoftheboxthatitcreates.Thereferencepointisthebottomleftcorneroftheframe.Thiscommand tswiththepictureenvironment,althoughyoucanuseitoutsideofthere,becauselengthsarenumbersspecifyingthedistanceintermsofthe\unitlength(see Section8.19[picture],page65 ).Thiscommandisfragile(see Section12.11[\protect],page113 ).Thisexamplecreatesaframe2.5inchesby3inchesandputsthetextinthecenter.\setlength{\unitlength}{1in}\framebox(2.5,3){testtext}Therequiredargumentsarethattherectanglehasoverallwidthrect-widthunitsandheightrect-heightunits.Theoptionalargumentpositionspeci esthepositionoftext;see Section8.19.13[\make-box(picture)],page71, forthevaluesthatitcantake.Therulehasthickness\fboxruleandthereisablankspace\fboxsepbetweentheframeandthecontentsofthebox.Forthiscommand,youmustspecifythewidthandheight.Ifyouwanttojustputaframearoundsomecontentswhosedimensionisdeterminedinsomeotherwaytheneitheruse\fbox(see Section20.2[\fbox&\framebox],page170 )or\frame(see Section8.19.15[\frame],page72 ).8.19.15\frameSynopsis:\frame{contents}Putsarectangularframearoundcontents.Thereferencepointisthebottomleftcorneroftheframe.Incontrastto\framebox(see Section8.19.14[\framebox(picture)],page72 ),thiscommandputsnoextraspaceisputbetweentheframeandtheobject.Itisfragile(see Section12.11[\protect],page113 ).8.19.16\dashboxSynopsis:\dashbox{dash-len}(rect-width,rect-height){text}\dashbox{dash-len}(rect-width,rect-height)[position]{text}Createadashedrectanglearoundtext.Thiscommand tswiththepictureenviron-ment,althoughyoucanuseitoutsideofthere,becauselengthsarenumbersspecifyingthedistanceintermsofthe\unitlength(see Section8.19[picture],page65 ).Therequiredargumentsare:dashesaredash-lenunitslong,withthesamelengthgap,andtherectanglehasoverallwidthrect-widthunitsandheightrect-heightunits.Theoptionalargumentpositionspeci esthepositionoftext;see Section8.19.13[\make-box(picture)],page71, forthevaluesthatitcantake. Chapter8:Environments73 Thisshowsthatyoucanusenon-integervaluefordash-len.\put(0,0){\dashbox{0.1}(5,0.5){Myhovercraftisfullofeels.}}Eachdashwillbe0.1\unitlengthlong,thebox'swidthis5\unitlengthanditsheightis0.5\unitlength.Asinthatexample,adashedboxlooksbestwhenrect-widthandrect-heightaremul-tiplesofthedash-len.8.20quotation"eSynopsis:\begin{quotation}text\end{quotation}or\begin{quote}text\end{quote}Includeaquotation.Bothenvironmentsindentmarginsonbothsidesby\leftmarginandthetextisright-justi ed.Theydi erinhowtheytreatparagraphs.Inthequotationenvironment,paragraphsareindentedby1.5emandthespacebetweenparagraphsissmall,0ptplus1pt.Inthequoteenvironment,paragraphsarenotindentedandthereisverticalspacebetweenparagraphs(itistherubberlength\parsep).\begin{quotation}\small\itFourscoreandsevenyearsago...shallnotperishfromtheearth.\hspace{1emplus1fill}---AbrahamLincoln\end{quotation}8.21tabbingSynopsis:\begin{tabbing}row1col1\=row1col2...\\row2col1�\row2col2...\\...\end{tabbing}Aligntextincolumns,bysettingtabstopsandtabbingtothemmuchaswasdoneonatypewriter.Thisislessoftenusedthantheenvironmentstabular(see Section8.23[tabular],page77 )orarray(see Section8.2[array],page45 )becauseinthosethewidthofeachcolumnneednotbeconstantandneednotbeknowninadvance.Thisexamplehasa rstlinewherethetabstopsaresettoexplicitwidths,endedbya\killcommand(whichisdescribedbelow):\begin{tabbing}\hspace{0.75in}\=\hspace{0.40in}\=\hspace{0.40in}\kill Chapter8:Environments74 Ship�\Guns�\Year\\\textit{Sophie}�\14�\1800\\\textit{Polychrest}�\24�\1803\\\textit{Lively}�\38�\1804\\\textit{Surprise}�\28�\1805\\\end{tabbing}Boththetabbingenvironmentandthemorewidely-usedtabularenvironmentputtextincolumns.ThemostimportantdistinctionisthatintabularthewidthofcolumnsisdeterminedautomaticallybyLATEX,whileintabbingtheusersetsthetabstops.Anotherdistinctionisthattabulargeneratesabox,buttabbingcanbebrokenacrosspages.Finally,whiletabularcanbeusedinanymode,tabbingcanbeusedonlyinparagraphmodeanditstartsanewparagraph.Atabbingenvironmentalwaysstartsanewparagraph,withoutindentation.Moreover,asshownintheexampleabove,thereisnoneedtousethestarredformofthe\hspacecommandatthebeginningofatabbedrow.Therightmarginofthetabbingenvironmentistheendofline,sothatthewidthoftheenvironmentis\linewidth.Thetabbingenvironmentcontainsasequenceoftabbedrows.The rsttabbedrowbeginsimmediatelyafter\begin{tabbing}andeachrowendswith\\or\kill.Thelastrowmayomitthe\\andendwithjust\end{tabbing}.Atanypointthetabbingenvironmenthasacurrenttabstoppattern,asequenceofn�0tabstops,numbered0,1,etc.Thesecreatencorrespondingcolumns.Tabstop0isalwaystheleftmargin,de nedbytheenclosingenvironment.Tabstopnumberiissetifitisassignedahorizontalpositiononthepage.Tabstopnumbericanonlybesetifallthestops0,...,i�1havealreadybeenset;normallylaterstopsaretotherightofearlierones.Bydefaultanytexttypesetinatabbingenvironmentistypesetraggedrightandleft-alignedonthecurrenttabstop.TypesettingisdoneinLRmode(see Chapter17[Modes],page151 ).Thefollowingcommandscanbeusedinsideatabbingenvironment.Theyareallfragile(see Section12.11[\protect],page113 ).\\(tabbing)Endatabbedlineandtypesetit.\=(tabbing)Setsatabstopatthecurrentposition.�\(tabbing)Advancestothenexttabstop.\Putfollowingtexttotheleftofthelocalmargin(withoutchangingthemargin).Canonlybeusedatthestartoftheline.\+Movestheleftmarginofthenextandallthefollowingcommandsonetabstoptotheright,beginningtabbedlineifnecessary.\-Movestheleftmarginofthenextandallthefollowingcommandsonetabstoptotheleft,beginningtabbedlineifnecessary. Chapter8:Environments75 \'(tabbing)Moveseverythingthatyouhavetypedsofarinthecurrentcolumn,i.e.,every-thingfromthemostrecent�\,\,\',\\,or\killcommand,tothepreviouscolumnandalignedtotheright, ushagainstthecurrentcolumn'stabstop.\`(tabbing)Allowsyoutoputtext ushrightagainstanytabstop,includingtabstop0.However,itcan'tmovetexttotherightofthelastcolumnbecausethere'snotabstopthere.The\`commandmovesallthetextthatfollowsit,uptothe\\or\end{tabbing}commandthatendstheline,totherightmarginofthetabbingenvironment.Theremustbeno&#x]TJ/;ཕ ;.9;‘ ;&#xTf 1;.45; 0 ;&#xTd [;\or\'commandbetweenthe\`andthe\\or\end{tabbing}commandthatendstheline.\a(tabbing)Inatabbingenvironment,thecommands\=,\'and\`donotproduceaccentsasusual(see Section23.5[Accents],page194 ).Instead,usethecommands\a=,\a'and\a`.\killSetstabstopswithoutproducingtext.Worksjustlike\\exceptthatitthrowsawaythecurrentlineinsteadofproducingoutputforit.Any\=,\+or\-commandsinthatlineremainine ect.\poptabsRestoresthetabstoppositionssavedbythelast\pushtabs.\pushtabsSavesallcurrenttabstoppositions.Usefulfortemporarilychangingtabstoppositionsinthemiddleofatabbingenvironment.\tabbingsepDistanceofthetextmovedby\'toleftofcurrenttabstop.ThisexampletypesetsaPascalfunction:\begin{tabbing}function\=fact(n:integer):integer;\\�\begin\=\+\\�\if\=n�1then\+\\fact:=n*fact(n-1)\-\\else\+\\fact:=1;\-\-\\end;\\\end{tabbing}Theoutputlookslikethis.functionfact(n:integer):integer;beginifn�1thenfact:=n*fact(n-1);elsefact:=1;end; Chapter8:Environments76 Thisexampleisjustforillustrationoftheenvironment.Toactuallytypesetcomputercodeintypewriterlikethis,averbatimenvironment(see Section8.27[verbatim],page87 )wouldnormallybebest.Forpretty-printedcode,therearequiteafewpackages,includingalgorithm2e,fancyvrb,listings,andminted.8.22tableSynopsis:\begin{table}[placement]tablebody\caption[loftitle]{title}%optional\label{label}%alsooptional\end{table}Aclassof oats(see Section5.6[Floats],page26 ).Theycannotbesplitacrosspagesandsotheyarenottypesetinsequencewiththenormaltextbutinsteadare oatedtoaconvenientplace,suchasthetopofafollowingpage.Thisexampletableenvironmentcontainsatabular\begin{table}\centering\small\begin{tabular}{ll}\multicolumn{1}{c}{\textit{Author}}&\multicolumn{1}{c}{\textit{Piece}}\\\hlineBach&CelloSuiteNumber1\\Beethoven&CelloSonataNumber3\\Brahms&CelloSonataNumber1\end{tabular}\caption{Topcellopieces}\label{tab:cello}\end{table}butyoucanputmanydi erentkindsofcontentinatable,includingtext,LATEXcommands,etc.Forthepossiblevaluesofplacementandtheire ectonthe oatplacementalgorithm,see Section5.6[Floats],page26 .Thetablebodyistypesetinaparboxofwidth\textwidth.Itcancontaintext,com-mands,graphics,etc.Thelabelisoptional;itisusedforcrossreferences(see Chapter7[Crossreferences],page41 ).The\captioncommandisalsooptional.Itspeci escaptiontextforthetable.Bydefaultitisnumbered.Ifitsoptionallottitleispresentthenthattextisusedinthelistoftablesinsteadoftitle(see Section25.1[Tableofcontentsetc.],page202 ).Inthisexamplethetableandcaptionwill oattothebottomofapage,unlessitispushedtoa oatpageattheend.\begin{table}[b]\centering\begin{tabular}{r|p{2in}}\hlineOne&Theloneliestnumber\\ Chapter8:Environments77 Two&Canbeassadasone.It'stheloneliestnumbersincethenumberone.\end{tabular}\caption{Cardinalvirtues}\label{tab:CardinalVirtues}\end{table}8.23tabularSynopsis:\begin{tabular}[pos]{cols}column1entry&column2entry...&columnnentry\\...\end{tabular}or\begin{tabular*}{width}[pos]{cols}column1entry&column2entry...&columnnentry\\...\end{tabular*}Produceatable,aboxconsistingofasequenceofhorizontalrows.Eachrowconsistsofitemsthatarealignedverticallyincolumns.Thisillustratesmanyofthefeatures.\begin{tabular}{l|l}\textit{Playername}&\textit{Careerhomeruns}\\\hlineHankAaron&755\\BabeRuth&714\end{tabular}Theoutputwillhavetwoleft-alignedcolumnswithaverticalbarbetweenthem.Thisisspeci edintabular'sargument{l|l}.Puttheentriesintodi erentcolumnsbyseparatingthemwithanampersand,&.Theendofeachrowismarkedwithadoublebackslash,\\.Putahorizontalrulebelowarow,afteradoublebackslash,with\hline.Afterthelastrowthe\\isoptional,unlessan\hlinecommandfollowstoputarulebelowthetable.Therequiredandoptionalargumentstotabularconsistof:posOptional.Speci esthetable'sverticalposition.Thedefaultistoalignthetablesoitsverticalcentermatchesthebaselineofthesurroundingtext.Therearetwootherpossiblealignments:talignsthetablesoitstoprowmatchesthebaselineofthesurroundingtext,andbalignsonthebottomrow.Thisonlyhasane ectifthereisothertext.Inthecommoncaseofatabularaloneinacenterenvironmentthisoptionmakesnodi erence.colsRequired.Speci estheformattingofcolumns.Itconsistsofasequenceofthefollowingspeci ers,correspondingtothetypesofcolumnandintercolumnmaterial.lAcolumnofleft-aligneditems.rAcolumnofright-aligneditems. Chapter8:Environments78 cAcolumnofcentereditems.|Averticallinethefullheightanddepthoftheenvironment.@{textorspace}Inserttextorspaceatthislocationineveryrow.ThetextorspacematerialistypesetinLRmode.Thistextisfragile(see Section12.11[\protect],page113 ).Ifbetweentwocolumnsthereisno@-expressionthenLATEX'sbook,article,andreportclasseswillputoneithersideofeachcolumnaspaceoflength\tabcolsep,whichbydefaultis6pt.Thatis,bydefaultadjacentcolumnsareseparatedby12pt(so\tabcolsepismisleadinglynamedsinceitisonlyhalfoftheseparationbetweentabularcolumns).Inaddition,aspaceof6ptalsocomesbeforethe rstcolumnandafterthe nalcolumn,unlessyouputa@{...}or|there.Ifyouoverridethedefaultandusean@-expressionthenLATEXdoesnotinsert\tabcolsepsoyoumustinsertanydesiredspaceyourself,asin@{\hspace{1em}}.Anemptyexpression@{}willeliminatethespace.Inparticular,sometimesyouwanttoeliminatethespacebeforethe rstcolumnorafterthelastone,asintheexamplebelowwherethetabularlinesneedtolieontheleftmargin.\begin{flushleft}\begin{tabular}{@{}l}...\end{tabular}\end{flushleft}Thenextexampleshowstext,adecimalpointbetweenthecolumns,arrangedsothenumbersinthetablearealignedonit.\begin{tabular}{r@{$.$}l}$3$&$14$\\$9$&$80665$\end{tabular}An\extracolsep{wd}commandinan@-expressioncausesanextraspaceofwidthwdtoappeartotheleftofallsubsequentcolumns,untilcountermandedbyanother\extracolsep.Unlikeordinaryintercolumnspace,thisextraspaceisnotsuppressedbyan@-expression.An\extracolsepcommandcanbeusedonlyinan@-expressioninthecolsargument.Below,LATEXinsertstherightamountofintercolumnspacetomaketheentiretable4incheswide.\begin{tabular*}{4in}{l@{\extracolsep{\fill}}l}Seventimesdown,eighttimesup\ldots&suchislife!\end{tabular*} Chapter8:Environments79 Toinsertcommandsthatareautomaticallyexecutedbeforeagivencolumn,loadthearraypackageandusethe�{...}speci er.p{wd}Eachiteminthecolumnistypesetinaparboxofwidthwd,asifitweretheargumentofa\parbox[t]{wd}{...}command.Alinebreakdoublebackslash\\maynotappearintheitem,exceptinsideanenvironmentlikeminipage,array,ortabular,orinsideanexplicit\parbox,orinthescopeofa\centering,\raggedright,or\raggedleftdeclaration(whenusedinap-columnelementthesedeclarationsmustappearinsidebraces,aswith{\centering..\\..}).OtherwiseLATEXwillmisinterpretthedoublebackslashasendingtherow.Instead,togetalinebreakinthereuse\newline(see Section9.3[\newline],page92 ).*{num}{cols}Equivalenttonumcopiesofcols,wherenumisapositiveintegerandcolsisalistofspeci ers.Thusthespeci er\begin{tabular}{|*{3}{l|r}|}isequivalenttothespeci er\begin{tabular}{|l|rl|rl|r|}.Notethatcolsmaycontainanother*-expression.widthRequiredfortabular*,notallowedfortabular.Speci esthewidthofthetabular*environment.Thespacebetweencolumnsshouldberubber,aswith@{\extracolsep{\fill}},toallowthetabletostretchorshrinktomakethespeci edwidth,orelseyouarelikelytogettheUnderfull\hbox(badness10000)inalignment...warning.Parametersthatcontrolformatting:\arrayrulewidthAlengththatisthethicknessoftherulecreatedby|,\hline,and\vlineinthetabularandarrayenvironments.Thedefaultis`.4pt'.Changeitasin\setlength{\arrayrulewidth}{0.8pt}.\arraystretchAfactorbywhichthespacingbetweenrowsinthetabularandarrayen-vironmentsismultiplied.Thedefaultis`1',fornoscaling.Changeitas\renewcommand{\arraystretch}{1.2}.\doublerulesepAlengththatisthedistancebetweentheverticalrulesproducedbythe||speci er.Thedefaultis`2pt'.\tabcolsepAlengththatishalfofthespacebetweencolumns.Thedefaultis`6pt'.Changeitwith\setlength.Thefollowingcommandscanbeusedinsidethebodyofatabularenvironment,the rsttwoinsideanentryandthesecondtwobetweenlines: Chapter8:Environments80 8.23.1\multicolumnSynopsis:\multicolumn{numcols}{cols}{text}Makeanarrayortabularentrythatspansseveralcolumns.The rstargumentnumcolsgivesthenumberofcolumnstospan.Thesecondargumentcolsspeci estheformattingoftheentry,withcforcentered,lfor ushleft,orrfor ushright.Thethirdargumenttextgivesthecontentsofthatentry.Inthisexample,inthe rstrow,thesecondandthirdcolumnsarespannedbythesingleheading`Name'.\begin{tabular}{lccl}\textit{ID}&\multicolumn{2}{c}{\textit{Name}}&\textit{Age}\\\hline978-0-393-03701-2&O'Brian&Patrick&55\\...\end{tabular}Whatcountsasacolumnis:thecolumnformatspeci erforthearrayortabularenvironmentisbrokenintoparts,whereeachpart(exceptthe rst)beginswithl,c,r,orp.Sofrom\begin{tabular}{|r|ccp{1.5in}|}thepartsare|r|,c,c,andp{1.5in}|.Thecolsargumentoverridesthearrayortabularenvironment'sintercolumnareade-faultadjoiningthismulticolumnentry.Toa ectthatarea,thisargumentcancontainverticalbars|indicatingtheplacementofverticalrules,and@{...}expressions.Thusifcolsis`|c|'thenthismulticolumnentrywillbecenteredandaverticalrulewillcomeintheintercolumnareabeforeitandafterit.Thistabledetailstheexactbehavior.\begin{tabular}{|cc|c|c|}\multicolumn{1}{r}{w}%entryone&\multicolumn{1}{|r|}{x}%entrytwo&\multicolumn{1}{|r}{y}%entrythree&z%entryfour\end{tabular}Beforethe rstentrytheoutputwillnothaveaverticalrulebecausethe\multicolumnhasthecolsspeci er`r'withnoinitialverticalbar.Betweenentryoneandentrytwotherewillbeaverticalrule;althoughthe rstcolsdoesnothaveanendingverticalbar,thesecondcolsdoeshaveastartingone.Betweenentrytwoandentrythreethereisasingleverticalrule;despitethatthecolsinbothofthesurroundingmulticolumn'scallforaverticalrule,youonlygetonerule.Betweenentrythreeandentryfourthereisnoverticalrule;thedefaultcallsforonebutthecolsintheentrythree\multicolumnleavesitout,andthattakesprecedence.Finally,followingentryfourthereisaverticalrulebecauseofthedefault.Thenumberofspannedcolumnsnumcolscanbe1.Besidesgivingtheabilitytochangethehorizontalalignment,thisalsoisusefultooverrideforonerowthetabularde nition'sdefaultintercolumnareaspeci cation,includingtheplacementofverticalrules.Intheexamplebelow,inthetabularde nitionthe rstcolumnisspeci- edtodefaulttoleftjusti edbutinthe rstrowtheentryiscenteredwith\multicolumn{1}{c}{\textsc{Period}}.Alsointhe rstrow,thesecondandthird Chapter8:Environments81 columnsarespannedbyasingleentrywith\multicolumn{2}{c}{\textsc{Span}},overridingthespeci cationtocenterthosetwocolumnsonthepagerangeen-dash.\begin{tabular}{l|r@{--}l}\multicolumn{1}{c}{\textsc{Period}}&multicolumn{2}{c}{\textsc{Span}}\\\hlineBaroque&1600&1760\\Classical&1730&1820\\Romantic&1780&1910\\Impressionistic&1875&1925\end{tabular}Althoughthetabularspeci cationbydefaultputsaverticalrulebetweenthe rstandsecondcolumns,nosuchverticalruleappearsinthe rstrowhere.That'sbecausethereisnoverticalbarinthecolspartofthe rstrow's rst\multicolumncommand.8.23.2\vlineDrawaverticallineinatabularorarrayenvironmentextendingthefullheightanddepthofanentry'srow.Canalsobeusedinan@-expression,althoughitssynonymverticalbar|ismorecommon.Thiscommandisrarelyusedinthebodyofatable;typicallyatable'sverticallinesarespeci edintabular'scolsargumentandoverriddenasneededwith\multicolumn(see Section8.23[tabular],page77 ).Theexamplebelowillustratessomepitfalls.Inthe rstrow'ssecondentrythe\hfillmovesthe\vlinetotheleftedgeofthecell.Butthatisdi erentthanputtingithalfwaybetweenthetwocolumns,sobetweenthe rstandsecondcolumnstherearetwoverti-calrules,withtheonefromthe{c|cc}speci ercomingbeforetheoneproducedbythe\vline\hfill.Incontrast,the rstrow'sthirdentryshowstheusualwaytoputaverticalbarbetweentwocolumns.Inthesecondrow,theghiisthewidestentryinitscolumnsointhe\vline\hfillthe\hfillhasnoe ectandtheverticallineinthatentryappearsimmediatelynexttotheg,withnowhitespace.\begin{tabular}{c|cc}x&\vline\hfilly&\multicolumn{1}{|r}{z}\\%row1abc&def&\vline\hfillghi%row2\end{tabular}8.23.3\clineSynopsis:\cline{i-j}Inanarrayortabularenvironment,drawahorizontalrulebeginningincolumniandendingincolumnj.Thedash,-,mustappearinthemandatoryargument.Tospanasinglecolumnusethenumbertwice,aswith\cline{2-2}.Thisexampleputstwohorizontallinesbetweenthe rstandsecondrows,onelineinthe rstcolumnonly,andtheotherspanningthethirdandfourthcolumns.Thetwolinesareside-by-side,atthesameheight.\begin{tabular}{llrr}a&b&c&d\\\cline{1-1}\cline{3-4}e&f&g&h Chapter8:Environments82 \end{tabular}8.23.4\hlineDrawahorizontallinethewidthoftheenclosingtabularorarrayenvironment.It'smostcommonlyusedtodrawalineatthetop,bottom,andbetweentherowsofatable.Inthisexamplethetopofthetablehastwohorizontalrules,oneabovetheother,thatspanbothcolumns.Thebottomofthetablehasasinglerulespanningbothcolumns.Becauseofthe\hline,thetabularsecondrow'slineendingdoublebackslash\\isrequired.\begin{tabular}{ll}\hline\hlineBaseball&RedSox\\Basketball&Celtics\\\hline\end{tabular}8.24thebibliographySynopsis:\begin{thebibliography}{widest-label}\bibitem[label]{cite_key}...\end{thebibliography}Produceabibliographyorreferencelist.Therearetwowaystoproducebibliographiclists.Thisenvironmentissuitablewhenyouhaveonlyafewreferencesandcanmaintainthelistbyhand.See Section8.24.4[UsingBibTeX],page85, foramoresophisticatedapproach.Thisshowstheenvironmentwithtwoentries.Thisworkisbasedon\cite{latexdps}.Togethertheyare\cite{latexdps,texbook}....\begin{thebibliography}{9}\bibitem{latexdps}LeslieLamport.\textit{\LaTeX{}:adocumentpreparationsystem}.Addison-Wesley,Reading,Massachusetts,1993.\bibitem{texbook}DonaldErvinKnuth.\textit{The\TeXbook}.Addison-Wesley,Reading,Massachusetts,1983.\end{thebibliography}Thisstylesthe rstreferenceas`[1]Leslie...',andsothat\cite{latexdps}producesthematching`...basedon[1]'.Thesecond\citeproduces`[1,2]'.Youmustcompilethedocumenttwicetoresolvethesereferences.Themandatoryargumentwidest-labelistextthat,whentypeset,isaswideasthewidestitemlabelproducedbythe\bibitemcommands.Thetraditionistouse9forbibliographieswithlessthan10references,99foroneswithlessthan100,etc. Chapter8:Environments83 Thebibliographiclistisheadedbyatitlesuchas`Bibliography'.Tochangeittherearetwocases.Inthebookandreportclasses,wherethetoplevelsectioningis\chapterandthedefaulttitleis`Bibliography',thattitleisinthemacro\bibname.Forarticle,wheretheclass'stoplevelsectioningis\sectionandthedefaultis`References',thetitleisinmacro\refname.Changeitbyrede ningthecommand,aswith\renewcommand{\refname}{Citedreferences}after\begin{document}.Languagesupportpackagessuchasbabelwillautomaticallyrede ne\refnameor\bibnameto ttheselectedlanguage.8.24.1\bibitemSynopsis:\bibitem{cite_key}or\bibitem[label]{cite_key}Generateanentrylabeledbylabel.ThedefaultisforLATEXtogeneratesanumberusingtheenumicounter.Thecitationkeycite keyisastringofletters,numbers,andpunctuationsymbols(butnotcomma).See Section8.24[thebibliography],page82, foranexample.Theoptionallabelchangesthedefaultlabelfromanintegertothegivenstring.Withthis\begin{thebibliography}\bibitem[Lamport1993]{latexdps}LeslieLamport.\textit{\LaTeX{}:adocumentpreparationsystem}.Addison-Wesley,Reading,Massachusetts,1993.\bibitem{texbook}DonaldErvinKnuth.\textit{The\TeXbook}.Addison-Wesley,Reading,Massachusetts,1983.\end{thebibliography}the rstentrywillbestyledas`[Lamport1993]Leslie...'(Theamountofhorizon-talspacethatLATEXleavesforthelabeldependsonthewidest-labelargumentofthethebibliographyenvironment;see Section8.24[thebibliography],page82 .)Similarly,...basedon\cite{latexdps}willproduce`...basedon[Lamport1994]'.Ifyoumix\bibitementrieshavingalabelwiththosethatdonotthenLATEXwillnumbertheunlabelledonessequentially.Intheexampleabovethetexbookentrywillappearas`[1]Donald...',despitethatitisthesecondentry.Ifyouusethesamecite keytwicethenyouget`LaTeXWarning:Thereweremultiply-definedlabels'.Underthehood,LATEXremembersthecite keyandlabelinformationbecause\bibitemwritesittotheauxiliary lefilename.aux.Forinstance,theaboveexamplecauses\bibcite{latexdps}{Lamport,1993}and\bibcite{texbook}{1}toappearinthat le.The.aux leisreadbythe\begin{document}commandandthentheinformationis Chapter8:Environments84 availablefor\citecommands.ThisexplainswhyyouneedtorunLATEXtwicetoresolvereferences:oncetowriteitoutandoncetoreaditin.Becauseofthistwo-passalgorithm,whenyouadda\bibitemorchangeitscite keyyoumayget`LaTeXWarning:Label(s)mayhavechanged.Reruntogetcross-referencesright'.Fixitbyrecompiling.8.24.2\citeSynopsis:\cite{keys}or\cite[subcite]{keys}Generateasoutputacitationtothereferencesassociatedwithkeys.Themandatorykeysisacitationkey,oracomma-separatedlistofcitationkeys(see Section8.24.1[\bibitem],page83 ).ThisTheultimatesourceis\cite{texbook}....\begin{thebibliography}\bibitem{texbook}DonaldErvinKnuth.\textit{The\TeXbook}.Addison-Wesley,Reading,Massachusetts,1983.\end{thebibliography}producesoutputlike`...sourceis[1]'.(Youcanchangetheappearanceofthecitationwithbibliographystyles.Moreisin Section8.24.4[UsingBibTeX],page85 .)Theoptionalargumentsubciteisappendedtothecitation.Forexample,See14.3in\cite[p.~314]{texbook}mightproduce`See14.3in[1,p.314]'.Inadditiontowhatappearsintheoutput,\citewritesinformationtotheauxiliary lefilename.aux.Forinstance,\cite{latexdps}writes`\citation{latexdps}'tothat le.ThisinformationisusedbyBibTEXtoincludeinyourreferencelistonlythoseworksthatyouhaveactuallycited;see Section8.24.3[\nocite],page84, also.Ifkeysisnotinyourbibliographyinformationthenyouget`LaTeXWarning:Therewereundefinedreferences',andintheoutputthecitationshowsasaboldfacequestionmarkbetweensquarebrackets.Therearetwopossiblecauses.Ifyouhavemistypedsomething,asin\cite{texbok}thenyouneedtocorrectthespelling.Ontheotherhand,ifyouhavejustaddedormodi edthebibliographicinformationandsochangedthe.aux le(see Section8.24.1[\bibitem],page83 )thenthe xmaybetorunLATEXagain.8.24.3\nociteSynopsis:\nocite{keys}Producesnooutputbutwriteskeystotheauxiliary ledoc-filename.aux.Themandatoryargumentkeysisacomma-separatedlistofoneormorecitationkeys(see Section8.24.1[\bibitem],page83 ).ThisinformationisusedbyBibTEXtoinclude Chapter8:Environments85 theseworksinyourreferencelisteventhoughyouhavenotcitedthem(see Section8.24.2[\cite],page84 ).8.24.4UsingBibTEXAsdescribedinthebibliography(see Section8.24[thebibliography],page82 ),asophis-ticatedapproachtomanagingbibliographiesisprovidedbytheBibTEXprogram.Thisisonlyanintroduction;seethefulldocumentationonCTAN.WithBibTEX,youdon'tusethebibliography(see Section8.24[thebibliography],page82 ).Instead,includetheselines.\bibliographystyle{bibstyle}\bibliography{bibfile1,bibfile2,...}Thebibstylereferstoa lebibstyle.bst,whichde neshowyourcitationswilllook.Thestandardbibstyle'sdistributedwithBibTEXare:alphaLabelsareformedfromnameofauthorandyearofpublication.Thebiblio-graphicitemsaresortedalphabetically.plainLabelsareintegers.Sortthebibliographicitemsalphabetically.unsrtLikeplain,butentriesareinorderofcitation.abbrvLikeplain,butmorecompactlabels.Many,manyotherBibTEXstyle lesexist,tailoredtothedemandsofvariouspublications.SeeCTAN'slisting http://mirror.ctan.org/biblio/bibtex/contrib .The\bibliographycommandiswhatactuallyproducesthebibliography.Itsargumentisacomma-separatedlist,referringto lesnamedbibfile1.bib,bibfile2.bib,...ThesecontainyourdatabaseinBibTEXformat.Thisshowsatypicalcoupleofentriesinthatformat.@book{texbook,title={The{{\TeX}}book},author={D.E.Knuth},isbn={0201134489},series={Computers\&typesetting},year={1983},publisher={Addison-Wesley}}@book{sexbook,author={W.H.MastersandV.E.Johnson},title={HumanSexualResponse},year={1966},publisher={BantamBooks}}Onlythebibliographicentriesreferredtovia\citeand\nocitewillbelistedinthedocument'sbibliography.Thusyoucankeepallyoursourcestogetherinone le,orasmallnumberof les,andrelyonBibTEXtoincludeinthisdocumentonlythosethatyouused. Chapter8:Environments86 8.25theoremSynopsis:\begin{theorem}theorembody\end{theorem}Produces`Theoremn'inboldfacefollowedbytheorembodyinitalics.Thenumber-ingpossibilitiesfornaredescribedunder\newtheorem(see Section12.9[\newtheorem],page110 ).\newtheorem{lem}{Lemma}%inpreamble\newtheorem{thm}{Theorem}...\begin{lem}%indocumentbodytextoflemma\end{lem}Thenextresultfollowsimmediately.\begin{thm}[Gauss]%put`Gauss'inparensaftertheoremheadtextoftheorem\end{thm}MostnewdocumentsusethepackagesamsthmandamsmathfromtheAmericanMathe-maticalSociety.Amongotherthingsthesepackagesincludealargenumberofoptionsfortheoremenvironments,suchasstylingoptions.8.26titlepageSynopsis:\begin{titlepage}...textandspacing...\end{titlepage}Createatitlepage,apagewithnoprintedpagenumberorheadingandwithsucceedingpagesnumberedstartingwithpageone.Inthisexampleallformatting,includingverticalspacing,islefttotheauthor.\begin{titlepage}\vspace*{\stretch{1}}\begin{center}{\huge\bfseriesThesis\\[1ex]title}\\[6.5ex]{\large\bfseriesAuthorname}\\\vspace{4ex}Thesissubmittedto\\[5pt]\textit{Universityname}\\[2cm]inpartialfulfilmentfortheawardofthedegreeof\\[2cm]\textsc{\LargeDoctorofPhilosophy}\\[2ex]\textsc{\largeMathematics}\\[12ex]\vfill Chapter8:Environments87 DepartmentofMathematics\\Address\\\vfill\today\end{center}\vspace{\stretch{2}}\end{titlepage}Toinsteadproduceastandardtitlepagewithoutatitlepageenvironment,use\maketitle(see Section18.1[\maketitle],page153 ).8.27verbatimSynopsis:\begin{verbatim}literal-text\end{verbatim}Aparagraph-makingenvironmentinwhichLATEXproducesasoutputexactlywhatyoutypeasinput.Forinstanceinsideliteral-textthebackslash\characterdoesnotstartcommands,itproducesaprinted`\',andcarriagereturnsandblanksaretakenliterally.Theoutputappearsinamonospacedtypewriter-likefont(\tt).\begin{verbatim}Symbolswearing:%&$#?!.\end{verbatim}Theonlyrestrictiononliteral-textisthatitcannotincludethestring\end{verbatim}.Youcannotusetheverbatimenvironmentintheargumenttomacros,forinstanceintheargumenttoa\section.Thisisnotthesameascommandsbeingfragile(see Section12.11[\protect],page113 ),insteaditjustcannotappearthere.(Butthecprotectpackagecanhelpwiththis.)Onecommonuseofverbatiminputistotypesetcomputercode.Therearepackagesthatareanimprovementtheverbatimenvironment.Forinstance,oneimprovementistoallowtheverbatiminclusionofexternal les,orpartsofthose les.Suchpackagesincludelistings,andminted.Apackagethatprovidesmanymoreoptionsforverbatimenvironmentsisfancyvrb.Anotherisverbatimbox.Foralistofalltherelevantpackages,seeCTAN.8.27.1\verbSynopsis:\verbcharliteral-textchar\verb*charliteral-textcharTypesetliteral-textasitisinput,includingspecialcharactersandspaces,usingthetypewriter(\tt)font.Thisexampleshowstwodi erentinvocationsof\verb.Thisis\verb!literally!thebiggestpumpkinever. Chapter8:Environments88 Andthisisthebestsquash,\verb+literally!+The rst\verbhasitsliteral-textsurroundedwithexclamationpoint,!.Thesecondinsteadusesplus,+,becausetheexclamationpointispartofliteral-text.Thesingle-characterdelimitercharsurroundsliteral-text|itmustbethesamecharac-terbeforeandafter.Nospacescomebetween\verbor\verb*andchar,orbetweencharandliteral-text,orbetweenliteral-textandthesecondoccurrenceofchar(thesynopsisshowsaspaceonlytodistinguishonecomponentfromtheother).Thedelimitermustnotappearinliteral-text.Theliteral-textcannotincludealinebreak.The*-formdi ersonlyinthatspacesareprintedwithavisiblespacecharacter.(Namely, .)Theoutputfromthiswillincludeacharactershowingthespaces.Thecommands'sfirstargumentis\verb*!filenamewithextension!and...FortypesettingInternetaddresses,urls,thepackageurlprovidesanoptionthatisbetterthanthe\verbcommand,sinceitallowslinebreaks.Forcomputercodetherearemanypackageswithadvantagesover\verb.Oneislistings,anotherisminted.Youcannotuse\verbintheargumenttoamacro,forinstanceintheargumenttoa\section.Itisnotaquestionof\verbbeingfragile(see Section12.11[\protect],page113 ),insteaditjustcannotappearthere.(Butthecprotectpackagecanhelpwiththis.)8.28verseSynopsis:\begin{verse}line1\\line2\\...\end{verse}Anenvironmentforpoetry.HerearetwolinesfromShakespeare'sRomeoandJuliet.Thenplainlyknowmyheart'sdearloveisset\\OnthefairdaughterofrichCapulet.Separatethelinesofeachstanzawith\\,anduseoneormoreblanklinestoseparatethestanzas.\begin{verse}\makebox[\linewidth][c]{\textit{ShutNotYourDoors}---WaltWhitman}\\[1\baselineskip]Shutnotyourdoorstomeproudlibraries,\\Forthatwhichwaslackingonallyourwell-fill'dshelves,\\\qquadyetneededmost,Ibring,\\Forthfromthewaremerging,abookIhavemade,\\Thewordsofmybooknothing,thedriftofiteverything,\\Abookseparate,notlink'dwiththerestnorfeltbytheintellect,\\Butyouyeuntoldlatencieswillthrilltoeverypage. 89 \end{verse}Theoutputhasmarginsindentedontheleftandtheright,paragraphsarenotindented,andthetextisnotright-justi ed. 90 9LinebreakingThe rstthingLATEXdoeswhenprocessingordinarytextistotranslateyourinput leintoasequenceofglyphsandspaces.Toproduceaprinteddocument,thissequencemustbebrokenintolines(andtheselinesmustbebrokenintopages).LATEXusuallydoestheline(andpage)breakinginthetextbodyforyoubutinsomeenvironmentsyoumanuallyforcelinebreaks.Acommonwork owistogeta nalversionofthedocumentcontentbeforetakinga nalpassthroughandconsideringlinebreaks(andpagebreaks).Thisdi ersfromwordprocessing,whereyouareformattingtextasyouinputit.Puttingtheseo untiltheendpreventsalotof ddlingwithbreaksthatwillchangeanyway.9.1\\Synopsis,oneof:\\\\[morespace]oroneof:\\*\\*[morespace]Endthecurrentline.Theoptionalargumentmorespacespeci esextraverticalspacetobeinsertedbeforethenextline.Thisisarubberlength(see Chapter14[Lengths],page120 )andcanbenegative.Thetextbeforethelinebreakissetatitsnormallength,thatis,itisnotstretchedto lloutthelinewidth.Thiscommandisfragile(see Section12.11[\protect],page113 ).Thestarredform,\\*,tellsLATEXnottostartanewpagebetweenthetwolines,byissuinga\nobreak.\title{Mystory:\\[0.25in]ataleofwoe}ExplicitlinebreaksinthemaintextbodyareunusualinLATEX.Inparticular,don'tstartnewparagraphswith\\.Insteadleaveablanklinebetweenthetwoparagraphs.Anddon'tputinasequenceof\\'stomakeverticalspace.Insteaduse\vspace{length},or\leavevmode\vspace{length},or\vspace*{length}ifyouwantthespacetonotbethrownoutatthetopofanewpage(see Section19.14[\vspace],page166 ).The\\commandismostlyusedoutsideofthemain owoftextsuchasinatabularorarrayenvironmentorinanequationenvironment.The\\commandisasynonymfor\newline(see Section9.3[\newline],page92 )underordinarycircumstances(anexampleofanexceptionisthep{...}columninatabularenvironment;see Section8.23[tabular],page77 ).The\\commandisamacro,anditsde nitionchangesbycontextsothatitsde nitioninnormaltext,acenterenvironment,aflushleftenvironment,andatabulararealldi erent.Innormaltextwhenitforcesalinebreakitisessentiallyashorthandfor\newline.Itdoesnotendhorizontalmodeorendtheparagraph,itjustinsertssomeglueandpenaltiessothatwhentheparagraphdoesendalinebreakwilloccuratthatpoint,withtheshortlinepaddedwithwhitespace. Chapter9:Linebreaking91 Youget`LaTeXError:There'snolineheretoend'ifyouuse\\toaskforanewline,ratherthantoendthecurrentline.Anexampleisifyouhave\begin{document}\\or,morelikely,somethinglikethis.\begin{center}\begin{minipage}{0.5\textwidth}\\Inthatverticalspaceputyourmark.\end{minipage}\end{center}Fixitbyreplacingthedoublebackslashwithsomethinglike\vspace{\baselineskip}.9.2\obeycr&\restorecrThe\obeycrcommandmakesareturnintheinput le(`^^M',internally)thesameas\\,followedby\relax.Soeachnewlineintheinputwillalsobeanewlineintheoutput.The\restorecrcommandrestoresnormalline-breakingbehavior.Thisisnotthewaytoshowverbatimtextorcomputercode.See Section8.27[verbatim],page87, instead.WithLATEX'susualdefaults,thisaaabbb\obeycrcccdddeee\restorecrfffggghhhiiiproducesoutputlikethis.aaabbbcccdddeeefffggghhhiiiTheindentsareparagraphindents. Chapter9:Linebreaking92 9.3\newlineInordinarytext,thisendsalineinawaythatdoesnotright-justifytheline,sothepriortextisnotstretched.Thatis,inparagraphmode(see Chapter17[Modes],page151 ),the\newlinecommandisequivalenttodouble-backslash(see Section9.1[\\],page90 ).Thiscommandisfragile(see Section12.11[\protect],page113 ).However,thetwocommandsaredi erentinsideatabularorarrayenvironment.Inacolumnwithaspeci erproducingaparagraphboxsuchastypicallyp{...},\newlinewillinsertalineendinsideofthecolumn;thatis,itdoesnotbreaktheentiretabularrow.Tobreaktheentirerowuse\\oritsequivalent\tabularnewline.Thiswillprint`Name:'and`Address:'astwolinesinasinglecellofthetable.\begin{tabular}{p{1in}{\hspace{2in}}p{1in}}Name:\newlineAddress:&Date:\\\hline\end{tabular}The`Date:'willbebaseline-alignedwith`Name:'.9.4\-(discretionaryhyphen)TellLATEXthatitmayhyphenatethewordatthatpoint.Whenyouinsert\-commandsinaword,thewordwillonlybehyphenatedatthosepointsandnotatanyofthehyphenationpointsthatLATEXmightotherwisehavechosen.Thiscommandisrobust(see Section12.11[\protect],page113 ).LATEXisgoodathyphenatingandusually ndsmostofthecorrecthyphenationpoints,whilealmostneverusinganincorrectone.The\-commandisforexceptionalcases.Forexample,LATEXdoesnotordinarilyhyphenatewordscontainingahyphen.Below,thelongandhyphenatedwordmeansLATEXhastoputinunacceptablylargespacestosetthenarrowcolumn.\begin{tabular}{rp{1.75in}}IsaacAsimov&Thestrainofanti-intellectualism%an\-ti-in\-tel\-lec\-tu\-al\-ismhasbeenaconstantthreadwindingitswaythroughourpoliticalandculturallife,nurturedbythefalsenotionthatdemocracymeansthat`myignoranceisjustasgoodasyourknowledge'.\end{tabular}Commentingoutthethirdlineanduncommentingthefourthmakesamuchbetter t.The\-commandonlyallowsLATEXtobreakthere,itdoesnotrequirethatitbreakthere.YoucaninsistonasplitwithsomethinglikeHef-\linebreakferon.Ofcourse,ifyoulaterchangethetextthenthisforcedbreakmaylookveryodd,sothisapproachrequirescare.9.5\discretionary(generalizedhyphenationpoint)Synopsis:\discretionary{pre-break}{post-break}{no-break} Chapter9:Linebreaking93 Handlewordchangesaroundhyphens.ThiscommandisnotoftenusedinLATEXdocu-ments.Ifalinebreakoccursatthepointwhere\discretionaryappearsthenTEXputspre-breakattheendofthecurrentlineandputspost-breakatthestartofthenextline.IfthereisnolinebreakherethenTEXputsno-breakIn`difficult'thethreelettersffiformaligature.ButTEXcannonethelessbreakbetweenthetwof'swiththis.di\discretionary{f-}{fi}{ffi}cultNotethatusersdonothavetodothis.ItistypicallyhandledautomaticallybyTEX'shyphenationalgorithm.9.6\fussy&\sloppyDeclarationstomakeTEXmorepickyorlesspickyaboutlinebreaking.Declaring\fussyusuallyavoidstoomuchspacebetweenwords,atthecostofanoccasionaloverfullbox.Conversely,\sloppyavoidsoverfullboxeswhilesu eringlooseinterwordspacing.Thedefaultis\fussy.Linebreakinginaparagraphiscontrolledbywhicheverdecla-rationiscurrentattheblankline,or\par,ordisplayedequationendingthatparagraph.Sotoa ectthelinebreaks,includethatparagraph-endingmaterialinthescopeofthecommand.9.6.1sloppyparSynopsis:\begin{sloppypar}...paragraphs...\end{sloppypar}Typesettheparagraphswith\sloppyine ect(see Section9.6[\fussy&\sloppy],page93 ).Usethistolocallyadjustlinebreaking,toavoid`Overfullbox'or`Underfullbox'errors.Theexampleissimple.\begin{sloppypar}Herplanforthemorningthussettled,shesatquietlydowntoherbookafterbreakfast,resolvingtoremaininthesameplaceandthesameemploymenttilltheclockstruckone;andfromhabitudeverylittleincommodedbytheremarksandejaculationsofMrs.\Allen,whosevacancyofmindandincapacityforthinkingweresuch,thatasshenevertalkedagreatdeal,soshecouldneverbeentirelysilent;and,therefore,whileshesatatherwork,ifshelostherneedleorbrokeherthread,ifsheheardacarriageinthestreet,orsawaspeckuponhergown,shemustobserveitaloud,whethertherewereanyoneatleisuretoanswerherornot.\end{sloppypar} Chapter9:Linebreaking94 9.7\hyphenationSynopsis:\hyphenation{word1...}Declaresallowedhyphenationpointswithinthewordsinthelist.Thewordsinthatlistareseparatedbyspaces.Showpermittedpointsforhyphenationwithadashcharacter,-.Hereisanexample:\hyphenation{hat-eril-lit-e-ra-titru-th-i-ness}Uselowercaseletters.TEXwillonlyhyphenateifthewordmatchesexactly.Multiple\hyphenationcommandsaccumulate.9.8\linebreak&\nolinebreakSynopses,oneof:\linebreak\linebreak[zero-to-four]oroneofthese.\nolinebreak\nolinebreak[zero-to-four]Encourageordiscouragealinebreak.Theoptionalzero-to-fourisanintegerthatallowsyoutosoftentheinstruction.Thedefaultis4,sothatwithouttheoptionalargumentthesecommandsentirelyforceorpreventthebreak.Butforinstance,\nolinebreak[1]isasuggestionthatanotherplacemaybebetter.Thehigherthenumber,themoreinsistenttherequest.Bothcommandsarefragile(see Section12.11[\protect],page113 ).HerewetellLATEXthatagoodplacetoputalinebreakisafterthestandardlegaltext.\boilerplatelegal{}\linebreak[2]Weespeciallyencourageapplicationsfrommembersoftraditionallyunderrepresentedgroups.Whenyouissue\linebreak,thespacesinthelinearestretchedoutsothatitextendstotherightmargin.See Section9.1[\\],page90, and Section9.3[\newline],page92, tohavethespacesnotstretchedout. 95 10PagebreakingOrdinarilyLATEXautomaticallytakescareofbreakingoutputintopageswithitsusualaplomb.Butifyouarewritingcommands,ortweakingthe nalversionofadocument,thenyoumayneedtounderstandhowtoin uenceitsactions.LATEX'salgorithmforsplittingadocumentintopagesismorecomplexthanjustwaitinguntilthereisenoughmaterialto llapageandoutputtingtheresult.Instead,LATEXtypesetsmorematerialthanwould tonthepageandthenchoosesabreakthatisoptimalinsomeway(ithasthesmallestbadness).Anexampleoftheadvantageofthisapproachisthatifthepagehassomeverticalspacethatcanbestretchedorshrunk,suchaswithrubberlengthsbetweenparagraphs,thenLATEXcanusethattoavoidwidowlines(whereanewpagestartswiththelastlineofaparagraph;LATEXcansqueezetheextralineontothe rstpage)andorphans(wherethe rstlineofparagraphisattheendofapage;LATEXcanstretchthematerialofthe rstpagesotheextralinefallsonthesecondpage).AnotherexampleiswhereLATEXusesavailableverticalshrinkageto tonapagenotjusttheheaderforanewsectionbutalsothe rsttwolinesofthatsection.ButLATEXdoesnotoptimizeovertheentiredocument'ssetofpagebreaks.Soitcanhappenthatthe rstpagebreakisgreatbutthesecondoneislousy;tobreakthecurrentpageLATEXdoesn'tlookasfaraheadasthenextpagebreak.Sooccasionallyyoumaywanttoin uencepagebreakswhilepreparinga nalversionofadocument.See Chapter5[Layout],page22, formorematerialthatisrelevanttopagebreaking.10.1\clearpage&\cleardoublepageSynopsis:\clearpageor\cleardoublepageEndthecurrentpageandoutputallofthepending oating guresandtables(see Section5.6[Floats],page26 ).Iftherearetoomany oatsto tonthepagethenLATEXwillputinextrapagescontainingonly oats.Intwo-sidedprinting,\cleardoublepagealsomakesthenextpageofcontentaright-handpage,anodd-numberedpage,ifnecessaryinsertingablankpage.The\clearpagecommandisrobustwhile\cleardoublepageisfragile(see Section12.11[\protect],page113 ).LATEX'spagebreaksareoptimizedsoordinarilyyouonlyusethiscommandinadocumentbodytopolishthe nalversion,orinsidecommands.The\cleardoublepagecommandwillputinablankpage,butitwillhavetherunningheadersandfooters.Togetareallyblankpage,usethiscommand.\let\origdoublepage\cleardoublepage\newcommand{\clearemptydoublepage}{%\clearpage{\pagestyle{empty}\origdoublepage}%}IfyouwantLATEX'sstandard\chaptercommandtodothisthenaddtheline\let\cleardoublepage\clearemptydoublepage. Chapter10:Pagebreaking96 Thecommand\newpage(see Section10.2[\newpage],page96 )alsoendsthecurrentpage,butwithoutclearingpending oats.And,ifLATEXisintwo-columnmodethen\newpageendsthecurrentcolumnwhile\clearpageand\cleardoublepageendthecur-rentpage.10.2\newpageSynopsis:\newpageEndthecurrentpage.Thiscommandisrobust(see Section12.11[\protect],page113 ).LATEX'spagebreaksareoptimizedsoordinarilyyouonlyusethiscommandinadocumentbodytopolishthe nalversion,orinsidecommands.Whilethecommands\clearpageand\cleardoublepagealsoendthecurrentpage,inadditiontheyclearpending oats(see Section10.1[\clearpage&\cleardoublepage],page95 ).And,ifLATEXisintwo-columnmodethen\clearpageand\cleardoublepageendthecurrentpage,possiblyleavinganemptycolumn,while\newpageonlyendsthecurrentcolumn.Incontrastwith\pagebreak(see Section10.4[\pagebreak&\nopagebreak],page97 ),the\newpagecommandwillcausethenewpagetostartrightwhererequested.ThisFourscoreandsevenyearsagoourfathersbroughtforthonthiscontinent,\newpage\noindentanewnation,conceivedinLiberty,anddedicatedtothepropositionthatallmenarecreatedequal.makesanewpagestartafter`continent,'andthecut-o lineisnotrightjusti ed.Inaddition,\newpagedoesnotverticallystretchoutthepage,as\pagebreakdoes.10.3\enlargethispageSynopsis,oneof:\enlargethispage{size}\enlargethispage*{size}Enlargethe\textheightforthecurrentpage.Therequiredargumentsizemustbearigidlength(see Chapter14[Lengths],page120 ).Itmaybepositiveornegative.Thiscommandisfragile(see Section12.11[\protect],page113 ).Acommonstrategyistowaituntilyouhavethe naltextofadocument,andthenpassthroughittweakinglineandpagebreaks.Thiscommandallowsyousomepagesizeleeway.Thiswillallowoneextralineonthecurrentpage.\enlargethispage{\baselineskip}Thestarredform\enlargesthispage*triestosqueezethematerialtogetheronthepageasmuchaspossible,forthecommonusecaseofgettingonemorelineonthepage.Thisisoftenusedtogetherwithanexplicit\pagebreak. Chapter10:Pagebreaking97 10.4\pagebreak&\nopagebreakSynopses:\pagebreak\pagebreak[zero-to-four]or\nopagebreak\nopagebreak[zero-to-four]Encourageordiscourageapagebreak.Theoptionalzero-to-fourisanintegerthatallowsyoutosoftentherequest.Thedefaultis4,sothatwithouttheoptionalargumentthesecommandsentirelyforceorpreventthebreak.Butforinstance\nopagebreak[1]suggeststoLATEXthatanotherspotmightbepreferable.Thehigherthenumber,themoreinsistenttherequest.Bothcommandsarefragile(see Section12.11[\protect],page113 ).LATEX'spageendingsareoptimizedsoordinarilyyouonlyusethiscommandinadocu-mentbodytopolishthe nalversion,orinsidecommands.Ifyouusetheseinsideaparagraph,theyapplytothepointfollowingthelineinwhichtheyappear.SothisFourscoreandsevenyearsagoourfathersbroughtforthonthiscontinent,\pagebreakanewnation,conceivedinLiberty,anddedicatedtothepropositionthatallmenarecreatedequal.doesnotgiveapagebreakat`continent,'butinsteadat`nation,'sincethatiswhereLATEXbreaksthatline.Inaddition,with\pagebreaktheverticalspaceonthepageisstretchedoutwherepossiblesothatitextendstothenormalbottommargin.Thiscanlookstrange,andif\flushbottomisine ectthiscancauseyoutoget`Underfull\vbox(badness10000)hasoccurredwhile\outputisactive'.See Section10.2[\newpage],page96, foracommandthatdoesnothavethesee ects. 98 11FootnotesPlaceafootnoteatthebottomofthecurrentpage,ashere.NoelCowardquippedthathavingtoreadafootnoteislikehavingtogodownstairstoanswerthedoor,whileinthemidstofmakinglove.\footnote{%Iwouldn'tknow,Idon'treadfootnotes.}Youcanputmultiplefootnotesonapage.Ifthefootnotetextbecomestoolongthenitwill owtothenextpage.Youcanalsoproducefootnotesbycombiningthe\footnotemarkandthe\footnotetextcommands,whichisusefulinspecialcircumstances.Tomakebibliographicreferencescomeoutasfootnotesyouneedtoincludeabiblio-graphicstylewiththatbehavior(see Section8.24.4[UsingBibTeX],page85 ).11.1\footnoteSynopsis,oneof:\footnote{text}\footnote[number]{text}Placeafootnotetextatthebottomofthecurrentpage.ThereareoverathousandfootnotesinGibbon's\textit{DeclineandFalloftheRomanEmpire}.\footnote{%AfterreadinganearlyversionwithendnotesDavidHumecomplained,``OneisalsoplaguedwithhisNotes,accordingtothepresentMethodofprintingtheBook''andsuggestedthatthey``onlytobeprintedattheMarginortheBottomofthePage.''}Theoptionalargumentnumberallowsyoutospecifythenumberofthefootnote.IfyouusethisthenLATEXdoesnotincrementthefootnotecounter.Bydefault,LATEXusesarabicnumbersasfootnotemarkers.Changethiswithsome-thinglike\renewcommand{\thefootnote}{\fnsymbol{footnote}},whichusesasequenceofsymbols(see Section13.1[\alph\Alph\arabic\roman\Roman\fnsymbol],page116 ).Tomakethischangeglobalputthatinthepreamble.Ifyoumakethechangelocalthenyoumaywanttoresetthecounterwith\setcounter{footnote}{0}.LATEXdeterminesthespacingoffootnoteswithtwoparameters.\footnoteruleProducestheruleseparatingthemaintextonapagefromthepage'sfoot-notes.Defaultdimensionsinthestandarddocumentclasses(exceptslides,whereitdoesnotappear)is:verticalthicknessof0.4pt,andhorizontalsizeof0.4\columnwidthlong.Changetherulewithsomethinglikethis.\renewcommand{\footnoterule}{%Kernsavoidverticalspace\kern-3pt%This-3isnegative\hrulewidth\textwidthheight1pt%ofthesumofthis1\kern2pt}%andthis2 Chapter11:Footnotes99 \footnotesepTheheightofthestrutplacedatthebeginningofthefootnote(see Section19.13[\strut],page165 ).Bydefault,thisissettothenormalstrutfor\footnotesizefonts(see Section4.2[Fontsizes],page18 ),thereforethereisnoextraspacebetweenfootnotes.Thisis`6.65pt'for`10pt',`7.7pt'for`11pt',and`8.4pt'for`12pt'.Changeitaswith\setlength{\footnotesep}{11pt}.The\footnotecommandisfragile(see Section12.11[\protect],page113 ).LATEX'sdefaultputsmanyrestrictionsonwhereyoucanusea\footnote;forinstance,youcannotuseitinanargumenttoasectioningcommandsuchas\chapter(itcanonlybeusedinouterparagraphmode;see Chapter17[Modes],page151 ).Therearesomeworkarounds;seefollowingsections.Inaminipageenvironmentthe\footnotecommandusesthempfootnotecounterin-steadofthefootnotecounter,sotheyarenumberedindependently.Theyareshownatthebottomoftheenvironment,notatthebottomofthepage.Andbydefaulttheyareshownalphabetically.See Section8.18[minipage],page63, and Section11.5[Footnotesinatable],page100 .11.2\footnotemarkSynopsis,oneof:\footnotemark\footnotemark[number]Putthecurrentfootnotemarkinthetext.Tospecifyassociatedtextforthefootnotesee Section11.3[\footnotetext],page100 .Theoptionalargumentnumbercausesthecommandtousethatnumbertodeterminethefootnotemark.Thiscommandcanbeusedininnerparagraphmode(see Chapter17[Modes],page151 ).Ifyouuse\footnotemarkwithouttheoptionalargumentthenitincrementsthefootnotecounterbutifyouusetheoptionalnumberthenitdoesnot.Thenextexampleproducesseveralconsecutivefootnotemarkersreferringtothesamefootnote.Thefirsttheorem\footnote{DuetoGauss.}andthesecondtheorem\footnotemark[\value{footnote}]andthethirdtheorem.\footnotemark[\value{footnote}]Ifthereareinterveningfootnotesthenyoumustrememberthevalueofthecommonmark.Thisexamplegivesthesameinstitutionalaliationtoboththe rstandthirdauthors(\thanksisaversionoffootnote),by-handgivingthenumberofthefootnote.\title{ATreatiseontheBinomialTheorem}\author{JMoriarty\thanks{UniversityofLeeds}\andACDoyle\thanks{DurhamUniversity}\andSHolmes\footnotemark[1]}\begin{document}\maketitleThisusesacountertorememberthefootnotenumber.Thethirdsentenceisfollowedbythesamefootnotemarkerasthe rst.\newcounter{footnoteValueSaver} Chapter11:Footnotes100 Allbabiesareillogical.\footnote{%LewisCarroll.}\setcounter{footnoteValueSaver}{\value{footnote}}Nobodyisdespisedwhocanmanageacrocodile.\footnote{%CaptainHook.}Illogicalpersonsaredespised.\footnotemark[\value{footnoteValueSaver}]Therefore,anyonewhocanmanageacrocodileisnotababy.Thisexampleaccomplishesthesamebyusingthepackagecleveref.\usepackage{cleveref}[2012/02/15]%inpreamble\crefformat{footnote}{#2\footnotemark[#1]#3}...ThetheoremisfromEvers.\footnote{\label{fn:TE}Tinker,Evers,1994.}ThecorollaryisfromChance.\footnote{Evers,Chance,1990.}ButthekeylemmaisfromTinker.\cref{fn:TE}Itwillworkwiththepackagehyperref.11.3\footnotetextSynopsis,oneof:\footnotetext{text}\footnotetext[number]{text}Placetextatthebottomofthepageasafootnote.Itpairswith\footnotemark(see Section11.2[\footnotemark],page99 )andcancomeanywhereafterthatcommand,butmustappearinouterparagraphmode(see Chapter17[Modes],page151 ).Theoptionalargumentnumberchangesthenumberofthefootnotemark.See Section11.2[\footnotemark],page99, and Section11.5[Footnotesinatable],page100, forusageexamples.11.4FootnotesinsectionheadingsPuttingafootnoteinasectionheading,asin:\section{Fullsets\protect\footnote{Thismaterialdueto...}}causesthefootnotetoappearatthebottomofthepagewherethesectionstarts,asusual,butalsoatthebottomofthetableofcontents,whereitisnotlikelytobedesired.Thesimplestwaytohaveitnotappearonthetableofcontentsistousetheoptionalargumentto\section\section[Please]{Please\footnote{%Don'tfootnoteinchapterandsectionheaders!}}No\protectisneededinfrontof\footnoteherebecausewhatgetsmovedtothetableofcontentsistheoptionalargument.11.5FootnotesinatableInsideatabularorarrayenvironmentthe\footnotecommanddoesnotwork;thereisafootnotemarkinthetablecellbutthefootnotetextdoesnotappear.Thesolutionistouseaminipageenvironmentashere(see Section8.18[minipage],page63 ).\begin{center} Chapter11:Footnotes101 \begin{minipage}{\textwidth}\centering\begin{tabular}{l|l}\textsc{Ship}&\textsc{Book}\\\hline\textit{HMSSophie}&MasterandCommander\\\textit{HMSPolychrest}&PostCaptain\\\textit{HMSLively}&PostCaptain\\\textit{HMSSurprise}&Anumberofbooks\footnote{%StartingwithHMSSurprise.}\end{tabular}\end{minipage}\end{center}Insideaminipage,footnotemarksarelowercaseletters.Changethatwithsomethinglike\renewcommand{\thempfootnote}{\arabic{mpfootnote}}(see Section13.1[\alph\Alph\arabic\roman\Roman\fnsymbol],page116 ).Thefootnotesinthepriorexampleappearatthebottomoftheminipage.Tohavethemappearatthebottomofthemainpage,aspartoftheregularfootnotesequence,usethe\footnotemarkand\footnotetextpairandmakeanewcounter.\newcounter{mpFootnoteValueSaver}\begin{center}\begin{minipage}{\textwidth}\setcounter{mpFootnoteValueSaver}{\value{footnote}}\centering\begin{tabular}{l|l}\textsc{Woman}&\textsc{Relationship}\\\hlineMona&Attached\footnotemark\\DianaVilliers&Eventualwife\\ChristineHatherleighWood&Fiance\footnotemark\end{tabular}\end{minipage}%percentsignkeepsfootnotetextclosetominipage\stepcounter{mpFootnoteValueSaver}%\footnotetext[\value{mpFootnoteValueSaver}]{%Littleisknownotherthanherdeath.}%\stepcounter{mpFootnoteValueSaver}%\footnotetext[\value{mpFootnoteValueSaver}]{%RelationshipisunresolvedinXXI.}\end{center}Fora oatingtableenvironment(see Section8.22[table],page76 ),usethetablefootnotepackage.\usepackage{tablefootnote}%inpreamble...\begin{table}\centering\begin{tabular}{l|l}\textsc{Date}&\textsc{Campaign}\\\hline1862&FortDonelson\\1863&Vicksburg\\1865&ArmyofNorthernVirginia\tablefootnote{% Chapter11:Footnotes102 Endingthewar.}\end{tabular}\caption{ForcescapturedbyUSGrant}\end{table}Thefootnoteappearsatthepagebottomandisnumberedinsequencewithotherfootnotes.11.6FootnotesoffootnotesParticularlyinthehumanities,authorscanhavemultipleclassesoffootnotes,includinghavingfootnotesoffootnotes.ThepackagebigfootextendsLATEX'sdefaultfootnotemech-anisminmanyways,includingallowthesetwo,asinthisexample.\usepackage{bigfoot}%inpreamble\DeclareNewFootnote{Default}\DeclareNewFootnote{from}[alph]%createclass\footnotefrom{}...Thethirdtheoremisapartialconverseofthesecond.\footnotefrom{%FirstnotedinWilson.\footnote{Secondeditiononly.}} 103 12De nitionsLATEXhassupportformakingnewcommandsofmanydi erentkinds.12.1\newcommand&\renewcommandSynopses,oneof:\newcommand{\cmd}{defn}\newcommand{\cmd}[nargs]{defn}\newcommand{\cmd}[nargs][optargdefault]{defn}\newcommand*{\cmd}{defn}\newcommand*{\cmd}[nargs]{defn}\newcommand*{\cmd}[nargs][optargdefault]{defn}oroneofthese.\renewcommand{\cmd}[nargs]{defn}\renewcommand{\cmd}[nargs]{defn}\renewcommand{\cmd}[nargs][optargdefault]{defn}\renewcommand*{\cmd}{defn}\renewcommand*{\cmd}[nargs]{defn}\renewcommand*{\cmd}[nargs][optargdefault]{defn}De neorrede neacommand.Seealsothediscussionof\DeclareRobustCommandin Section3.3.2[Classandpackagecommands],page10 .Thestarredformofthesetworequiresthattheargumentsnotcontainmultipleparagraphsoftext(inplainTEXtermsthatitnotbe\long).Thesearetheparameters:cmdRequired;thecommandname.Itmustbeginwithabackslash,\,andmustnotbeginwiththefourletterstring\end.For\newcommand,itmustnotbealreadyde ned.For\renewcommand,thisnamemustalreadybede ned.nargsOptional;anintegerfrom0to9,specifyingthenumberofargumentsthatthecommandtakes,includinganyoptionalargument.Omittingthisargumentisthesameasspecifying0,meaningthatthecommandhasnoarguments.Ifyourede neacommand,thenewversioncanhaveadi erentnumberofargumentsthantheoldversion.optargdefaultOptional;ifthisargumentispresentthenthe rstargumentof\cmdisoptional,withdefaultvalueoptargdefault(whichmaybetheemptystring).Ifthisargumentisnotpresentthen\cmddoesnottakeanoptionalargument.Thatis,if\cmdisusedwithsquarebrackets,asin\cmd[optval]{...}...,thenwithindefntheparameter#1issettothevalueofoptval.Ontheotherhand,if\cmdiscalledwithoutthesquarebracketsthenwithindefntheparameter#1issettothevalueofoptargdefault.Ineithercase,therequiredargumentsstartwith#2. Chapter12:De nitions104 Omitting[optargdefault]isdi erentfromhavingthesquarebracketswithnocontents,asin[].Theformersets#1tothevalueofoptargdefault;thelattersets#1totheemptystring.defnRequired;thetexttobesubstitutedforeveryoccurrenceof\cmd.Theparam-eters#1,#2,...#nargsarereplacedbythevaluesthatyousupplywhenyoucallthecommand(orbythedefaultvalueifthereisanoptionalargumentandyoudon'texercisetheoption).TEXignoresspacesinthesourcefollowinganalphabeticcontrolsequence,asin`\cmd'.Ifyouactuallywantaspacethere,onesolutionistotype{}afterthecommand(`\cmd{}',andanothersolutionistouseanexplicitcontrolspace(`\cmd\').Asimpleexampleofde ninganewcommand:\newcommand{\RS}{RobinSmith}resultsin\RSbeingreplacedbythelongertext.Rede ninganexistingcommandissimilar:\renewcommand{\qedsymbol}{{\smallQED}}.Ifyoutrytode neacommandandthenamehasalreadybeenusedthenyougetsomethinglike`LaTeXError:Command\fredalreadydefined.Orname\end...illegal,seep.192ofthemanual'.Ifyoutrytorede neacommandandthenamehasnotyetbeenusedthenyougetsomethinglike`LaTeXError:\hankundefined'.Herethe rstcommandde nitionhasnoarguments,andthesecondhasonerequiredargument.\newcommand{\student}{Ms~O'Leary}\newcommand{\defref}[1]{Definition~\ref{#1}}Usethe rstasinIhighlyrecommend\student{}toyou.Thesecondhasavariable,sothat\defref{def:basis}expandstoDefinition~\ref{def:basis},whichultimatelyexpandstosomethinglike`Definition~3.14'.Similarly,butwithtworequiredarguments:\newcommand{\nbym}[2]{$#1\times#2$}isinvokedas\nbym{2}{k}.Thisexamplehasanoptionalargument.\newcommand{\salutation}[1][SirorMadam]{Dear#1:}Then\salutationgives`DearSirorMadam:'while\salutation[John]gives`DearJohn:'.And\salutation[]gives`Dear:'.Thisexamplehasanoptionalargumentandtworequiredarguments.\newcommand{\lawyers}[3][company]{#2,#3,and~#1}Iemploy\lawyers[Howe]{Dewey}{Cheatem}.Theoutputis`IemployDewey,Cheatem,andHowe'.Theoptionalargument,theHowe,isassociatedwith#1,whileDeweyandCheatemareassociatedwith#2and#3.Becauseoftheoptionalargument,\lawyers{Dewey}{Cheatem}willgivetheoutput`IemployDewey,Cheatem,andcompany'.Thebracesarounddefndonotde neagroup,thatis,theydonotdelimitthescopeoftheresultofexpandingdefn.Forexample,with\newcommand{\shipname}[1]{\it#1},inthissentence,The\shipname{Monitor}metthe\shipname{Merrimac}.thewords`metthe'wouldincorrectlybeinitalics.Thesolutionistoputanotherpairofbracesinsidethede nition:\newcommand{\shipname}[1]{{\it#1}}. Chapter12:De nitions105 12.2\providecommandSynopses,oneof:\providecommand{cmd}{defn}\providecommand{cmd}[nargs]{defn}\providecommand{cmd}[nargs][optargdefault]{defn}\providecommand*{cmd}{defn}\providecommand*{cmd}[nargs]{defn}\providecommand*{cmd}[nargs][optargdefault]{defn}De nesacommand,aslongasnocommandofthisnamealreadyexists.Ifnocommandofthisnamealreadyexiststhenthishasthesamee ectas\newcommand.Ifacommandofthisnamealreadyexiststhenthisde nitiondoesnothing.Thisisparticularlyusefulina lethatmaybeloadedmorethanonce,suchasastyle le.See Section12.1[\newcommand&\renewcommand],page103, forthedescriptionofthearguments.Thisexample\providecommand{\myaffiliation}{SaintMichael'sCollege}\providecommand{\myaffiliation}{SaintMichael'sCollege}From\myaffiliation.outputs`FromSaintMichael'sCollege'.Unlike\newcommand,therepeateduseof\providecommanddoesnotgiveanerror.12.3\makeatletter&\makeatotherSynopsis:\makeatletter...definitionofcommandswith@intheirname..\makeatotherUsethispairwhenyourede neLATEXcommandsthatarenamedwithanat-signcharac-ter`@'.The\makeatletterdeclarationmakestheat-signcharacterhavethecategorycodeofaletter,code11.The\makeatotherdeclarationsetsthecategorycodeoftheat-signtocode12,itsdefaultvalue.AsTEXreadscharacters,itassignseachoneacategorycode,orcatcode.Forinstance,itassignsthebackslashcharacter`\'thecatcode0.Commandnamesconsistofacategory0character,ordinarilybackslash,followedbyletters,category11characters(exceptthatacommandnamecanalsoconsistofacategory0characterfollowedbyasinglenon-lettersymbol).LATEX'ssourcecodehastheconventionthatsomecommandsuse@intheirname.Thesecommandsaremainlyintendedforpackageorclasswriters.Theconventionpreventsau-thorswhoarejustusingapackageorclassfromaccidentallyreplacingsuchacommandwithoneoftheirown,becausebydefaulttheat-signhascatcode12.Thepair\makeatletterand\makeatotherchangesthedefaultcodeandthenchangesitback.Usetheminsidea.tex le,inthepreamble,whenyouarede ningorrede ningcommandsnamedwith@,byhavingthemsurroundyourde nition.Don'tusetheseinside.styor.cls lessincethe\usepackageand\documentclasscommandsalreadyarrangethattheat-signhasthecharactercodeofaletter,catcode11. Chapter12:De nitions106 Foracomprehensivelistofmacroswithanat-signintheirnamessee http://ctan.org/pkg/macros2e .Inthisexampletheclass lehasacommand\thesis@universitynamethattheuserwantstochange.Thesethreelinesshouldgointhepreamble,beforethe\begin{document}.\makeatletter\renewcommand{\thesis@universityname}{SaintMichael'sCollege}\makeatother12.4\@ifstarSynopsis:\newcommand{\mycmd}{\@ifstar{\mycmd@star}{\mycmd@nostar}}\newcommand{\mycmd@nostar}[nostar-num-args]{nostar-body}\newcommand{\mycmd@star}[star-num-args]{star-body}ManystandardLATEXenvironmentsorcommandshaveavariantwiththesamenamebutendingwithastarcharacter*,anasterisk.Examplesarethetableandtable*environmentsandthe\sectionand\section*commands.Whende ningenvironments,followingthispatternisstraightforwardbecause\newenvironmentand\renewenvironmentallowtheenvironmentnametocontainastar.Forcommandsthesituationismorecomplex.Asinthesynopsisabove,therewillbeauser-calledcommand,givenaboveas\mycmd,whichpeeksaheadtoseeifitisfollowedbyastar.Forinstance,LATEXdoesnotreallyhavea\section*command;instead,the\sectioncommandpeeksahead.Thiscommanddoesnotacceptargumentsbutinsteadexpandstooneoftwocommandsthatdoacceptarguments.Inthesynopsisthesetwoare\mycmd@nostarand\mycmd@star.Theycouldtakethesamenumberofargumentsoradi erentnumber,ornoargumentsatall.Asalways,inaLATEXdocumentacommandusingat-sign@mustbeenclosedinsidea\makeatletter...\makeatotherblock(see Section12.3[\makeatletter&\makeatother],page105 ).Thisexampleof\@ifstarde nesthecommand\cielandavariant\ciel*.Bothhaveonerequiredargument.Acallto\ciel{night}willreturn"starrynightsky"while\ciel*{blue}willreturn"starrynotbluesky".\newcommand*{\ciel@unstarred}[1]{starry#1sky}\newcommand*{\ciel@starred}[1]{starrynot#1sky}\newcommand*{\ciel}{\@ifstar{\ciel@starred}{\ciel@unstarred}}Inthenextexample,thestarredvarianttakesadi erentnumberofargumentsthantheunstarredone.Withthisde nition,Agent007's``Mynameis\agentsecret*{Bond},\agentsecret{James}{Bond}.''isequivalenttoenteringthecommands``Mynameis\textsc{Bond},\textit{James}textsc{Bond}.''\newcommand*{\agentsecret@unstarred}[2]{\textit{#1}\textsc{#2}}\newcommand*{\agentsecret@starred}[1]{\textsc{#1}}\newcommand*{\agentsecret}{%\@ifstar{\agentsecret@starred}{\agentsecret@unstarred}}Therearetwosometimesmoreconvenientwaystoaccomplishtheworkof\@ifstar.Thesuffixpackageallowstheconstruct\newcommand\mycommand{unstarredversion} Chapter12:De nitions107 followedby\WithSuffix\newcommand\mycommand*{starredversion}.AndLATEX3hasthexparsepackagethatallowsthiscode.\NewDocumentCommand\foo{s}{\IfBooleanTF#1{starredversion}%{unstarredversion}%}12.5\newcounter:AllocatingacounterSynopsis,oneof:\newcounter{countername}\newcounter{countername}[supercounter]Globallyde nesanewcounternamedcounternameandinitializeittozero(see Chapter13[Counters],page116 ).Thenamecounternamemustconsistoflettersonly.Itdoesnotbeginwithabackslash.Thisnamemustnotalreadybeinusebyanothercounter.Whenyouusetheoptionalargument[supercounter]thenthecountercounternamewillberesettozerowheneversupercounterisincremented.Forexample,ordinarilysubsectionisnumberedwithinsectionsothatanytimeyouincrementsection,eitherwith\stepcounter(see Section13.7[\stepcounter],page119 )or\refstepcounter(see Section13.6[\refstepcounter],page118 ),thenLATEXwillresetsubsectiontozero.Thisexample\newcounter{asuper}\setcounter{asuper}{1}\newcounter{asub}[asuper]\setcounter{asub}{3}%Note`asuper'Thevalueofasuperis\arabic{asuper}andofasubis\arabic{asub}.\stepcounter{asuper}Nowasuperis\arabic{asuper}whileasubis\arabic{asub}.produces`Thevalueofasuperis1andthatofasubis3'and`Nowasuperis2whileasubis0'.Ifthecounteralreadyexists,forinstancebyenteringasupertwice,thenyougetsomethinglike`LaTeXError:Command\c@asuperalreadydefined.Orname\end...illegal,seep.192ofthemanual.'.Ifyouusetheoptionalargumentthenthesupercountermustalreadyexist.Entering\newcounter{jh}[lh]whenlhisnotade nedcounterwillgetyou`LaTeXError:Nocounter'lh'defined.'12.6\newlengthSynopsis:\newlength{arg}Allocateanewlengthregister(see Chapter14[Lengths],page120 ).Therequiredargumentargmustbeginwithabackslash,\.Thenewregisterholdsrubberlengthssuchas72.27ptor1inplus.2inminus.1in(aLATEXlengthregisteriswhatplainTEXcallsaskipregister).Theinitialvalueiszero.Thecontrolsequence\argmustnotbealreadyde ned. Chapter12:De nitions108 Anexample:\newlength{\graphichgt}Ifyouforgetthebackslashthenyouget`Missingcontrolsequenceinserted'.Ifthecommandsequencealreadyexiststhenyougetsomethinglike`LaTeXError:Command\graphichgtalreadydefined.Orname\end...illegal,seep.192ofthemanual'.12.7\newsaveboxSynopsis:\newsavebox{\cmd}De ne\cmd,thestringconsistingofabackslashfollowedbycmd,torefertoanewbinforstoringmaterial.Thesebinsholdmaterialthathasbeentypeset,tousemultipletimesortomeasureormanipulate(see Chapter20[Boxes],page169 ).Thebinname\cmdisrequired,muststartwithabackslash,\,andmustnotalreadybeade nedcommand.Thiscommandisfragile(see Section12.11[\protect],page113 ).Thisallocatesabinandthenputstypesetmaterialintoit.\newsavebox{\logobox}\savebox{\logobox}{LoGo}Ourlogois\usebox{\logobox}.Theoutputis`OurlogoisLoGo'.Ifthereisanalreadyde nedbinthenyougetsomethinglike`LaTeXError:Command\logoboxalreadydefined.Orname\end...illegal,seep.192ofthemanual'.Theallocationofaboxisglobal.12.8\newenvironment&\renewenvironmentSynopses,oneof:\newenvironment{env}{begdef}{enddef}\newenvironment{env}[nargs]{begdef}{enddef}\newenvironment{env}[nargs][optargdefault]{begdef}{enddef}\newenvironment*{env}{begdef}{enddef}\newenvironment*{env}[nargs]{begdef}{enddef}\newenvironment*{env}[nargs][optargdefault]{begdef}{enddef}oroneofthese.\renewenvironment{env}{begdef}{enddef}\renewenvironment{env}[nargs]{begdef}{enddef}\renewenvironment{env}[nargs][optargdefault]{begdef}{enddef}\renewenvironment*{env}{begdef}{enddef}\renewenvironment*{env}[nargs]{begdef}{enddef}\renewenvironment*{env}[nargs][optargdefault]{begdef}{enddef}De neorrede netheenvironmentenv,thatis,createtheconstruct\begin{env}...body...\end{env}.Thestarredformofthesecommandsrequiresthattheargumentsnotcontainmulti-pleparagraphsoftext.However,thebodyoftheseenvironmentscancontainmultipleparagraphs. Chapter12:De nitions109 envRequired;theenvironmentname.Itconsistsonlyoflettersorthe*character,andthusdoesnotbeginwithbackslash,\.Itmustnotbeginwiththestringend.For\newenvironment,thenameenvmustnotbethenameofanalreadyexistingenvironment,andalsothecommand\envmustbeunde ned.For\renewenvironment,envmustbethenameofanexistingenvironment.nargsOptional;anintegerfrom0to9denotingthenumberofargumentsofthattheenvironmenttakes.Whenyouusetheenvironmenttheseargumentsap-pearafterthe\begin,asin\begin{env}{arg1}...{argn}.Omittingthisisequivalenttosettingitto0;theenvironmentwillhavenoarguments.Whenrede ninganenvironment,thenewversioncanhaveadi erentnumberofar-gumentsthantheoldversion.optargdefaultOptional;ifthisispresentthenthe rstargumentofthede nedenvironmentisoptional,withdefaultvalueoptargdefault(whichmaybetheemptystring).Ifthisisnotinthede nitionthentheenvironmentdoesnottakeanoptionalargument.Thatis,whenoptargdefaultispresentinthede nitionoftheenviron-mentthenyoucanstarttheenvironmentwithsquarebrackets,asin\begin{env}[optval]{...}...\end{env}.Inthiscase,withinbegdefntheparameter#1issettothevalueofoptval.Ifyoucall\begin{env}withoutsquarebrackets,thenwithinbegdefntheparameter#1issettothevalueofthedefaultoptargdefault.Ineithercase,anyrequiredargumentsstartwith#2.Omitting[myval]inthecallisdi erentthanhavingthesquarebracketswithnocontents,asin[].Theformerresultsin#1expandingtooptargdefault;thelatterresultsin#1expandingtotheemptystring.begdefRequired;thetextexpandedateveryoccurrenceof\begin{env}.Withinbegdef,theparameters#1,#2,...#nargs,arereplacedbythevaluesthatyousupplywhenyoucalltheenvironment;seetheexamplesbelow.enddefRequired;thetextexpandedateveryoccurrenceof\end{env}.Thismaynotcontainanyparameters,thatis,youcannotuse#1,#2,etc.,here(butseethe nalexamplebelow).Allenvironments,thatistosaythebegdefcode,theenvironmentbody,andtheenddefcode,areprocessedwithinagroup.Thus,inthe rstexamplebelow,thee ectofthe\smallislimitedtothequoteanddoesnotextendtomaterialfollowingtheenvironment.Ifyoutrytode neanenvironmentandthenamehasalreadybeenusedthenyougetsomethinglike`LaTeXError:Command\fredalreadydefined.Orname\end...illegal,seep.192ofthemanual'.Ifyoutrytorede neanenvironmentandthenamehasnotyetbeenusedthenyougetsomethinglike`LaTeXError:Environmenthankundefined.'.ThisexamplegivesanenvironmentlikeLATEX'squotationexceptthatitwillbesetinsmallertype.\newenvironment{smallquote}{%\small\begin{quotation} Chapter12:De nitions110 }{%\end{quotation}}Thishasanargument,whichissetinboldfaceatthestartofaparagraph.\newenvironment{point}[1]{%\noindent\textbf{#1}}{%}Thisoneshowstheuseofaoptionalargument;itgivesaquotationenvironmentthatcitestheauthor.\newenvironment{citequote}[1][Shakespeare]{%\begin{quotation}\noindent\textit{#1}:}{%\end{quotation}}Theauthor'snameisoptional,anddefaultsto`Shakespeare'.Inthedocument,usetheenvironmentlikethis.\begin{citequote}[Lincoln]...\end{citequote}The nalexampleshowshowtosavethevalueofanargumenttouseinenddef,inthiscaseinabox(see Section20.5[\sbox&\savebox],page173 ).\newsavebox{\quoteauthor}\newenvironment{citequote}[1][Shakespeare]{%\sbox\quoteauthor{#1}%\begin{quotation}}{%\hspace{1emplus1fill}---\usebox{\quoteauthor}\end{quotation}}12.9\newtheoremSynopses:\newtheorem{name}{title}\newtheorem{name}{title}[numbered_within]\newtheorem{name}[numbered_like]{title}De neanewtheorem-likeenvironment.Youcanspecifyoneofnumbered withinandnumbered like,orneither,butnotboth.The rstform,\newtheorem{name}{title},createsanenvironmentthatwillbelabelledwithtitle;seethe rstexamplebelow.Thesecondform,\newtheorem{name}{title}[numbered_within],createsanenviron-mentwhosecounterissubordinatetotheexistingcounternumbered within,sothiscounterwillberesetwhennumbered withinisreset.Seethesecondexamplebelow. Chapter12:De nitions111 Thethirdform\newtheorem{name}[numbered_like]{title},withoptionalargumentbetweenthetworequiredarguments,createsanenvironmentwhosecounterwillsharethepreviouslyde nedcounternumbered like.Seethethirdexample.Thiscommandcreatesacounternamedname.Inaddition,unlesstheoptionalargumentnumbered likeisused,insideofthetheorem-likeenvironmentthecurrent\refvaluewillbethatof\thenumbered_within(see Section7.3[\ref],page42 ).Thisdeclarationisglobal.Itisfragile(see Section12.11[\protect],page113 ).Arguments:nameThenameoftheenvironment.Itisastringofletters.Itmustnotbeginwithabackslash,\.Itmustnotbethenameofanexistingenvironment,andthecommandname\namemustnotalreadybede ned.titleThetexttobeprintedatthebeginningoftheenvironment,beforethenumber.Forexample,`Theorem'.numbered withinOptional;thenameofanalreadyde nedcounter,usuallyasectionalunitsuchaschapterorsection.Whenthenumbered withincounterisresetthenthenameenvironment'scounterwillalsobereset.Ifthisoptionalargumentisnotusedthenthecommand\thenameissetto\arabic{name}.numbered likeOptional;thenameofanalreadyde nedtheorem-likeenvironment.Thenewenvironmentwillbenumberedinsequencewithnumbered like.Withoutanyoptionalargumentstheenvironmentsarenumberedsequentially.Theexamplebelowhasadeclarationinthepreamblethatresultsin`Definition1'and`Definition2'intheoutput.\newtheorem{defn}{Definition}\begin{document}\section{...}\begin{defn}Firstdef\end{defn}\section{...}\begin{defn}Seconddef\end{defn}Thisexamplehasthesamedocumentbodyasthepriorone.Buthere\newtheorem'soptionalargumentnumbered withinisgivenassection,sotheoutputislike`Definition1.1'and`Definition2.1'.\newtheorem{defn}{Definition}[section]\begin{document}\section{...}\begin{defn} Chapter12:De nitions112 Firstdef\end{defn}\section{...}\begin{defn}Seconddef\end{defn}Inthenextexampletherearetwodeclarationsinthepreamble,thesecondofwhichcallsforthenewthmenvironmenttousethesamecounterasdefn.Itgives`Definition1.1',followedby`Theorem2.1'and`Definition2.2'.\newtheorem{defn}{Definition}[section]\newtheorem{thm}[defn]{Theorem}\begin{document}\section{...}\begin{defn}Firstdef\end{defn}\section{...}\begin{thm}Firstthm\end{thm}\begin{defn}Seconddef\end{defn}12.10\newfontThiscommandisobsolete.Thisdescriptionishereonlytohelpwitholddocuments.Newdocumentsshouldde nefontsinfamiliesthroughtheNewFontSelectionSchemewhichallowsyouto,forexample,associateaboldfacewitharoman(see Chapter4[Fonts],page16 ).Synopsis:\newfont{\cmd}{fontdescription}De neacommand\cmdthatwillchangethecurrentfont.Thecontrolsequencemustnotalreadybede ned.Itmustbeginwithabackslash,\.Thefontdescriptionconsistsofafontnameandanoptionalatclause.LATEXwilllookonyoursystemfora lenamedfontname.tfm.Theatclausecanhavetheformeitheratdimenorscaledfactor,whereafactorof`1000'meansnoscaling.ForLATEX'spurposes,allthisdoesisscaleallthecharacterandotherfontdimensionsrelativetothefont'sdesignsize,whichisavaluede nedinthe.tfm le.Thisde nestwoequivalentfontsandtypesetsafewcharactersineach.\newfont{\testfontat}{cmb10at11pt}\newfont{\testfontscaled}{cmb10scaled1100} Chapter12:De nitions113 \testfontatabc\testfontscaledabc12.11\protectAllLATEXcommandsareeitherfragileorrobust.Afragilecommandcanbreakwhenitisusedintheargumenttocertainothercommands.CommandsthatcontaindatathatLATEXwritestoanauxiliary leandre-readslaterarefragile.Thisincludesmaterialthatgoesintoatableofcontents,listof gures,listoftables,etc.Fragilecommandsalsoincludelinebreaks,anycommandthathasanoptionalargument,andmanymore.Topreventsuchcommandsfrombreaking,onesolutionistoprecededthemwiththecommand\protect.Forexample,whenLATEXrunsthe\section{sectionname}commanditwritesthesec-tionnametexttothe.auxauxiliary le,movingitthereforuseelsewhereinthedocumentsuchasinthetableofcontents.AnyargumentthatisinternallyexpandedbyLATEXwithouttypesettingitdirectlyisreferredtoasamovingargument.AcommandisfragileifitcanexpandduringthisprocessintoinvalidTEXcode.Someexamplesofmovingargumentsarethosethatappearinthe\caption{...}command(see Section8.10[ gure],page52 ),inthe\thanks{...}command(see Section18.1[\maketitle],page153 ),andin@-expressionsinthetabularandarrayenvironments(see Section8.23[tabular],page77 ).Ifyougetstrangeerrorsfromcommandsusedinmovingarguments,tryprecedingitwith\protect.Everyfragilecommandsmustbeprotectedwiththeirown\protect.Althoughusuallya\protectcommanddoesn'thurt,lengthcommandsarerobustandshouldnotbeprecededbya\protectcommand.Norcana\protectcommandbeusedintheargumentto\addtocounteror\setcountercommand.Inthisexamplethe\captioncommandgivesamysteriouserroraboutanextracurlybrace.Fixtheproblembyprecedingeach\raiseboxcommandwith\protect.\begin{figure}...\caption{CompanyheadquartersofA\raisebox{1pt}{B}\raisebox{-1pt}{C}}\end{figure}Inthenextexamplethe\tableofcontentscommandgivesanerrorbecausethe\(..\)inthesectiontitleexpandstoillegalTEXinthe.toc le.Youcansolvethisbychanging\(..\)to\protect\(..\protect\).\begin{document}\tableofcontents...\section{Einstein's\(e=mc^2\)}...12.12\ignorespaces&\ignorespacesafterendSynopsis:\ignorespacesor\ignorespacesafterend Chapter12:De nitions114 BothcommandscauseLATEXtoignorespacesaftertheendofthecommandupuntilthe rstnon-spacecharacter.The rstisacommandfromPlainTEX,andthesecondisLATEX-speci c.Theignorespacesisoftenusedwhende ningcommandsvia\newcommand,or\newenvironment,or\def.Theexamplebelowillustrates.Itallowsausertoshowthepointsvaluesforquizquestionsinthemarginbutitisinconvenientbecause,asshownintheenumeratelist,usersmustnotputanyspacebetweenthecommandandthequestiontext.\newcommand{\points}[1]{\makebox[0pt]{\makebox[10em][l]{#1~pts}}\begin{enumerate}\item\points{10}noextraspaceoutputhere\item\points{15}extraspacebetweenthenumberandthe`extra'\end{enumerate}Thesolutionistochangetothis.\newcommand{\points}[1]{%\makebox[0pt]{\makebox[10em][l]{#1~pts}}\ignorespaces}Asecondexampleshowsspacesbeingremovedfromthefrontoftext.Thecommandsbelowallowausertouniformlyattachatitletonames.But,asgiven,ifatitleaccidentallystartswithaspacethen\fullnamewillreproducethat.\makeatletter\newcommand{\honorific}[1]{\def\@honorific{#1}}%remembertitle\newcommand{\fullname}[1]{\@honorific~#1}%puttitlebeforename\makeatother\begin{tabular}{|l|}\honorific{Mr/Ms}\fullname{Jones}\\%noextraspacehere\honorific{Mr/Ms}\fullname{Jones}%extraspacebeforetitle\end{tabular}To xthis,changeto\newcommand{\fullname}[1]{\ignorespaces\@honorific~#1}.The\ignorespacesisalsooftenusedina\newenvironmentattheendofthebe-ginclause,thatis,aspartofthesecondargument,asin\begin{newenvironment}{envname}{...\ignorespaces}{...}.Tostripspaceso theendofanenvironmentuse\ignorespacesafterend.Anexampleisthatthiswillshowamuchlargerverticalspacebetweenthe rstandsecondenvironmentsthanbetweenthesecondandthird.\newenvironment{eq}{\begin{equation}}{\end{equation}}\begin{eq}e=mc^2\end{eq}\begin{equation}F=ma\end{equation}\begin{equation}E=IR\end{equation} 115 Puttingacommentcharacter%immediatelyafterthe\end{eq}willmaketheverticalspacedisappear,butthatisinconvenient.Thesolutionistochangeto\newenvironment{eq}{\begin{equation}}{\end{equation}\ignorespacesafterend}. 116 13CountersEverythingLATEXnumbersforyouhasacounterassociatedwithit.Thenameofthecounterisoftenthesameasthenameoftheenvironmentorcommandassociatedwiththenumber,exceptthatthecounter'snamehasnobackslash\.Thus,associatedwiththe\chaptercommandisthechaptercounterthatkeepstrackofthechapternumber.BelowisalistofthecountersusedinLATEX'sstandarddocumentclassestocontrolnumbering.partparagraphfigureenumichaptersubparagraphtableenumiisectionpagefootnoteenumiiisubsectionequationmpfootnoteenumivsubsubsectionThempfootnotecounterisusedbythe\footnotecommandinsideofaminipage(see Section8.18[minipage],page63 ).Thecountersenumithroughenumivareusedintheenumerateenvironment,foruptofourlevelsofnesting(see Section8.7[enumerate],page49 ).Counterscanhaveanyintegervaluebuttheyaretypicallypositive.Newcountersarecreatedwith\newcounter.See Section12.5[\newcounter],page107 .13.1\alph\Alph\arabic\roman\Roman\fnsymbol:PrintingcountersPrintthevalueofacounter,inaspeci edstyle.Forinstance,ifthecountercounterhasthevalue1thena\alph{counter}inyoursourcewillresultinalowercaseletteraappearingintheoutput.Allofthesecommandstakeasinglecounterasanargument,forinstance,\alph{enumi}.Notethatthecounternamedoesnotstartwithabackslash.\alph{counter}Printthevalueofcounterinlowercaseletters:`a',`b',...Ifthecounter'svalueislessthan1ormorethan26thenyouget`LaTeXError:Countertoolarge.'\Alph{counter}Printinuppercaseletters:`A',`B',...Ifthecounter'svalueislessthan1ormorethan26thenyouget`LaTeXError:Countertoolarge.'\arabic{counter}PrintinArabicnumberssuchas`5'or`-2'.\roman{counter}Printinlowercaseromannumerals:`i',`ii',...Ifthecounter'svalueislessthan1thenyougetnowarningorerrorbutLATEXdoesnotprintanythingintheoutput.\Roman{counter}Printinuppercaseromannumerals:`I',`II',...Ifthecounter'svalueislessthan1thenyougetnowarningorerrorbutLATEXdoesnotprintanythingintheoutput. Chapter13:Counters117 \fnsymbol{counter}Printsthevalueofcounterusingasequenceofninesymbolsthataretradi-tionallyusedforlabelingfootnotes.Thevalueofcountershouldbebetween1and9,inclusive.Ifthecounter'svalueislessthan0ormorethan9thenyouget`LaTeXError:Countertoolarge',whileifitis0thenyougetnoerrororwarningbutLATEXdoesnotoutputanything.Herearethesymbols:NumberNameCommandSymbol1asterisk\ast\ast2dagger\daggery3ddagger\ddaggerz4section-sign\Sx5paragraph-sign\P{6double-vert\parallelk7double-asterisk\ast\ast\ast\ast8double-dagger\dagger\daggeryy9double-ddagger\ddagger\ddaggerzz13.2\usecounterSynopsis:\usecounter{counter}Usedinthesecondargumentofthelistenvironment(see Section8.16[list],page57 ),thisdeclaresthatlistitemswillbenumberedbycounter.Itinitializescountertozero,andarrangesthatwhen\itemiscalledwithoutitsoptionalargumentthencounterisincrementedby\refstepcounter,makingitsvaluebethecurrentrefvalue(see Section7.3[\ref],page42 ).Thiscommandisfragile(see Section12.11[\protect],page113 ).Putinthedocumentpreamble,thisexamplemakesanewlistenvironmentenumeratedwithtestcounter:\newcounter{testcounter}\newenvironment{test}{%\begin{list}{}{%\usecounter{testcounter}}}{%\end{list}}13.3\valueSynopsis:\value{counter}Expandstothevalueofthecountercounter.(Notethatthenameofacounterdoesnotbeginwithabackslash.) Chapter13:Counters118 Thisexampleoutputs`Testcounteris6.Othercounteris5.'.\newcounter{test}\setcounter{test}{5}\newcounter{other}\setcounter{other}{\value{test}}\addtocounter{test}{1}Testcounteris\arabic{test}.Othercounteris\arabic{other}.The\valuecommandisnotusedfortypesettingthevalueofthecounter.Forthat,see Section13.1[\alph\Alph\arabic\roman\Roman\fnsymbol],page116 .Itisoftenusedin\setcounteror\addtocounterbut\valuecanbeusedanywherethatLATEXexpectsanumber,suchasin\hspace{\value{foo}\parindent}.Itmustnotbeprecededby\protect(see Section12.11[\protect],page113 ).Thisexampleinserts\hspace{4\parindent}.\setcounter{myctr}{3}\addtocounter{myctr}{1}\hspace{\value{myctr}\parindent}13.4\setcounterSynopsis:\setcounter{counter}{value}Globallysetthecountercountertohavethevalueofthevalueargument,whichmustbeaninteger.Thus,youcansetacounter'svalueas\setcounter{section}{5}.Notethatthecounternamedoesnotstartwithabackslash.Inthisexampleifthecountertheoremhasvalue12thenthesecondlinewillprint`XII'.\setcounter{exercise}{\value{theorem}}HereitisinRoman:\Roman{exercise}.13.5\addtocounterSynopsis:\addtocounter{counter}{valueGloballyincrementcounterbytheamountspeci edbythevalueargument,whichmaybenegative.Inthisexamplethesectionvalueappearsas`VII'.\setcounter{section}{5}\addtocounter{section}{2}HereitisinRoman:\Roman{section}.13.6\refstepcounterSynopsis:\refstepcounter{counter}Globallyincrementsthevalueofcounterbyone,asdoes\stepcounter(see Section13.7[\stepcounter],page119 ).Thedi erenceisthatthiscommandresetsthevalueofany Chapter13:Counters119 counternumberedwithinit.(Forthede nitionof\countersnumberedwithin",see Section12.5[\newcounter],page107 .)Inaddition,thiscommandalsode nesthecurrent\refvaluetobetheresultof\thecounter.Whilethecountervalueissetglobally,the\refvalueissetlocally,i.e.,insidethecurrentgroup.13.7\stepcounterSynopsis:\stepcounter{counter}Globallyaddsonetocounterandresetsallcountersnumberedwithinit.(Forthede nitionof\countersnumberedwithin",see Section12.5[\newcounter],page107 .)Thiscommanddi ersfrom\refstepcounterinthatthisonedoesnotin uenceref-erences|itdoesnotde nethecurrent\refvaluetobetheresultof\thecounter(see Section13.6[\refstepcounter],page118 ).13.8\day&\month&\yearLATEXde nesthecounter\dayforthedayofthemonth(nominallywithvaluebetween1and31),\monthforthemonthoftheyear(nominallywithvaluebetween1and12),andyear\year.WhenTEXstartsup,theyaresetfromthecurrentvaluesonthesystem.Therelatedcommand\todayproducesastringrepresentingthecurrentday(see Section23.8[\today],page197 ).Theycountersarenotupdatedasthejobprogressessoinprincipletheycouldbeincor-rectbytheend.Inaddition,TEXdoesnosanitycheck:\day=-2\month=13\year=-4\todaygivesnoerrororwarningandresultsintheoutput`-2,-4'(thebogusmonthvalueproducesnooutput). 120 14LengthsAlengthisameasureofdistance.ManyLATEXcommandstakealengthasanargument.Lengthscomeintwotypes.Arigidlengthsuchas10ptdoesnotcontainaplusorminuscomponent.(PlainTEXcallsthisadimen.)Arubberlength(whatPlainTEXcallsaskip)suchasaswith1cmplus0.05cmminus0.01cmcancontaineitherorbothofthosecomponents.Inthatrubberlength,the1cmisthenaturallengthwhiletheothertwo,theplusandminuscomponents,allowTEXtostretchorshrinkthelengthtooptimizeplacement.Theillustrationsbelowusethesetwocommands.%makeablackbar10pttalland#1wide\newcommand{\blackbar}[1]{\rule{#1}{10pt}}%Makeaboxaround#2thatis#1wide(excludingtheborder)\newcommand{\showhbox}[2]{%\fboxsep=0pt\fbox{\hboxto#1{#2}}}Thisexampleusesthosecommandstoshowablackbar100pointslongbetween`XXX'and`YYY'.Thislengthisrigid.XXX\showhbox{100pt}{\blackbar{100pt}}YYYAsforrubberlengths,shrinkingissimplerone:with1cmminus0.05cm,thenaturallengthis1cmbutTEXcanshrinkitdownasfaras0.95cm.Beyondthat,TEXrefusestoshrinkanymore.Thus,belowthe rstoneworks ne,producingaspaceof98pointsbetweenthetwobars.XXX\showhbox{300pt}{%\blackbar{101pt}\hspace{100ptminus2pt}\blackbar{101pt}}YYYXXX\showhbox{300pt}{%\blackbar{105pt}\hspace{100ptminus1pt}\blackbar{105pt}}YYYButthesecondonegetsawarninglike`Overfull\hbox(1.0pttoowide)detectedatline17'.Intheoutputthe rst`Y'isoverwrittenbytheendoftheblackbar,becausethebox'smaterialiswiderthanthe300ptallocated,asTEXhasrefusedtoshrinkthetotaltolessthan309points.StretchingislikeshrinkingexceptthatifTEXisaskedtostretchbeyondthegivenamount,itwilldoit.Herethe rstlineis ne,producingaspaceof110pointsbetweenthebars.XXX\showhbox{300pt}{%\blackbar{95pt}\hspace{100ptplus10pt}\blackbar{95pt}}YYYXXX\showhbox{300pt}{%\blackbar{95pt}\hspace{100ptplus1pt}\blackbar{95pt}}YYYInthesecondlineTEXneedsastretchof10pointsandonly1pointwasspeci ed.TEXstretchesthespacetotherequiredlengthbutitgivesyouawarninglike`Underfull\hbox(badness10000)detectedatline22'.(Wewon'tdiscussbadness.) Chapter14:Lengths121 Youcanputbothstretchandshrinkinthesamelength,asin1explus0.05exminus0.02ex.IfTEXissettingtwoormorerubberlengthsthenitallocatesthestretchorshrinkinproportion.XXX\showhbox{300pt}{%\blackbar{100pt}%left\hspace{0ptplus50pt}\blackbar{80pt}\hspace{0ptplus10pt}%middle\blackbar{100pt}}YYY%rightTheleftandrightbarstakeup100points,sothemiddleneedsanother100.Themiddlebaris80pointssothetwo\hspace'smuststretch20points.Becausethetwoareplus50ptandplus10pt,TEXgets5/6ofthestretchfromthe rstspaceand1/6fromthesecond.Theplusorminuscomponentofarubberlengthcancontaina llcomponent,asin1inplus2fill.Thisgivesthelengthin nitestretchabilityorshrinkabilitysothatTEXcouldsetittoanydistance.Herethetwo gureswillbeequal-spacedacrossthepage.\begin{minipage}{\linewidth}\hspace{0ptplus1fill}\includegraphics{godel.png}%\hspace{0ptplus1fill}\includegraphics{einstein.png}%\hspace{0ptplus1fill}\end{minipage}TEXactuallyhasthreelevelsofin nityforgluecomponents:fil,fill,andfilll.Thelateronesaremorein nitethantheearlierones.Ordinarilydocumentauthorsonlyusethemiddleone(see Section19.3[\h ll],page158, andsee Section19.15[\v ll],page167 ).Multiplyingarubberlengthbyanumberturnsitintoarigidlength,sothatafter\setlength{\ylength}{1inplus0.2in}and\setlength{\zlength}{3\ylength}thenthevalueof\zlengthis3in.14.1UnitsoflengthTEXandLATEXknowabouttheseunitsbothinsideandoutsideofmathmode.ptPoint,1/72.27inch.Theconversiontometricunits,totwodecimalplaces,is1point=2.85mm=28.45cm.pcPica,12ptinInch,72.27ptbpBigpoint,1/72inch.Thislengthisthede nitionofapointinPostScriptandmanydesktoppublishingsystems.cmCentimetermmMillimeterddDidotpoint,1.07ptccCicero,12ddspScaledpoint,1/65536pt Chapter14:Lengths122 Twootherlengthsthatareoftenusedarevaluessetbythedesignerofthefont.Thex-heightofthecurrentfontex,traditionallytheheightofthelowercaseletterx,isoftenusedforverticallengths.Similarlyem,traditionallythewidthofthecapitalletterM,isoftenusedforhorizontallengths(thereisalso\enspace,whichis0.5em).Useofthesecanhelpmakeade nitionworkbetteracrossfontchanges.Forexample,ade nitionoftheverticalspacebetweenlistitemsgivenas\setlength{\itemsep}{1explus0.05exminus0.01ex}ismorelikelytostillbereasonableifthefontischangedthanade nitiongiveninpoints.Inmathmode,manyde nitionsareexpressedintermsofthemathunitmugivenby1em=18mu,wheretheemistakenfromthecurrentmathsymbolsfamily.See Section16.6[Spacinginmathmode],page146 .14.2\setlengthSynopsis:\setlength{len}{amount}Setthelengthlentoamount.Thelengthnamelenmustbeginwithabackslash,\.Theamountcanbearubberlength(see Chapter14[Lengths],page120 ).Itcanbepositive,negativeorzero,andcanbeinanyunitsthatLATEXunderstands(see Section14.1[Unitsoflength],page121 ).Below,withLATEX'sdefaultsthe rstparagraphwillbeindentedwhilethesecondwillnot.ItoldthedoctorIbrokemylegintwoplaces.\setlength{\parindent}{0em}Hesaidstopgoingtothoseplaces.Ifyoudidnotdeclarelenwith\newlength,forexampleifyoumistypetheaboveas\newlength{\specparindent}\setlength{\sepcparindent}{...},thenyougetanerrorlike`Undefinedcontrolsequence. rgu;&#xment;\sepcindent'.Ifyouomitthebackslashatthestartofthelengthnamethenyougetanerrorlike`Missingnumber,treatedaszero.beread&#xto-3;㐀again\relaxl.19\setlength{specparindent}{0.6\parindent}'14.3\addtolengthSynopsis:\addtolength{len}{amount}Incrementthelengthlenbyamount.Thelengthnamelenbeginswithabackslash,\.Theamountisarubberlength(see Chapter14[Lengths],page120 ).Itcanbepositive,negativeorzero,andcanbeinanyunitsthatLATEXunderstands(see Section14.1[Unitsoflength],page121 ).Below,if\parskipstartswiththevalue0ptplus1ptDoctor:howistheboywhoswallowedthesilverdollar?\addtolength{\parskip}{1pt}Nurse:nochange. Chapter14:Lengths123 thenithasthevalue1ptplus1ptforthesecondparagraph.Ifyoudidnotdeclarethelengthlenwith\newlength,ifforexampleyoumistypetheaboveas\addtolength{\specparindent}{0.6\praindent},thenyougetsomethinglike`Undefinedcontrolsequence. rgu;&#xment;\praindent'.Ifyouleaveo thebackslashatthestartoflen,asin\addtolength{parindent}{1pt},thenyougetsomethinglike`Youcan'tuse`theletterp'after\advance'.14.4\settodepthSynopsis:\settodepth{len}{text}SetthelengthlentothedepthofboxthatLATEXgetsontypesettingthetextargument.Thelengthnamelenmustbeginwithabackslash,\.Thiswillshowhowlowthecharacterdescendersgo.\newlength{\alphabetdepth}\settodepth{\alphabetdepth}{abcdefghijklmnopqrstuvwxyz}\the\alphabetdepthIfyoudidnotsetasidethelengthlen,ifforexampleyoumistypetheaboveas\settodepth{\aplhabetdepth}{abc...},thenyougetsomethinglike`Undefinedcontrolsequence. rgu;&#xment;\aplhabetdepth'.Ifyouleavethebackslashoutoflen,asin\settodepth{alphabetdepth}{...}thenyougetsomethinglike`Missingnumber,treatedaszero.beread&#xto-3;㌀again\setbox'.14.5\settoheightSynopsis:\settoheight{len}{text}SetsthelengthlentotheheightofboxthatLATEXgetsontypesettingthetextargument.Thelengthnamelenmustbeginwithabackslash,\.Thiswillshowhowhighthecharactersgo.\newlength{\alphabetheight}\settoheight{\alphabetheight}{abcdefghijklmnopqrstuvwxyz}\the\alphabetheightIfnosuchlengthlenhasbeendeclaredwith\newlength,ifforexampleyoumistypeas\settoheight{\aplhabetheight}{abc...},thenyougetsomethinglike`Undefinedcontrolsequence. rgu;&#xment;\alphabetheight'.Ifyouleavethebackslashoutoflen,asin\settoheight{alphabetheight}{...}thenyougetsomethinglike`Missingnumber,treatedaszero.beread&#xto-3;㌀again\setbox'.14.6\settowidthSynopsis:\settowidth{len}{text}SetthelengthlentothewidthoftheboxthatLATEXgetsontypesettingthetextargument.Thelengthnamelenmustbeginwithabackslash,\. 124 ThismeasuresthewidthofthelowercaseASCIIalphabet.\newlength{\alphabetwidth}\settowidth{\alphabetwidth}{abcdefghijklmnopqrstuvwxyz}\the\alphabetwidthIfnosuchlengthlenhasbeensetaside,ifforexampleyoumistypetheaboveas\settowidth{\aplhabetwidth}{abc...},thenyougetsomethinglike`Undefinedcontrolsequence. rgu;&#xment;\aplhabetwidth'.Ifyouleavethebackslashoutoflen,asin\settoheight{alphabetwidth}{...}thenyougetsomethinglike`Missingnumber,treatedaszero.beread&#xto-3;㐀again\setbox'. 125 15MakingparagraphsTostartaparagraph,justtypesometext.Toendthecurrentparagraph,putanemptyline.Thisisthreeparagraphs,separatedbytwoemptylines.Itisatruthuniversallyacknowledged,thatasinglemaninpossessionofagoodfortune,mustbeinwantofawife.Howeverlittleknownthefeelingsorviewsofsuchamanmaybeonhisfirstenteringaneighbourhood,thistruthissowellfixedinthemindsofthesurroundingfamilies,thatheisconsideredtherightfulpropertyofsomeoneorotheroftheirdaughters.``MydearMr.Bennet,''saidhisladytohimoneday,``haveyouheardthatNetherfieldParkisletatlast?''Theseparatorlinesmustbeempty,includingnotcontainingacommentcharacter,%.OnceLATEXhasgatheredallofaparagraph'scontentsitdividesthatcontentintolinesinawaythatisoptimizedovertheentireparagraph(see Chapter9[Linebreaking],page90 ).Thereareplaceswhereanewparagraphisnotpermitted.Don'tputablanklineinmathmode(see Chapter17[Modes],page151 );herethelinebeforethe\end{equation}\begin{equation}2^{|S|}�|S|\end{equation}willgetyoutheerror`Missing$inserted'.Similarly,theblanklineinthissectionargument\section{aaabbb}gets`Runawayargument?{aaa!Paragraphendedbefore\@sectwascomplete'.15.1\parSynopsis(notethatwhilereadingtheinputTEXconvertstwoconsecutivenewlinestoa\par):\parEndthecurrentparagraph.Theusualwaytoseparateparagraphsiswithablanklinebutthe\parcommandisentirelyequivalent.Thiscommandisrobust(see Section12.11[\protect],page113 ).Thisexampleuses\parratherthanablanklinesimplyforreadability.\newcommand{\syllabusLegalese}{%\whatCheatingIs\par\whatHappensWhenICatchYou}InLRmodeoraverticalmodethe\parcommanddoesnothingbutitterminatesparagraphmode,switchingLATEXtoverticalmode(see Chapter17[Modes],page151 ). Chapter15:Makingparagraphs126 Youcannotusethe\parcommandinamathmode.Youalsocannotuseitintheargumentofmanycommands,suchasthe\sectioncommand(see Chapter15[Makingparagraphs],page125, and Section12.1[\newcommand&\renewcommand],page103 ).The\parcommandisnotthesameasthe\paragraphcommand.Thelatteris,like\sectionor\subsection,asectioningunitusedbythestandardLATEXdocuments(see Section6.5[\subsubsection&\paragraph&\subparagraph],page35 ).The\parcommandisnotthesameas\newlineorthelinebreakdoublebackslash,\\.Thedi erenceisthat\parendstheparagraph,notjusttheline,andalsotriggerstheadditionofthebetween-paragraphverticalspace\parskip(see Section15.3[\parindent&\parskip],page127 ).Theoutputfromthisexamplexyz\setlength{\parindent}{3in}\setlength{\parskip}{5in}\noindenttest\indenttest1\partest2is:after`xyz'thereisaverticalskipof5inchesandthen`test'appears,alignedwiththeleftmargin.Onthesameline,thereisanemptyhorizontalspaceof3inchesandthen`test1'appears.Finally.thereisaverticalspaceof5inches,followedbyafreshparagraphwithaparagraphindentof3inches,andthenLATEXputsthetext`test2'.15.2\indent&\noindentSynopsis:\indentor\noindentGointohorizontalmode(see Chapter17[Modes],page151 ).The\indentcommand rstoutputsanemptyboxwhosewidthis\parindent.Thesecommandsarerobust(see Section12.11[\protect],page113 ).Ordinarilyyoucreateanewparagraphbyputtinginablankline.See Section15.1[\par],page125, forthedi erencebetweenthiscommandand\par.Tostartaparagraphwithoutanindent,ortocontinueaninterruptedparagraph,use\noindent.Inthemiddleofaparagraphthe\noindentcommandhasnoe ect,becauseLATEXisalreadyinhorizontalmodethere.The\indentcommand'sonlye ectistooutputaspace.Thisexamplestartsafreshparagraph....endofthepriorparagraph.\noindentThisparagraphisnotindented.andthiscontinuesaninterruptedparagraph.Thedata\begin{center}\begin{tabular}{rl}...\end{tabular} Chapter15:Makingparagraphs127 \end{center}\noindentshowsthisclearly.Toomitindentationintheentiredocumentput\setlength{\parindent}{0pt}inthepreamble.Ifyoudothat,youmaywanttoalsosetthelengthofspacesbetweenparagraphs,\parskip(see Section15.3[\parindent&\parskip],page127 ).DefaultLATEXstyleshavethe rstparagraphafterasectionthatisnotindented,asistraditionaltypesettinginEnglish.Tochangethat,lookonCTANforthepackageindentfirst.15.3\parindent&\parskipSynopsis:\setlength{\parskip}{horizontallen}\setlength{\parinden}{verticallen}Botharearubberlengths(see Chapter14[Lengths],page120 ).Theygivetheindenta-tionofordinaryparagraphs,notparagraphsinsideminipages(see Section8.18[minipage],page63 ),andtheverticalspacebetweenparagraphs.This,putinthepreamble,\setlength{\parindent}{0em}\setlength{\parskip}{1ex}arrangesthatthedocumentwillhaveparagraphsthatarenotindented,butinsteadareverticallyseparatedbyabouttheheightofalowercase`x'.InstandardLATEXdocuments,thedefaultvaluefor\parindentinone-columndocu-mentsis15ptwhenthedefaulttextsizeis10pt,17ptfor11pt,and1.5emfor12pt.Intwo-columndocumentsitis1em.Thedefaultvaluefor\parskipinLATEX'sstandarddocumentstylesis0ptplus1pt.15.4MarginalnotesSynopsis,oneof:\marginpar{right}\marginpar[left]{right}Createanoteinthemargin.The rstlineofthenotewillhavethesamebaselineasthelineinthetextwherethe\marginparoccurs.ThemarginthatLATEXusesforthenotedependsonthecurrentlayout(see Section3.1[Documentclassoptions],page7 )andalsoon\reversemarginpar(seebelow).Ifyouareusingone-sidedlayout(documentoptiononeside)thenitgoesintherightmargin.Ifyouareusingtwo-sidedlayout(documentoptiontwoside)thenitgoesintheoutsidemargin.Ifyouareintwo-columnlayout(documentoptiontwocolumn)thenitgoesinthenearestmargin.Ifyoudeclare\reversemarginparthenLATEXwillplacesubsequentmarginalnotesintheoppositemargintothatgiveninthepriorparagraph.Revertthattothedefaultpositionwith\normalmarginpar. 128 Whenyouspecifytheoptionalargumentleftthenitisusedforanoteintheleftmargin,whilethemandatoryargumentrightisusedforanoteintherightmargin.Normally,anote's rstwordwillnotbehyphenated.Youcanenablehyphenationtherebybeginningleftorrightwith\hspace{0pt}.Theseparametersa ecttheformattingofthenote:\marginparpushMinimumverticalspacebetweennotes;default`7pt'for`12pt'documents,`5pt'else.\marginparsepHorizontalspacebetweenthemaintextandthenote;default`11pt'for`10pt'documents,`10pt'else.\marginparwidthWidthofthenoteitself;defaultforaone-sided`10pt'documentis`90pt',`83pt'for`11pt',and`68pt'for`12pt';`17pt'moreineachcaseforatwo-sideddocument.Intwocolumnmode,thedefaultis`48pt'.ThestandardLATEXroutineformarginalnotesdoesnotpreventnotesfromfallingo thebottomofthepage. 129 16MathformulasProducemathematicaltextbyputtingLATEXintomathmodeordisplaymathmode(see Chapter17[Modes],page151 ).Thisexampleshowsboth.Thewaveequationfor\(u\)is\begin{displaymath}\frac{\partial^2u}{\partialt^2}=c^2\nabla^2u\end{displaymath}where\(\nabla^2\)isthespatialLaplacianand\(c\)isconstant.Mathmodeisforinlinemathematics.Intheaboveexampleitisinvokedbythestarting\(and nishedbythematchingending\).Displaymathmodeisfordisplayedequationsandhereisinvokedbythedisplaymathenvironment.Notethatanymathematicaltextwhatever,includingmathematicaltextconsistingofjustonecharacter,ishandledinmathmode.Wheninmathmodeordisplaymathmode,LATEXhandlesmanyaspectsofyourinputtextdi erentlythaninothertextmodes.Forexample,contrastx+ywith\(x+y\)inmathmodethelettersareinitalicsandthespacingaroundtheplussignisdi erent.Therearethreewaystomakeinlineformulas,toputLATEXinmathmode.\(mathematicalmaterial\)$mathematicalmaterial$\begin{math}mathematicalmaterial\end{math}The rstformispreferredandthesecondisquitecommon,butthethirdformisrarelyused.Youcansometimesuseoneandsometimesanother,asin\(x\)and$y$.YoucanusetheseinparagraphmodeorinLRmode(see Chapter17[Modes],page151 ).Tomakedisplayedformulas,putLATEXintodisplaymathmodewitheither:\begin{displaymath}mathematicalmaterial\end{displaymath}or\begin{equation}mathematicalmaterial\end{equation}(see Section8.5[displaymath],page48 ,see Section8.9[equation],page51 ).Theonlydi erenceisthatwiththeequationenvironment,LATEXputsaformulanumberalongsidetheformula.Theconstruct\[math\]isequivalentto\begin{displaymath}math\end{displaymath}.Theseenvironmentscanonlybeusedinparagraphmode(see Chapter17[Modes],page151 ).Thetwomathematicsmodesaresimilar,buttherearesomedi erences.Oneinvolvestheplacementofsubscriptsandsuperscripts;indisplaymathmodetheyarefurtherapartandininlinemathmodetheyareclosertogether.Sometimesyouwantthedisplaymathtypographicaltreatmenttohappenintheinlinemathmode.Forthis,the\displaystyledeclarationforcesthesizeandstyleoftheformula Chapter16:Mathformulas130 tobethatofdisplaymath.Thus\(\displaystyle\sum_{n=0}^\inftyx_n\)willhavethelimitsaboveandbelowthesummationsign,notnexttoit.Anotherexampleisthat\begin{tabular}{r|cc}\textsc{Name}&\textsc{Series}&\textsc{Sum}\\\hlineArithmetic&\(a+(a+b)+(a+2b)+\cdots+(a+(n-1)b)\)&\(na+(n-1)n\cdot\frac{b}{2}\)\\Geometric&\(a+ab+ab^2+\cdots+ab^{n-1}\)&\(\displaystylea\cdot\frac{1-b^n}{1-b}\)\\\end{tabular}becauseithasno\displaystyle,the`Arithmetic'line'sfractionwillbescrunched.But,becauseofits\displaystyle,the`Geometric'line'sfractionwillbeeasytoread,withcharactersthesamesizeasintherestoftheline.TheAmericanMathematicalSocietyhasmadefreelyavailableasetofpackagesthatgreatlyexpandyouroptionsforwritingmathematics,amsmathandamssymb(alsobeawareofthemathtoolspackagethatisanextensionto,andloads,amsmath).Newdocumentsthatwillhavemathematicaltextshouldusethesepackages.Descriptionsofthesepackagesisoutsidethescopeofthisdocument;seetheirdocumentationonCTAN.16.1Subscripts&superscriptsSynopsis(inmathmodeordisplaymathmode),oneof:base^expbase^{exp}or,oneof:base_expbase_{exp}Makeexpappearasasuperscriptofbase(withthecaretcharacter,^)orasubscript(withunderscore,_).Inthisexamplethe0'sand1'saresubscriptswhilethe2'saresuperscripts.\((x_0+x_1)^2\leq(x_0)^2+(x_1)^2\)Tohavethesubscriptorsuperscriptcontainmorethanonecharacter,surroundtheexpressionwithcurlybraces,asine^{-2x}.Thisexample'sfourthlineshowscurlybracesusedtogroupanexpressionfortheexponent.\begin{displaymath}(3^3)^3=27^3=19\,683\qquad3^{(3^3)}=3^{27}=7\,625\,597\,484\,987\end{displaymath}LATEXknowshowtohandleasuperscriptonasuperscript,orasubscriptonasubscript,orsupersonsubs,orsubsonsupers.So,expressionssuchase^{x^2}andx_{i_0}givecor-rectoutput.Notetheuseinthoseexpressionsofcurlybracestogivethebaseadeterminedexp.Ifyouenter\(3^3^3\)thenyouget`Doublesuperscript'.LATEXdoestherightthingwhensomethinghasbothasubscriptandasuperscript.Inthisexampletheintegralhasboth.Theycomeoutinthecorrectplacewithoutanyauthorintervention. Chapter16:Mathformulas131 \begin{displaymath}\int_{x=a}^bf'(x)\,dx=f(b)-f(a)\end{displaymath}Notetheparenthesesaroundx=atomaketheentireexpressionasubscript.Toputasuperscriptorsubscriptbeforeasymbol,useaconstructlike{}_tK^2.Theemptycurlybraces{}givethesubscriptsomethingtoattachtoandkeepsitfromacciden-tallyattachingtoapriorsymbols.Usingthesubscriptorsuperscriptcommandoutsideofmathmodeordisplaymathmode,asintheexpressionx^2,willgetyoutheerror`Missing$inserted'.Acommonreasontowantsubscriptsoutsideofamathematicsmodeistotypesetchem-icalformulas.Therearepackagesforthatsuchasmhchem;seeCTAN.16.2MathsymbolsLATEXprovidesalmostanymathematicalortechnicalsymbolthatanyoneuses.Forexample,ifyouinclude$\pi$inyoursource,youwillgetthepisymbol.SeetheComprehensiveLATEXSymbolListat https://ctan.org/tex-archive/info/symbols/comprehensive/ .Hereisalistofcommonly-usedsymbols.Itisbynomeansexhaustive.Eachsymbolisdescribedwithashortphrase,anditssymbolclass,whichdeterminesthespacingaroundit,isgiveninparenthesis.Unlesssaidotherwise,thecommandsforthesesymbolscanbeusedonlyinmathmode.Torede neacommandsothatitcanbeusedwhateverthecurrentmode,see Section17.1[\ensuremath],page151 .\|kParallel(relation).Synonym:\parallel.\aleph@Aleph,trans nitecardinal(ordinary).\alpha LowercaseGreekletteralpha(ordinary).\amalgqDisjointunion(binary)\angle6 Geometricangle(ordinary).Similar:less-thansignandanglebracket\langle.\approxAlmostequalto(relation).\astAsteriskoperator,convolution,six-pointed(binary).Synonym:*,whichisoftenasuperscriptorsubscript,asintheKleenestar.Similar:\star,whichis ve-pointed,andissometimesusedasageneralbinaryoperation,andsome-timesreservedforcross-correlation.\asympAsymptoticallyequivalent(relation).\backslash\Backslash(ordinary).Similar:setminus\setminus,and\textbackslashforbackslashoutsideofmathmode.\beta LowercaseGreekletterbeta(ordinary).\bigcapTVariable-sized,orn-ary,intersection(operator).Similar:binaryintersec-tion\cap.\bigcirc Circle,larger(binary).Similar:functioncomposition\circ. Chapter16:Mathformulas132 \bigcupSVariable-sized,orn-ary,union(operator).Similar:binaryunion\cup.\bigodotJVariable-sized,orn-ary,circleddotoperator(operator).\bigoplusLVariable-sized,orn-ary,circledplusoperator(operator).\bigotimesNVariable-sized,orn-ary,circledtimesoperator(operator).\bigtriangledown5Variable-sized,orn-ary,opentrianglepointingdown(operator).\bigtriangleup4Variable-sized,orn-ary,opentrianglepointingup(operator).\bigsqcupFVariable-sized,orn-ary,squareunion(operator).\biguplusUVariable-sized,orn-ary,unionoperatorwithaplus(operator).(Notethatthenamehasonlyonep.)\bigveeWVariable-sized,orn-ary,logical-and(operator).\bigwedgeVVariable-sized,orn-ary,logical-or(operator).\botUptack,bottom,leastelementofapartiallyorderedset,oracontradiction(ordinary).Seealso\top.\bowtie./Naturaljoinoftworelations(relation).\BoxModaloperatorfornecessity;squareopenbox(ordinary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.\bulletBullet(binary).Similar:multiplicationdot\cdot.\cap\Intersectionoftwosets(binary).Similar:variable-sizedoperator\bigcap.\cdotMultiplication(binary).Similar:Bulletdot\bullet.\chiLowercaseGreekchi(ordinary).\circFunctioncomposition,ringoperator(binary).Similar:variable-sizedopera-tor\bigcirc.\clubsuit|Clubcardsuit(ordinary).\complementSetcomplement,usedasasuperscriptasin$S^\complement$(ordinary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.Alsoused:$S^{\mathsf{c}}$or$\bar{S}$.\cong=Congruent(relation).\coprod`Coproduct(operator). Chapter16:Mathformulas133 \cup[Unionoftwosets(binary).Similar:variable-sizedoperator\bigcup.\daggeryDaggerrelation(binary).\dashvaDashwithvertical,reversedturnstile(relation).Similar:turnstile\vdash.\ddaggerzDoubledaggerrelation(binary).\DeltaGreekuppercasedelta,usedforincrement(ordinary).\deltaGreeklowercasedelta(ordinary).\DiamondLargediamondoperator(ordinary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.\diamondDiamondoperator(binary).Similar:largediamond\Diamond,circlebul-let\bullet.\diamondsuit}Diamondcardsuit(ordinary).\divDivisionsign(binary).\doteq:=Approachesthelimit(relation).Similar:geometricallyequalto\Doteq.\downarrow#Downarrow,converges(relation).Similar:\Downarrowdoublelinedownarrow.\Downarrow+Doublelinedownarrow(relation).Similar:\downarrowsinglelinedownarrow.\ell`Lowercasecursiveletterl(ordinary).\emptyset;Emptysetsymbol(ordinary).Thevariantformis\varnothing.\epsilonLowercaselunateepsilon(ordinary).SimilartoGreektextletter.Morewidelyusedinmathematicsisthescriptsmallletterepsilon\varepsilon".Related:thesetmembershiprelation\in2.\equivEquivalence(relation).\etaLowercaseGreekletter(ordinary).\exists9Existentialquanti er(ordinary).\flat[Musical at(ordinary).\forall8Universalquanti er(ordinary).\frown_Downwardcurvingarc(ordinary).\Gamma�uppercaseGreekletter(ordinary).\gamma LowercaseGreekletter(ordinary).\geGreaterthanorequalto(relation).Thisisasynonymfor\geq.\geqGreaterthanorequalto(relation).Thisisasynonymfor\ge. Chapter16:Mathformulas134 \gets Isassignedthevalue(relation).Synonym:\leftarrow.\ggMuchgreaterthan(relation).Similar:muchlessthan\ll.\hbarhPlanckconstantovertwopi(ordinary).\heartsuit~Heartcardsuit(ordinary).\hookleftarrow -Hookedleftarrow(relation).\hookrightarrow,!Hookedrightarrow(relation).\iff()Ifandonlyif(relation).Itis\Longleftrightarrowwitha\thickmuskiponeitherside.\Im=Imaginarypart(ordinary).See:realpart\Re.\imathDotlessi;usedwhenyouareputtinganaccentonani(see Section16.4[Mathaccents],page145 ).\in2Setelement(relation).Seealso:lowercaselunateepsilon\epsilonandsmallletterscriptepsilon\varepsilon.\infty1In nity(ordinary).\intRIntegral(operator).\iotaLowercaseGreekletter(ordinary).\JoinCondensedbowtiesymbol(relation).NotavailableinPlainTEX.\jmathDotlessj;usedwhenyouareputtinganaccentonaj(see Section16.4[Mathaccents],page145 ).\kappaLowercaseGreekletter(ordinary).\LambdauppercaseGreekletter(ordinary).\lambdaLowercaseGreekletter(ordinary).\land^Logicaland(binary).Thisisasynonymfor\wedge.Seealsologicalor\lor.\langlehLeftangle,orsequence,bracket(opening).Similar:less-than.Matches\rangle.\lbracefLeftcurlybrace(opening).Synonym:\{.Matches\rbrace.\lbrack[Leftsquarebracket(opening).Synonym:[.Matches\rbrack.\lceildLeftceilingbracket,likeasquarebracketbutwiththebottomshavedo (opening).Matches\rceil.\leLessthanorequalto(relation).Thisisasynonymfor\leq.\leadstoSquigglyrightarrow(relation).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.Togetthissymboloutsideofmathmodeyoucanput\newcommand*{\Leadsto}{\ensuremath{\leadsto}}inthepreambleandthenuse\Leadstoinstead. Chapter16:Mathformulas135 \Leftarrow(Isimpliedby,double-lineleftarrow(relation).Similar:single-lineleftar-row\leftarrow.\leftarrow Single-lineleftarrow(relation).Synonym:\gets.Similar:double-lineleftarrow\Leftarrow.\leftharpoondown)Single-lineleftharpoon,barbunderbar(relation).\leftharpoonup(Single-lineleftharpoon,barboverbar(relation).\Leftrightarrow,Bi-implication;double-linedouble-headedarrow(relation).Similar:single-linedoubleheadedarrow\leftrightarrow.\leftrightarrow$Single-linedouble-headedarrow(relation).Similar:double-linedoubleheadedarrow\Leftrightarrow.\leqLessthanorequalto(relation).Thisisasynonymfor\le.\lfloorbLeft oorbracket(opening).Matches:\floor.\lhdArrowhead,thatis,triangle,pointingleft(binary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.Forthenormalsubgroupsymbolyoushouldloadamssymbanduse\vartriangleleft(whichisarelationandsogivesbetterspacing).\llMuchlessthan(relation).Similar:muchgreaterthan\gg.\lnot:Logicalnegation(ordinary).Synonym:\neg.\longleftarrow �Longsingle-lineleftarrow(relation).Similar:longdouble-lineleftar-row\Longleftarrow.\longleftrightarrow !Longsingle-linedouble-headedarrow(relation).Similar:longdouble-linedouble-headedarrow\Longleftrightarrow.\longmapsto7�!Longsingle-lineleftarrowstartingwithverticalbar(relation).Similar:shorterversion\mapsto.\longrightarrow�!Longsingle-linerightarrow(relation).Similar:longdouble-linerightarrow\Longrightarrow.\lor_Logicalor(binary).Synonym:wedge\wedge.\mapsto7!Single-lineleftarrowstartingwithverticalbar(relation).Similar:longerversion\longmapsto. Chapter16:Mathformulas136 \mhoConductance,half-circlerotatedcapitalomega(ordinary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.\midjSingle-lineverticalbar(relation).Atypicaluseof\midisforaset\{\,x\midx\geq5\,\}.Similar:\vertand|producethesamesingle-lineverticalbarsymbolbutwithoutanyspacing(theyfallinclassordinary)andyoushouldnotusethemasrelationsbutinsteadonlyasordinals,i.e.,footnotesymbols.Forabsolutevalue,seetheentryfor\vertandfornormseetheentryfor\Vert.\modelsj=Entails,orsatis es;doubleturnstile,shortdoubledash(relation).Similar:longdoubledash\vDash.\mpMinusorplus(relation).\muLowercaseGreekletter(ordinary).\nablarHamilton'sdel,ordi erential,operator(ordinary).\natural\Musicalnaturalnotation(ordinary).\ne6=Notequal(relation).Synonym:\neq.\nearrow%North-eastarrow(relation).\neg:Logicalnegation(ordinary).Synonym:\lnot.Sometimesinsteadusedfornegation:\sim.\neq6=Notequal(relation).Synonym:\ne.\ni3Re ectedmembershipepsilon;hasthemember(relation).Synonym:\owns.Similar:isamemberof\in.\not6Longsolidus,orslash,usedtooverstrikeafollowingoperator(relation).Manynegatedoperatorsareavailablethatdon'trequire\not,particularlywiththeamssymbpackage.Forexample,\notinistypographicallypreferableto\not\in.\notin=2Notanelementof(relation).Similar:notsubsetof\nsubseteq.\nuLowercaseGreekletter(ordinary).\nwarrow-North-westarrow(relation).\odot Dotinsideacircle(binary).Similar:variable-sizedoperator\bigodot.\ointHContourintegral,integralwithcircleinthemiddle(operator).\Omega uppercaseGreekletter(ordinary).\omega!LowercaseGreekletter(ordinary).\ominus Minussign,ordash,insideacircle(binary).\oplusPlussigninsideacircle(binary).Similar:variable-sizedoperator\bigoplus.\oslash Solidus,orslash,insideacircle(binary).\otimes Timessign,orcross,insideacircle(binary).Similar:variable-sizedopera-tor\bigotimes. Chapter16:Mathformulas137 \owns3Re ectedmembershipepsilon;hasthemember(relation).Synonym:\ni.Similar:isamemberof\in.\parallelkParallel(relation).Synonym:\|.\partial@Partialdi erential(ordinary).\perp?Perpendicular(relation).Similar:\botusesthesameglyphbutthespacingisdi erentbecauseitisintheclassordinary.\phiLowercaseGreekletter(ordinary).Thevariantformis\varphi'.\PiuppercaseGreekletter(ordinary).\piLowercaseGreekletter(ordinary).Thevariantformis\varpi$.\pmPlusorminus(binary).\precPrecedes(relation).Similar:lessthan.\preceqPrecedesorequals(relation).Similar:lessthanorequals\leq.\prime0Prime,orminuteinatimeexpression(ordinary).Typicallyusedasasu-perscript:$f^\prime$;$f^\prime$and$f'$producethesameresult.Anadvantageofthesecondisthat$f'''$producesthedesiredsymbol,thatis,thesameresultas$f^{\prime\prime\prime}$,butusesratherlesstyping.Youcanonlyuse\primeinmathmode.Usingtherightsinglequote'intextmodeproducesadi erentcharacter(apostrophe).\prodQProduct(operator).\propto/Isproportionalto(relation)\Psi uppercaseGreekletter(ordinary).\psi LowercaseGreekletter(ordinary).\rangleiRightangle,orsequence,bracket(closing).Similar:greaterthan&#x]TJ/;ཕ ;.9;‘ ;&#xTf 5;&#x.727;&#x 0 T; [0;.Matches:\langle.\rbracegRightcurlybrace(closing).Synonym:\}.Matches\lbrace.\rbrack]Rightsquarebracket(closing).Synonym:].Matches\lbrack.\rceileRightceilingbracket(closing).Matches\lceil.\ReRealpart,realnumbers,cursivecapitalR(ordinary).Related:double-line,orblackboardbold,R\mathbb{R};toaccessthis,loadtheamsfontspackage.\restrictionRestrictionofafunction(relation).Synonym:\upharpoonright.Notavail-ableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.\revemptysetReversedemptysetsymbol(ordinary).Related:\varnothing.NotavailableinplainTEX.InLATEXyouneedtoloadthestixpackage.\rfloorcRight oorbracket,arightsquarebracketwiththetopcuto (closing).Matches\lfloor. Chapter16:Mathformulas138 \rhdArrowhead,thatis,triangle,pointingright(binary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.Forthenormalsubgroupsymbolyoushouldinsteadloadamssymbanduse\vartriangleright(whichisarelationandsogivesbetterspacing).\rhoLowercaseGreekletter(ordinary).Thevariantformis\varrho%.\Rightarrow)Implies,right-pointingdoublelinearrow(relation).Similar:rightsingle-linearrow\rightarrow.\rightarrow!Right-pointingsinglelinearrow(relation).Synonym:\to.Similar:rightdoublelinearrow\Rightarrow.\rightharpoondown+Right-pointingharpoonwithbarbbelowtheline(relation).\rightharpoonup*Right-pointingharpoonwithbarbabovetheline(relation).\rightleftharpoons*)Rightharpoonupaboveleftharpoondown(relation).\searrow&Arrowpointingsoutheast(relation).\setminusnSetdi erence,reversesolidusorreverseslash,like\(binary).Similar:back-slash\backslashandalso\textbackslashoutsideofmathmode.\sharp]Musicalsharp(ordinary).\SigmauppercaseGreekletter(ordinary).\sigmaLowercaseGreekletter(ordinary).Thevariantformis\varsigma&.\simSimilar,inarelation(relation).\simeq'Similarorequalto,inarelation(relation).\smallintsIntegralsignthatdoesnotchangetoalargersizeinadisplay(operator).\smile^Upwardcurvingarc,smile(ordinary).\spadesuitSpadecardsuit(ordinary).\sqcapuSquareintersectionsymbol(binary).Similar:intersectioncap.\sqcuptSquareunionsymbol(binary).Similar:unioncup.Related:variable-sizedoperator\bigsqcup.\sqsubsetSquaresubsetsymbol(relation).Similar:subset\subset.NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage. Chapter16:Mathformulas139 \sqsubseteqvSquaresubsetorequalsymbol(binary).Similar:subsetorequalto\subseteq.\sqsupsetSquaresupersetsymbol(relation).Similar:superset\supset.NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.\sqsupseteqwSquaresupersetorequalsymbol(binary).Similar:supersetorequal\supseteq.\star?Five-pointedstar,sometimesusedasageneralbinaryoperationbutsome-timesreservedforcross-correlation(binary).Similar:thesynonymsasterisk*and\ast,whicharesix-pointed,andmoreoftenappearasasuperscriptorsubscript,aswiththeKleenestar.\subsetSubset(occasionally,isimpliedby)(relation).\subseteqSubsetorequalto(relation).\succComesafter,succeeds(relation).Similar:islessthan�.\succeqSucceedsorisequalto(relation).Similar:lessthanorequalto\leq.\sumPSummation(operator).Similar:Greekcapitalsigma\Sigma.\supsetSuperset(relation).\supseteqSupersetorequalto(relation).\surdpRadicalsymbol(ordinary).TheLATEXcommand\sqrt{...}typesetsthesquarerootoftheargument,withabarthatextendstocovertheargument.\swarrow.Southwest-pointingarrow(relation).\tauLowercaseGreekletter(ordinary).\thetaLowercaseGreekletter(ordinary).Thevariantformis\vartheta#.\timesPrimaryschoolmultiplicationsign(binary).Seealso\cdot.\to!Right-pointingsinglelinearrow(relation).Synonym:\rightarrow.\topTop,greatestelementofapartiallyorderedset(ordinary).Seealso\bot.\triangle4Triangle(ordinary).\triangleleft/Not- lledtrianglepointingleft(binary).Similar:\lhd.Forthenormalsubgroupsymbolyoushouldloadamssymbanduse\vartriangleleft(whichisarelationandsogivesbetterspacing).\triangleright.Not- lledtrianglepointingright(binary).Forthenormalsubgroupsym-bolyoushouldinsteadloadamssymbanduse\vartriangleright(whichisarelationandsogivesbetterspacing). Chapter16:Mathformulas140 \unlhdLeft-pointingnot- lledunderlinedarrowhead,thatis,triangle,withalineunder(binary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.Forthenormalsubgroupsymbolloadamssymbanduse\vartrianglelefteq(whichisarelationandsogivesbetterspacing).\unrhdRight-pointingnot- lledunderlinedarrowhead,thatis,triangle,withalineunder(binary).NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.Forthenormalsubgroupsymbolloadamssymbanduse\vartrianglerighteq(whichisarelationandsogivesbetterspacing).\Uparrow*Double-lineupward-pointingarrow(relation).Similar:single-lineup-pointingarrow\uparrow.\uparrow"Single-lineupward-pointingarrow,diverges(relation).Similar:double-lineup-pointingarrow\Uparrow.\UpdownarrowmDouble-lineupward-and-downward-pointingarrow(relation).Similar:single-lineupward-and-downward-pointingarrow\updownarrow.\updownarrowlSingle-lineupward-and-downward-pointingarrow(relation).Similar:double-lineupward-and-downward-pointingarrow\Updownarrow.\upharpoonrightUpharpoon,withbarbonrightside(relation).Synonym:\restriction.NotavailableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.\uplus]Multisetunion,aunionsymbolwithaplussymbolinthemiddle(binary).Similar:union\cup.Related:variable-sizedoperator\biguplus.\UpsilonuppercaseGreekletter(ordinary).\upsilonLowercaseGreekletter(ordinary).\varepsilon"Smallletterscriptepsilon(ordinary).Thisismorewidelyusedinmath-ematicsthanthenon-variantlunateepsilonform\epsilon.Related:setmembership\in.\vanothingEmptysetsymbol.Similar:\emptyset.Related:\revemptyset.Notavail-ableinplainTEX.InLATEXyouneedtoloadtheamssymbpackage.\varphi'VariantonthelowercaseGreekletter(ordinary).Thenon-variantformis\phi.\varpi$VariantonthelowercaseGreekletter(ordinary).Thenon-variantformis\pi.\varrho%VariantonthelowercaseGreekletter(ordinary).Thenon-variantformis\rho.\varsigma&VariantonthelowercaseGreekletter(ordinary).Thenon-variantformis\sigma. Chapter16:Mathformulas141 \vartheta#VariantonthelowercaseGreekletter(ordinary).Thenon-variantformis\theta.\vdash`Provable;turnstile,verticalandadash(relation).Similar:turnstilerotatedahalf-circle\dashv.\vee_Logicalor;adownwardsvshape(binary).Related:logicaland\wedge.Similar:variable-sizedoperator\bigvee.\VertkVerticaldoublebar(ordinary).Similar:verticalsinglebar\vert.Foranormsymbol,youcanusethemathtoolspackageandputinyourpreamble\DeclarePairedDelimiter\norm{\lVert}{\rVert}.Thisgivesyouthreecommandvariantsfordouble-lineverticalbarsthatarecorrectlyhorizontallyspaced:ifinthedocumentbodyyouwritethestarredversion$\norm*{M^\perp}$thentheheightoftheverticalbarswillmatchtheheightoftheargument,whereaswith\norm{M^\perp}thebarsdonotgrowwiththeheightoftheargumentbutinsteadarethedefaultheight,and\norm[sizecommand]{M^\perp}alsogivesbarsthatdonotgrowbutaresettothesizegiveninthesizecommand,e.g.,\Bigg.\vertjSinglelineverticalbar(ordinary).Similar:double-lineverticalbar\Vert.Forsuchthat,asinthede nitionofaset,use\midbecauseitisarelation.Forabsolutevalueyoucanusethemathtoolspackageandinyourpreambleput\DeclarePairedDelimiter\abs{\lvert}{\rvert}.Thisgivesyouthreecommandvariantsforsingle-lineverticalbarsthatarecorrectlyhorizontallyspaced:ifinthedocumentbodyyouwritethestarredversion$\abs*{\frac{22}{7}}$thentheheightoftheverticalbarswillmatchtheheightoftheargument,whereaswith\abs{\frac{22}{7}}thebarsdonotgrowwiththeheightoftheargumentbutinsteadarethedefaultheight,and\abs[sizecommand]{\frac{22}{7}}alsogivesbarsthatdonotgrowbutaresettothesizegiveninthesizecommand,e.g.,\Bigg.\wedge^Logicaland(binary).Synonym:\land.Seealsologicalor\vee.Similar:variable-sizedoperator\bigwedge.\wp}Weierstrassp(ordinary).\wroWreathproduct(binary).\XiuppercaseGreekletter(ordinary).\xiLowercaseGreekletter(ordinary).\zetaLowercaseGreekletter(ordinary).ThefollowingsymbolsaremostoftenusedinplaintextbutLATEXprovidesversionstouseinmathematicaltext.\mathdollarDollarsigninmathmode:$.\mathparagraphParagraphsign(pilcrow)inmathmode,{. Chapter16:Mathformulas142 \mathsectionSectionsigninmathmodex.\mathsterlingSterlingsigninmathmode:$.\mathunderscoreUnderscoreinmathmode: .16.2.1BlackboardboldSynopsis:\usepackage{amssymb}%inpreamble...\mathbb{uppercase-letter}Provideblackboardboldsymbols,sometimesalsoknownasdoublestruckletters,usedtodenotenumbersetssuchasthenaturalnumbers,theintegers,etc.Here\(\foralln\in\mathbb{N},n^2\geq0\)the\mathbb{N}givesblackboardboldsymbolrepresentingthenaturalnumbers.Ifyouuseotherthananuppercaseletterthenyoudonotgetanerrorbutyougetstrangeresults,includingunexpectedcharacters.Therearepackagesthatgiveaccesstosymbolsotherthanjustthecapitalletters;lookonCTAN.16.2.2CalligraphicSynopsis:\mathcal{uppercase-letters}Useascript-likefont.Inthisexamplethegraphidenti erisoutputinacursivefont.Letthegraphbe\(\mathcal{G}\).Ifyouusesomethingotherthananuppercaseletterthenyoudonotgetanerror.Insteadyougetunexpectedoutput.Forinstance,\mathcal{g}outputsaclosecurlybracesymbol,while\mathcal{+}outputsaplussign.16.2.3\boldmath&\unboldmathSynopsis(usedinparagraphmodeorLRmode):\boldmath\(math\)or\unboldmath\(math\)Declarationstochangethelettersandsymbolsinmathtobeinaboldfont,ortocountermandthatandbringbacktheregular(non-bold)default.Theymustbeusedwhennotinmathmodeordisplaymathmode(see Chapter17[Modes],page151 ).Bothcommandsarefragile(see Section12.11[\protect],page113 ). Chapter16:Mathformulas143 Inthisexampleeach\boldmathcommandtakesplaceinsidean\mbox,wehave$\mbox{\boldmath\(v\)}=5\cdot\mbox{\boldmath\(u\)$}$whichmeans\boldmathisonlycalledinatextmode,hereLRmode,andexplainswhyLATEXmustswitchtomathmodetosetvandu.Ifyouuseeithercommandinsidemathmode,aswithTrouble:\(\boldmathx\),thenyougetsomethinglike`LaTeXFontWarning:Command\boldmathinvalidinmathmodeoninputline11'and`LaTeXFontWarning:Command\mathversioninvalidinmathmodeoninputline11'.Therearemanyissueswith\boldmath.NewdocumentsshouldusethebmpackageprovidedbytheLATEXProjectteam.Acompletedescriptionisoutsidethescopeofthisdocument(seethefulldocumentationonCTAN)buteventhissmallexample\usepackage{bm}%inpreamble...wehave$\bm{v}=5\cdot\bm{u}$showsthatitisanimprovementover\boldmath.16.2.4Dots,horizontalorverticalEllipsesarethethreedots(usuallythree)indicatingthatapatterncontinues.\begin{array}{cccc}a_{0,0}&a_{0,1}&a_{0,2}&\ldots\\a_{1,0}&\ddots\\\vdots\end{array}LATEXprovidesthese.\cdotsHorizontalellipsiswiththedotsraisedtothecenteroftheline,asin.Usedas:\(a_0\cdota_1\cdotsa_{n-1}\).\ddotsDiagonalellipsis,....Seetheabovearrayexampleforausage.\ldotsEllipsisonthebaseline,:::.Usedas:\(x_0,\ldotsx_{n-1}\).Anotherexampleistheabovearrayexample.Asynonymis\mathellipsis.Asynonymfromtheamsmathpackageis\hdots.Youcanalsousethiscommandoutsideofmathematicaltext,asinThegears,brakes,\ldots{}areallbroken.(InaparagraphmodeorLRmodeasyn-onymfor\ldotsis\dots.)\vdotsVerticalellipsis,....Seetheabovearrayexampleforausage.Theamsmathpackagehasthecommand\dotstosemanticallymarkupellipses.Thisexampleproducestwodi erent-lookingoutputsforthe rsttwousesofthe\dotscommand.\usepackage{amsmath}%inpreamble...Supposethat\(p_0,p_1,\dots,p_{n-1}\)listsalloftheprimes.Observethat\(p_0\cdotp_1\dots\cdotp_{n-1}+1\)isnotamultipleofany\(p_i\). Chapter16:Mathformulas144 Conclusion:thereareinfinitelymanyprimes\(p_0,p_1,\dotsc\).Inthe rstlineLATEXlookstothecommafollowing\dotstodeterminethatitshouldoutputanellipsisonthebaseline.Thesecondlinehasa\cdotfollowing\dotssoLATEXoutputsanellipsisthatisonthemathaxis,verticallycentered.However,thethirdusagehasnofollow-oncharactersoyouhavetotellLATEXwhattodo.Youcanuseoneofthecommands:\dotscifyouneedtheellipsisappropriateforacommafollowing,\dotsbifyouneedtheellipsesthat tswhenthedotsarefollowedbyabinaryoperatororrelationsymbol,\dotsifordotswithintegrals,or\dotsoforothers.16.3MathfunctionsThesecommandsproduceromanfunctionnamesinmathmodewithproperspacing.\arccosInversecosinearccos\arcsinInversesinearcsin\arctanInversetangentarctan\argAnglebetweentherealaxisandapointinthecomplexplanearg\bmodBinarymodulooperator,usedasin\(5\bmod3=2\)5mod3\cosCosinecos\coshHyperboliccosinecosh\cotCotangentcot\cothHyperboliccotangentcoth\cscCosecantcsc\degDegreesdeg\detDeterminantdet\dimDimensiondim\expExponentialexp\gcdGreatestcommondivisorgcd\homHomomorphismhom\infIn numinf\kerKernelker\lgBase2logarithmlg\limLimitlim\liminfLimitinferiorliminf\limsupLimitsuperiorlimsup\lnNaturallogarithmln\logLogarithmlog Chapter16:Mathformulas145 \maxMaximummax\minMinimummin\pmodParenthesizedmodulus,asusedin\(5\equiv2\pmod3\)52(mod3)\PrProbabilityPr\secSecantsec\sinSinesin\sinhHyperbolicsinesinh\supSupremumsup\tanTangenttan\tanhHyperbolictangenttanhTheamsmathpackageaddsimprovementsonsomeofthese,andalsoallowsyoutode neyourown.ThefulldocumentationisonCTAN,butbrie y,youcande neanidentityoperatorwith\DeclareMathOperator{\identity}{id}thatisliketheonesabovebutprintsas`id'.Thestarredform\DeclareMathOperator*{\op}{op}setsanylimitsaboveandbelow,asistraditionalwith\lim,\sup,or\max.16.4MathaccentsLATEXprovidesavarietyofcommandsforproducingaccentedlettersinmath.Thesearedi erentfromaccentsinnormaltext(see Section23.5[Accents],page194 ).\acuteMathacuteaccentx.\barMathbar-overaccentx\breveMathbreveaccentx\checkMathhacek(check)accentx\ddotMathdieresisaccentx\dotMathdotaccent_x\graveMathgraveaccentx\hatMathhat(circum ex)accent^x\mathringMathringaccentx\tildeMathtildeaccent~x\vecMathvectorsymbol~x\widehatMathwidehataccentdx+y\widetildeMathwidetildeaccentgx+yWhenyouareputtinganaccentonanioraj,thetraditionistouseonewithoutadot,\imathorjmath(see Section16.2[Mathsymbols],page131 ). Chapter16:Mathformulas146 16.5Over-andUnderliningLATEXprovidescommandsformakingoverlinesorunderlines,orputtingbracesoverorundersomematerial.\underline{text}Underlinetext.Worksinsidemathmode,andoutside.Theresultof\underline{xyz}isxyz .Thelineisalwayscompletelybelowthetext,takingaccountofdescenders,soin\(\underline{y}\)thelineislowerthanin\(\underline{x}\).Thiscommandisfragile(see Section12.11[\protect],page113 ).Notethatthepackageulemdoestextmodeunderliningandallowslinebreakingaswellasanumberofotherfeatures.SeethedocumentationonCTAN.Seealso Section19.10[\hrule ll&\dot ll],page163, forproducingaline,forsuchthingsasasignature.\overline{text}Putahorizontallineovertext.Worksinsidemathmode,andoutside.Forexample,\overline{x+y}.Theresultlookslike: x+y.Notethatthisdi ersfromthecommand\bar(see Section16.4[Mathaccents],page145 ).\underbrace{math}Putabraceundermath.Forexample,this(1-\underbrace{1/2)+(1/2}-1/3)emphasizesthetelescopingpart.Theresultlookslikethis:(1�1=2)+(1=2| {z }�1=3).Attachtexttothebracebyusingsubscript,_,orsuperscript,^,ashere.\begin{displaymath}�1+1/2+\underbrace{1/3+1/4}_{1/2}+�\underbrace{1/5+1/6+1/7+1/8}_{1/2}+\cdots\end{displaymath}Thesuperscriptappearsontopoftheexpression,andsocanlookunconnectedtotheunderbrace.\overbrace{math}Putabraceovermath,aswith\overbrace{x+x+\cdots+x}^{\mbox{\(k\)times}}.Seealso\underbrace.Thepackagemathtoolsaddsanover-andunderbrace,aswellassomeimprovementsonthebraces.SeethedocumentationonCTAN.16.6SpacinginmathmodeWhentypesettingmathematics,LATEXputsinspacingaccordingtothenormalrulesformathematicstexts.Ifyouentery=mxthenLATEXignoresthespaceandintheoutputthemisnexttothex,asy=mx.ButLATEX'srulessometimesneedtweaking.Forexample,inanintegralthetraditionistoputasmallextraspacebetweenthef(x)andthedx,heredonewiththe\,command.\int_0^1f(x)\,dx Chapter16:Mathformulas147 LATEXprovidesthecommandsthatfollowforuseinmathmode.Manyofthesespacingde nitionsareexpressedintermsofthemathunitmu.Itisde nedas1/18em,wheretheemistakenfromthecurrentmathsymbolsfamily(see Section14.1[Unitsoflength],page121 ).Thus,a\thickspaceissomethinglike5/18timesthewidthofa`M'.\;Synonym:\thickspace.Normally5.0muplus5.0mu.Mathmodeonly.\:�\Synonym:\medspace.Normally4.0muplus2.0muminus4.0mu.Mathmodeonly.\,Synonym:\thinspace.Normally3mu,whichis1/6em.Canbeusedinbothmathmodeandtextmode(see Section19.8[\thinspace&\negthinspace],page162 ).Thisspaceiswidelyused,forinstancebetweenthefunctionandthein nitesimalinanintegral\intf(x)\,dxand,ifanauthordoesthis,beforepunctuationinadisplayedequation.Theantiderivativeis\begin{equation}3x^{-1/2}+3^{1/2}\,.\end{equation}\!Anegativethinspace.Normally-3mu.The\!commandismathmodeonlybutthe\negthinspacecommandisavailablefortextmode(see Section19.8[\thinspace&\negthinspace],page162 ).\quadThisis18mu,thatis,1em.Thisisoftenusedforspacesurroundingequa-tionsorexpressions,forinstanceforthespacebetweentwoequationsinsideadisplaymathenvironment.Itisavailableinbothtextandmathmode.\qquadAlengthof2quads,thatis,36mu=2em.Itisavailableinbothtextandmathmode.16.6.1\smashSynopsis:\smash{subformula}Typesetsubformulaasifitsheightanddepthwerezero.Inthisexampletheexponentialissotallthatwithoutthe\smashcommandLATEXwouldseparateitslinefromthelineaboveit,andtheunevenlinespacingmightbeunsightly.Tocomputethetetration$\smash{2^{2^{2^2}}}$,evaluatefromthetopdown,as$2^{2^4}=2^{16}=65536$.(Becauseofthe\smashtheprintedexpressioncouldrunintothelineabovesoyoumaywanttowaituntilthe nalversionofthedocumenttomakesuchadjustments.)Thispicturesthee ectof\smashbyusing\fboxtosurroundtheboxthatLATEXwillputontheline.The\blackbarcommandmakesabarextendingfrom10pointsbelowthebaselineto20pointsabove.\newcommand{\blackbar}{\rule[-10pt]{5pt}{30pt}}\fbox{\blackbar} Chapter16:Mathformulas148 \fbox{\smash{\blackbar}}The rstboxthatLATEXplacesis20pointshighand10pointsdeep.ButthesecondboxistreatedbyLATEXashavingzeroheightandzerodepth,despitethattheinkprintedonthepagestillextendswellaboveandbelowtheline.The\smashcommandappearsofteninmathematicstoadjustthesizeofanelementthatsurroundsasubformula.Herethe rstradicalextendsbelowthebaselinewhilethesecondliesjustonthebaseline.\begin{equation}\sqrt{\sum_{0\leqkn}f(k)}\sqrt{\vphantom{\sum}\smash{\sum_{0\leqkn}}f(k)}\end{equation}Notetheuseof\vphantomtogivethe\sqrtcommandanargumentwiththeheightofthe\sum(see Section16.6.2[\phantom&\vphantom&\hphantom],page148 ).Whilemostoftenusedinmathematics,the\smashcommandcanappearinothercon-texts.However,itdoesn'tchangeintohorizontalmode.Soifitstartsaparagraphthenyoushould rstputa\leavevmode,asinthebottomlinebelow.xxxxxxxxx\smash{yyy}%noparagraphindent\leavevmode\smash{zzz}%usualparagraphindentThepackagemathtoolshasoperatorsthatprovideeven nercontroloversmashingasubformulabox.16.6.2\phantom&\vphantom&\hphantomSynopsis:\phantom{subformula}or\vphantom{subformula}or\hphantom{subformula}The\phantomcommandcreatesaboxwiththesameheight,depth,andwidthassubformula,butempty.Thatis,thiscommandcausesLATEXtotypesettheboxbutnotitsink.The\vphantomvariantalsoproducesaninvisibleboxwiththesameheightanddepthassubformula,butithaswidthzero.And\hphantommakesaboxwiththesamewidthassubformulabutwithheightanddepthzero.Withoutthe\vphantominthisexample,thetopbarsofthetwosquarerootswouldbeatdi erentheights.\(\sqrt{\vphantom{a^3}a}\cdot\sqrt{a^3}\)The\vphantom{a^3}causesthe rst\sqrttohaveinsideitaboxofthesameheightasthesecond\sqrt,soLATEXmakesthebarsalign.Thesecommandsoftenarecombinedwith\smash.See Section16.6.1[\smash],page147, foranotherexampleoftheuseof\vphantom. Chapter16:Mathformulas149 ThethreephantomcommandsappearoftenbutnotethatLATEXprovidesasuiteofothercommandstoworkwithboxsizesthatmaybemoreconvenient,including\makebox(see Section20.1[\mbox&\makebox],page169 )aswellas\settodepth(see Section14.4[\settodepth],page123 ),\settoheight(see Section14.5[\settoheight],page123 ),and\settowidth(see Section14.6[\settowidth],page123 ).Inaddition,themathtoolspackagehasmanycommandsthato er ne-grainedcontroloverspacing.Allthreecommandsproduceanordinarybox,withoutanyspecialmathematicsstatus.Sotodosomethinglikeattachingasuperscriptyoushouldgiveitsuchastatus,forexamplewiththe\operatornamecommandfromthepackageamsmath.Whilemostoftenusedinmathematics,thesethreecanappearinothercontexts.How-ever,theydon'tcauseLATEXtochangeintohorizontalmode.Soifoneofthesestartsaparagraphthenyoushouldpre xitwith\leavevmode.16.7MathmiscellanyLATEXcontainsawidevarietyofmathematicsfacilities.Herearesomethatdon't tintoothercategories.16.7.1Coloncharacter:&\colonSynopsis,oneof::\colonInmathematics,thecoloncharacter,:,isarelation.Withsideratios\(3:4\)and\(4:5\),thetriangleisright.OrdinaryLATEXde nes\colontoproducethecoloncharacterwiththespacingappropriateforpunctuation,asinset-buildernotation\{x\colon0\leqx\.Butthewidely-usedamsmathpackagede nes\colonforuseinthede nitionoffunc-tionsf\colonD\toC.Soifyouwantthecoloncharacterasapunctuationthenuse\mathpunct{:}.16.7.2\*Synopsis:\*Amultiplicationsymbolthatallowsalinebreak.IfthereisabreakthenLATEXputsa\timessymbol,,beforethatbreak.In\(A_1\*A_2\*A_3\*A_4\),ifthereisnolinebreakthenLATEXoutputsitasthoughitwere\(A_1A_2A_3A_4\).Ifalinebreakdoeshappen,forexamplebetweenthetwomiddleones,thenLATEXsetsitlike\(A_1A_2\times\),followedbythebreak,followedby\(A_3A_4\).16.7.3\fracSynopsis:\frac{numerator}{denominator} Chapter16:Mathformulas150 Producesthefraction.Usedas:\begin{displaymath}\frac{1}{\sqrt{2\pi\sigma}}\end{displaymath}.Ininlinemathmodeitcomesoutsmall;seethediscussionof\displaystyle(see Chapter16[Mathformulas],page129 ).16.7.4\left&\rightSynopsis:\leftdelimiter1...\rightdelimiter2Makematchingparentheses,braces,orotherdelimiters.Thedelimitersaresizedaccord-ingtothemaththeyenclose.Thismakesaunitvectorsurroundedbyappropriate-heightparentheses.\begin{equation}\left(\begin{array}{c}1\\0\\\end{array}\right)Every\leftmusthaveamatching\right.Leavingoutthe\left(intheabovegets`Extra\right'.Leavingo the\right)gets`Youcan'tuse`\eqno'inmathmode'.However,thetwodelimitersdelimiter1anddelimiter2neednotmatch.Acommoncaseisthatyouwantanunmatchedbrace,asbelow.Useaperiod,`.',asanulldelimiter.\begin{equation}f(n)=\left\{\begin{array}{ll}1&\mbox{--if\(n=0\)}\\f(n-1)+3n^2&\mbox{--else}\end{array}\right.\end{equation}Notethattogetacurlybraceasadelimiteryoumustpre xitwithabackslash,\{.16.7.5\sqrtSynopsis,oneof:\sqrt{arg}\sqrt[root-number]{arg}Thesquareroot,oroptionallyotherroots,ofarg.Theoptionalargumentroot-numbergivestheroot,i.e.,enterthecuberootofx+yas\sqrt[3]{x+y}.Itcomesoutlikethis:3p x+y.Theradicalgrowswiththesizeofarg(astheheightoftheradicalgrows,theangleontheleftmostpartgetssteeper,untilforalargeenougharg,itisvertical).LATEXhasaseparate\surdcharacter(see Section16.2[Mathsymbols],page131 ).16.7.6\stackrelSynopsis,oneof:\stackrel{text}{relation}Puttextaboverelation.Toputafunctionnameaboveanarrowenter\stackrel{f}{\longrightarrow}.Theresultlookslikethis:f�!. 151 17ModesAsLATEXprocessesyourdocument,atanypointitisinoneofsixmodes.Theyfallintothreecategoriesoftwoeach,thehorizontalmodes,themathmodes,andtheverticalmodes.Somecommandsonlyworkinonemodeoranother(inparticular,manycommandsonlyworkinoneofthemathmodes),anderrormessageswillrefertothese.ParagraphmodeiswhatLATEXisinwhenprocessingordinarytext.Itbreakstheinputtextintolinesandbreaksthelinesintopages.ThisisthemodeLATEXisinmostofthetime.LRmode(forleft-to-rightmode;inplainTEXthisiscalledrestrictedhorizontalmode)isine ectwhenLATEXstartsmakingaboxwithan\mboxcommand.Asinparagraphmode,LATEX'soutputisastringofwordswithspacesbetweenthem.Unlikeinpara-graphmode,inLRmodeLATEXneverstartsanewline,itjustkeepsgoingfromlefttoright.(AlthoughLATEXwillnotcomplainthattheLRboxistoolong,whenitis nishedandnexttriestoputthatboxintoaline,itcouldverywellcomplainthatthe nishedLRboxwon't tthere.)MathmodeiswhenLATEXisgeneratinganinlinemathematicalformula.DisplaymathmodeiswhenLATEXisgeneratingadisplayedmathematicalformula.(Displayedformulasdi ersomewhatfrominlineones.Oneexampleisthattheplace-mentofthesubscripton\intdi ersinthetwosituations.)VerticalmodeiswhenLATEXisbuildingthelistoflinesandothermaterialmakingtheoutputpage.ThisisthemodeLATEXisinwhenitstartsadocument.Internalverticalmodeisine ectwhenLATEXstartsmakinga\vbox.ThisistheverticalanalogueofLRmode.Forinstance,ifyoubeginaLATEXarticlewith`Let\(x\)be...'thenthesearethemodes: rstLATEXstartseverydocumentinverticalmode,thenitreadsthe`L'andswitchestoparagraphmode,thenthenextswitchhappensatthe`\('whereLATEXchangestomathmode,andthenwhenitleavestheformulaitpopsbacktoparagraphmode.Paragraphmodehastwosubcases.Ifyouusea\parboxcommandoraminipagethenLATEXisputintoparagraphmode.Butitwillnotputapagebreakhere.Insideoneoftheseboxes,calledaparbox,LATEXisininnerparagraphmode.Itsmoreusualsituation,whereitcanputpagebreaks,isouterparagraphmode(see Chapter10[Pagebreaking],page95 ).17.1\ensuremathSynopsis:\ensuremath{formula}Ensurethatformulaistypesetinmathmode.Forinstance,youcanrede necommandsthatordinarilycanbeusedonlyinmathmode,sothattheycanbeusedbothinmathandinplaintext.\newcommand{\dx}{\ensuremath{dx}}In$\intf(x)\,\dx$,the\dx{}isaninfinitesimal. 152 Caution:the\ensuremathcommandisusefulbutnotapanacea.\newcommand{\alf}{\ensuremath{\alpha}}Yougetanalphaintextmode:\alf.Butcomparethecorrectspacingin$\alf+\alf$withthatin\alf+\alf.Bestistotypesetmaththingsinamathmode. 153 18PagestylesThestyleofapagedetermineswhereLATEXplacesthecomponentsofthatpage,suchasheadersandfooters,andthetextbody.Thisincludespagesinthemainpartofthedocumentbutalsoincludesspecialpagessuchasthetitlepageofabook,apagefromanindex,orthe rstpageofanarticle.Thepackagefancyhdrisveryhelpfulforconstructingpagestyles.SeeitsdocumentationonCTAN.18.1\maketitleSynopsis:\maketitleGenerateatitle.Inthestandardclassesthetitleappearsonaseparatepage,exceptinthearticleclasswhereitisatthetopofthe rstpage.(See Section3.1[Documentclassoptions],page7, forinformationaboutthetitlepagedocumentclassoption.)Thisexampleshows\maketitleappearinginitsusualplace,immediatelyafter\begin{document}.\documentclass{article}\title{ConstructingaNuclearReactorUsingOnlyCoconuts}\author{JonasGrumby\thanks{%WiththesupportofaGingerGrantfromtheRoyHinkleySociety.}\\Skipper,\textit{Minnow}\andWillyGilligan\thanks{%ThankstotheMaryAnnSummersfoundationandtoThurstonandLoveyHowell.}\\Mate,\textit{Minnow}}\date{1964-Sep-26}\begin{document}\maketitleJustsitrightbackandyou'llhearatale,ataleofafatefultrip.Thatstartedfromthistropicport,aboardthistinyship.Thematewasamightysailin'man,theSkipperbraveandsure.Fivepassengerssetsailthatdayforathreehourtour.Athreehourtour....YoutellLATEXtheinformationusedtoproducethetitlebymakingthefollowingdeclara-tions.Thesemustcomebeforethe\maketitle,eitherinthepreambleorinthedocumentbody.\author{name1\andname2\and...}Required.Declarethedocumentauthororauthors.Theargumentisalistofauthorsseparatedby\andcommands.Toseparatelineswithinasingleauthor'sentry,forinstancetogivetheauthor'sinstitutionoraddress,useadoublebackslash,\\.Ifyouomitthe\authordeclarationthenyouget`LaTeXWarning:No\authorgiven'. Chapter18:Pagestyles154 \date{text}Optional.Declaretexttobethedocument'sdate.Thetextdoesn'tneedtobeinadateformat;itcanbeanytextatall.Ifyouomit\datethenLATEXusesthecurrentdate(see Section23.8[\today],page197 ).Tohavenodate,insteaduse\date{}.\thanks{text}Optional.Produceafootnote.Youcanuseitintheauthorinformationforacknowledgementsasillustratedabove,butyoucanalsouseitinthetitle,oranyplaceafootnotemakessense.Itcanbeanytextatallsoyoucanuseitforanypurpose,suchastoprintanemailaddress.\title{text}Required.Declaretexttobethetitleofthedocument.Getlinebreaksinsidetextwithadoublebackslash,\\.Ifyouomitthe\titledeclarationthenyouget`LaTeXError:No\titlegiven'.Tomakeyourowntitlepage,see Section8.26[titlepage],page86 .Youcaneithercreatethisasaone-o oryoucanincludeitaspartofarenewed\maketitlecommand.(Manypublisherswillprovideaclasstouseinplaceofarticlethatformatsthetitleaccordingtotheirhouserequirements.)18.2\pagenumberingSynopsis:\pagenumbering{number-style}Speci esthestyleofpagenumbers,andresetsthepagenumber.Thenumberingstyleisre ectedonthepage,andalsointhetableofcontentsandotherpagereferences.Thisdeclarationhasglobalscopesoitse ectisnotdelimitedbybracesorenvironments.Inthisexample,beforetheMainsectionthepagesarenumbered`a',etc.Startingonthepagecontainingthatsection,thepagesarenumbered`1',etc.\begin{document}\pagenumbering{alph}...\section{Main}\pagenumbering{arabic}...Theargumentnumber-styleisoneofthefollowing(seealso Section13.1[\alph\Alph\arabic\roman\Roman\fnsymbol],page116 ).arabicArabicnumerals:1,2,...romanlowercaseRomannumerals:i,ii,...RomanuppercaseRomannumerals:I,II,...alphlowercaseletters:a,b,...Ifyouhavemorethan26pagesthenyouget`LaTeXError:Countertoolarge'.Alphuppercaseletters:A,B,...Ifyouhavemorethan26pagesthenyouget`LaTeXError:Countertoolarge'. Chapter18:Pagestyles155 gobbleLATEXdoesnotoutputapagenumber,althoughitdoesgetreset.Referencestothatpagealsoareblank.(Thisdoesnotworkwiththepopularpackagehyperrefsotohavethepagenumbernotappearyoumaywanttoinsteaduse\pagestyle{empty}or\thispagestyle{empty}.)Traditionally,ifadocumenthasfrontmatter|preface,tableofcontents,etc.|thenitisnumberedwithlowercaseRomannumerals.Themainmatterofadocumentusesarabic.See Section6.7[\frontmatter&\mainmatter&\backmatter],page37 .Ifyouwanttoaddresswherethepagenumberappearsonthepage,see Section18.3[\pagestyle],page155 .Ifyouwanttochangethevalueofpagenumberthenyouwillmanipulatethepagecounter(see Chapter13[Counters],page116 ).18.3\pagestyleSynopsis:\pagestyle{style}Declarationthatspeci eshowthepageheadersandfootersaretypeset,fromthecurrentpageonwards.Adiscussionwithanexampleisbelow.Note rstthatthepackagefancyhdrisnowthestandardwaytomanipulateheadersandfooters.Newdocumentsthatneedtodoanythingotherthanoneofthestandardoptionsbelowshouldusethispackage.SeeitsdocumentationonCTAN.Valuesforstyle:plainTheheaderisempty.Thefootercontainsonlyapagenumber,centered.emptyTheheaderandfooterisempty.headingsPutrunningheadersandfootersoneachpage.Thedocumentstylespeci eswhatgoesinthere;seethediscussionbelow.myheadingsCustomheaders,speci edviathe\markbothorthe\markrightcommands.SomediscussionofthemotivationforLATEX'smechanismwillhelpyouworkwiththeoptionsheadingsormyheadings.Thedocumentsourcebelowproducesanarticle,two-sided,withthepagestyleheadings.Onthisdocument'slefthandpages,LATEXwants(inadditiontothepagenumber)thetitleofthecurrentsection.OnitsrighthandpagesLATEXwantsthetitleofthecurrentsubsection.Whenitmakesupapage,LATEXgetsthisinformationfromthecommands\leftmarkand\rightmark.Soitisupto\sectionand\subsectiontostorethatinformationthere.\documentclass[twoside]{article}\pagestyle{headings}\begin{document}...\section{Section1}...\subsection{Subsection1.1}...\section{Section2}...\subsection{Subsection2.1}... Chapter18:Pagestyles156 \subsection{Subsection2.2}...Supposethatthesecondsectionfallsonaleftpage.Althoughwhenthepagestartsitisinthe rstsection,LATEXwillput`Section2'intheleftpageheader.Astotherightheader,ifnosubsectionstartsbeforetheendoftherightpagethenLATEXblankstherighthandheader.Ifasubsectiondoesappearbeforetherightpage nishesthentherearetwocases.IfatleastonesubsectionstartsontherighthandpagethenLATEXwillputintherightheaderthetitleofthe rstsubsectionstartingonthatrightpage.Ifatleastoneof2.1,2.2,...,startsontheleftpagebutnonestartsontherightthenLATEXputsintherighthandheaderthetitleofthelastsubsectiontostart,thatis,theoneine ectduringtherighthandpage.Toaccomplishthis,inatwo-sidedarticle,LATEXhas\sectionissueacommand\markboth,setting\leftmarkto`Section2'andsetting\rightmarktoblank.And,LATEXhas\subsectionissueacommand\markright,setting\rightmarkto`Subsection2.1',etc.Herearethedescriptionsof\markbothand\markright:\markboth{left-head}{right-head}Setsboththerighthandandlefthandheadinginformationforeitherapagestyleofheadingsormyheadings.Alefthandpageheadingleft-headisgener-atedbythelast\markbothcommandbeforetheendofthepage.Arighthandpageheadingright-headisgeneratedbythe rst\markbothor\markrightthatcomesonthepageifthereisone,otherwisebythelastonethatcamebeforethatpage.\markright{right}Setstherighthandpageheading,leavingtheleftunchanged.18.4\thispagestyleSynopsis:\thispagestyle{style}Worksinthesamewayasthe\pagestyle(see Section18.3[\pagestyle],page155 ),exceptthatitchangestostyleforthecurrentpageonly.Thisdeclarationhasglobalscope,soitse ectisnotdelimitedbybracesorenvironments.Oftenthe rstpageofachapterorsectionhasadi erentstyle.Forexample,thisLATEXbookdocumenthasthe rstpageofthe rstchapterinplainstyle,asisthedefault(see Chapter18[Pagestyles],page153 ).\documentclass{book}\pagestyle{headings}\begin{document}\chapter{Firstchapter}...\chapter{Secondchapter}\thispagestyle{empty}...Theplainstylehasapagenumberonit,centeredinthefooter.Tomakethepageentirelyempty,thecommand\thispagestyle{empty}immediatelyfollowsthesecond\chapter. 157 19SpacesLATEXhasmanywaystoproducewhite(or lled)space.Someofthesearebestsuitedtomathematicaltext;see Section16.6[Spacinginmathmode],page146 .Somespacingcommandsaresuitableforbothregulartextandmathematicaltext;versionsofsomeofthesecommandsareinthischapter.19.1\enspace&\quad&\qquadSynopsis,oneof:\enspace\quad\qquadInsertahorizontalspaceof1/2em,1em,or2em.Theemisalengthde nedbyafontdesigner,oftenthoughtofasbeingthewidthofacapitalM.Oneadvantageofdescribingspaceinemsisthatitcanbemoreportableacrossdocumentsthananabsolutemeasurementsuchaspoints(see [Lengths/em],page122 ).Thisputsasuitablegapbetweentwographics.\begin{center}\includegraphics{womensmile.png}%\qquad\includegraphics{mensmile.png}\end{center}See Section16.6[Spacinginmathmode],page146, for\quadand\qquad.Thesearelengthsfromcenturiesoftypesettingandsomaybeabetterchoiceinmanycircumstancesthanarbitrarylengths,suchasyougetwith\hspace.19.2\hspaceSynopsis,oneof:\hspace{length}\hspace*{length}Insertthehorizontalspacelength.Thelengthcanbepositive,negative,orzero;addingnegativespaceislikebackspacing.Itisarubberlength,thatis,itmaycontainaplusorminuscomponent,orboth(see Chapter14[Lengths],page120 ).Becausethespaceisstretchableandshrinkable,itissometimescalledglue.Thismakesalinewith`Name:'aninchfromtherightmargin.\noindent\makebox[\linewidth][r]{Name:\hspace{1in}}The*-versioninsertshorizontalspacethatnon-discardable.Moreprecisely,whenTEXbreaksaparagraphintolinesanywhitespace|gluesandkerns|thatcomeatalinebreakarediscarded.The*-versionavoidsthat(technically,itaddsanon-discardableinvisibleiteminfrontofthespace).Inthisexample\parbox{0.8\linewidth}{%Fillineachblank:Four\hspace*{1in}andsevenyearsagoourfathersbroughtforthonthiscontinent,anew\hspace*{1in}, Chapter19:Spaces158 conceivedin\hspace*{1in},anddedicatedtothepropositionthatallmenarecreated\hspace*{1in}.}the1inchblankfollowing`conceivedin'fallsatthestartofaline.Ifyouerasethe*thenLATEXdiscardstheblank.Here,the\hspaceseparatesthethreegraphics.\begin{center}\includegraphics{lion.png}%commentkeepsoutextraspace\hspace{1cmminus0.25cm}\includegraphics{tiger.png}%\hspace{1cmminus0.25cm}\includegraphics{bear.png}\end{center}Becausetheargumenttoeach\hspacehasminus0.25cm,eachcanshrinkalittleifthethree guresaretoowide.Buteachspacewon'tshrinkmorethan0.25cm(see Chapter14[Lengths],page120 ).19.3\hfillSynopsis:\hfillProducearubberlengthwhichhasnonaturalspacebutthatcanstretchhorizontallyasfarasneeded(see Chapter14[Lengths],page120 ).Thiscreatesaone-lineparagraphwith`Name:'ontheleftsideofthepageand`QuizOne'ontheright.\noindentName:\hfillQuizOneThe\hfillcommandisequivalentto\hspace{\fill}andsothespacecanbediscardedatlinebreaks.Toavoidthatinsteaduse\hspace*{\fill}(see Section19.2[\hspace],page157 ).Herethegraphsareevenlyspacedinthemiddleofthe gure.\newcommand*{\vcenteredhbox}[1]{\begin{tabular}{@{}c@{}}#1\end{tabular}}...\begin{figure}\hspace*{\fill}%\vcenteredhbox{\includegraphics{graph0.png}}%\hfill\vcenteredhbox{\includegraphics{graph1.png}}%\hspace*{\fill}%\caption{Comparisonoftwographs}\label{fig:twographs}\end{figure}Notethe\hspace*'swherethespacecouldotherwisebedropped.19.4\hssSynopsis:\hssProduceahorizontalspacethatisin nitelyshrinkableaswellasin nitelystretchable(thiscommandisaTEXprimitive).LATEXauthorsshouldreach rstforthe\makeboxcommandtogetthee ectsof\hss(see Section20.1[\mbox&\makebox],page169 ). Chapter19:Spaces159 Here,the rstline's\hssmakestheZstickouttotheright,overwritingtheY.InthesecondlinetheZsticksouttotheleft,overwritingtheX.X\hboxto0pt{Z\hss}YX\hboxto0pt{\hssZ}YWithoutthe\hssyougetsomethinglike`Overfull\hbox(6.11111pttoowide)detectedatline20'.19.5\spacefactorSynopsis:\spacefactor=integerIn uenceLATEX'sgluestretchandshrinkbehavior.Mostuser-leveldocumentsdonotusethiscommand.WhileLATEXislayingoutthematerial,itmaystretchorshrinkthegapsbetweenwords.(Thisspaceisnotacharacter;itiscalledtheinterwordglue;see Section19.2[\hspace],page157 ).The\spacefactorcommand(fromPlainTEX)allowsyouto,forinstance,havethespaceafteraperiodstretchmorethanthespaceafteraword-endingletter.AfterLATEXplaceseachcharacter,orruleorotherbox,itsetsaparametercalledthespacefactor.Ifthenextthingintheinputisaspacethenthisparametera ectshowmuchstretchingorshrinkingcanhappen.Aspacefactorthatislargerthanthenormalvaluemeansthatthegluecanstretchmoreandshrinkless.Normally,thespacefactoris1000.Thisvalueisine ectfollowingmostcharacters,andanynon-characterboxormathformula.Butitis3000afteraperiod,exclamationmark,orquestionmark,itis2000afteracolon,1500afterasemicolon,1250afteracomma,and0afterarightparenthesisorbracket,orclosingdoublequoteorsinglequote.Finally,itis999afteracapitalletter.Ifthespacefactorfis1000thenthegluegapwillbethefont'snormalspacevalue(forComputerModernRoman10pointthisis3.3333points).Otherwise,ifthespacefactorfisgreaterthan2000thenTEXaddsthefont'sextraspacevalue(forComputerModernRoman10pointthisis1.11111points),andthenthefont'snormalstretchvalueismultipliedbyf=1000andthenormalshrinkvalueismultipliedby1000=f(forComputerModernRoman10pointtheseare1.66666and1.11111points).Forexample,considertheperiodendingAman'sbestfriendishisdog.Afterit,TEXputsina xedextraspace,andalsoallowsthegluetostretch3timesasmuchandshrink1/3asmuch,astheglueafterfriend,whichdoesnotendinaperiod.Therulesforspacefactorsareevenmorecomplexbecausetheyplayadditionalroles.Inpractice,therearetwoconsequences.First,ifaperiodorotherpunctuationisfollowedbyarightparenthesisorbracket,orrightsingleordoublequotethenthespacinge ectofthatperiodcarriesthroughthosecharacters(thatis,thefollowinggluewillhaveincreasedstretchandshrink).Second,ifpunctuationcomesafteracapitalletterthenitse ectisnotinplacesoyougetanordinaryspace.Thissecondcasealsoa ectsabbreviationsthatdonotendinacapitalletter(see Section19.5.1[\@],page160 ).Youcanonlyuse\spacefactorinparagraphmodeorLRmode(see Chapter17[Modes],page151 ).Youcanseethecurrentvaluewith\the\spacefactoror\showthe\spacefactor. Chapter19:Spaces160 (Comment,notreallyrelatedto\spacefactor:ifyougeterrorslike`Youcan'tuse`\spacefactor'inverticalmode',or`Youcan'tuse`\spacefactor'inmathmode.',or`Improper\spacefactor'thenyouhaveprobablytriedtorede neaninternalcommand.See Section12.3[\makeatletter&\makeatother],page105 .)19.5.1\@Synopsis:capital-letter\@.Treataperiodassentence-ending,whereLATEXwouldotherwisethinkitispartofanabbreviation.LATEXthinksthataperiodendsanabbreviationiftheperiodcomesafteracapitalletter,andotherwisethinkstheperiodendsthesentence.Bydefault,injustifyingalineLATEXadjuststhespaceafterasentence-endingperiod(oraquestionmark,exclamationpoint,comma,orcolon)morethanitadjuststhespacebetweenwords(see Section19.5[\spacefactor],page159 ).Thisexampleshowsthetwocasestoremember.Thesongs\textit{RedGuitar},etc.\arebyLoudonWainwright~III\@.Thesecondperiodendsthesentence,despitethatitisprecededbyacapital.WetellLATEXthatitendsthesentencebyputting\@beforeit.The rstperiodendstheabbreviation`etc.'butnotthesentence.Thebackslash-space,\,producesamid-sentencespace.So:ifyouhaveacapitalletterfollowedbyaperiodthatendsthesentence,thenput\@beforetheperiod.Thisholdsevenifthereisaninterveningrightparenthesisorbracket,orrightsingleordoublequote,becausethespacinge ectofthatperiodcarriesthroughthosecharacters.Forexample,thisUsethe\textit{InstructionalPracticesGuide},(abookbytheMAA)\@.willhavecorrectinter-sentencespacingaftertheperiod.The\@commandisonlyforatextmode.Ifyouuseitoutsideofatextmodethenyouget`Youcan'tuse`\spacefactor'inverticalmode'(see Chapter17[Modes],page151 ).Comment:theconversecaseisaperiodendinganabbreviationwhoselastletterisnotacapitalletter,andthatabbreviationisnotthelastwordinthesentence.Forthatcasefollowtheperiodwithabackslash-space,(\),oratie,(~),or\@.ExamplesareNat.\Acad.\Science,andMr.~Bean,and(manure,etc.\@)forsale(noteinthelastonethatthe\@comesbeforetheclosingparenthesis).19.5.2\frenchspacingSynopsis,oneof:\frenchspacing\nonfrenchspacingThe rstdeclarationcausesLATEXtotreatspacingbetweensentencesinthesamewayasspacingbetweenwordsinthemiddleofasentence.Thesecondcausesspacingbetweensentencestostretchorshrinkmore(see Section19.5[\spacefactor],page159 );thisisthedefault.Sometypographictraditions,includingEnglish,prefertoadjustthespacebetweensen-tences(orspacesfollowingaquestionmark,exclamationpoint,comma,orcolon)morethan Chapter19:Spaces161 thespacebetweenwordsthatareinthemiddleofasentence.Declaring\frenchspacing(thecommandisfromPlainTEX)switchestothetraditionthatallspacesaretreatedequally.19.5.3\normalsfcodesSynopsis:\normalsfcodesResettheLATEXspacefactorvaluestothedefault(see Section19.5[\spacefactor],page159 ).19.6Backslash-space,\Thissectionreferstothecommandconsistingoftwocharacters,abackslashfollowedbyaspace.Synopsis:\Produceaspace.Bydefaultitproduceswhitespaceoflength3.33333ptplus1.66666ptminus1.11111pt.Whenyoutypeoneormoreblanksbetweenwords,LATEXproduceswhitespace.Butthatisdi erentthananexplicitspace.Thisillustrates.\begin{tabular}{l}Oneblank:makessomespace\\Threeblanks:inarow\\Threespaces:\\\inarow\\\end{tabular}Onthe rstlineLATEXputssomespaceafterthecolon.OnthesecondlineLATEXcollapsesthethreeblankstooutputonewhitespace,soyouendwiththesamespaceafterthecolonasinthe rstline.LATEXwouldsimilarlycollapseablankfollowedbyatab,orablankandanewlineandablank.However,thebottomlineasksforthreespacessothewhiteareaiswider.Thatis,thebackslash-spacecommandcreatesa xedamountofhorizontalspace.(Notethatyoucande neahorizontalspaceofanywidthatallwith\hspace;see Section19.2[\hspace],page157 .)Thebackslash-spacecommandhastwomainuses.Itisoftenusedaftercontrolsequencestokeepthemfromgobblingthespacethatfollows,asin\TeX\isnice.(Butusingcurlyparentheses,asin\TeX{}isbest,hastheadvantageofstillworkingifthenextcharacterisaperiod.)Theothercommonuseisthatitmarksaperiodasendinganabbreviationinsteadofendingasentence,asinSosaysProf.\Smith(see Section19.5.1[\@],page160 ).Undernormalcircumstances,\taband\newlineareequivalenttobackslash-space,\.19.7~Synopsis:before~afterThetiecharacter,~,producesaspacebetweenbeforeandafteratwhichthelinewillnotbebroken.Bydefaultthewhitespacehaslength3.33333ptplus1.66666ptminus1.11111pt(see Chapter14[Lengths],page120 ). Chapter19:Spaces162 HereLATEXwillnotbreakthelinebetweenthe naltwowords.ThankstoProf.~Lerman.Inaddition,despitetheperiod,LATEXdoesnotusetheend-of-sentencespacing(see Section19.5.1[\@],page160 ).Tiespreventtheendoflineseparationofthingswherethatcouldcauseconfusion.ButtheyalsoreduceLATEX'soptionswhenitbreakslinesintoparagraphs,soyoucanusetoomany.Theyarealsomattersoftaste,sometimesalarminglydogmatictaste,amongreaders.Nevertheless,herearesomeusagemodels,manyofthemfromtheTEXbook.Betweenanenumeratoranditsitem,suchasinreferences:Chapter~12,orTheorem~\ref{th:Wilsons},orFigure~\ref{fig:KGraph}.Whencasesareenumeratedinline:(b)~Showthat$f(x)$is(1)~continuous,and(2)~bounded.Betweenanumberanditsunit:$745.7.8$~watts(thesiunitxpackagehasaspecialfacilityforthis)or144~eggs.Thisincludesbetweenamonthandadate:October~12or12~Oct.Ingeneral,inanyexpressionswherenumbersandabbreviationsorsymbolsareseparatedbyaspace:AD~565,or2:50~pm,orBoeing~747,or268~PlainsRoad,or\$$1.4$~billion.Whenmathematicalphrasesarerenderedinwords:equals~$n$,orlessthan~$\epsilon$,orgiven~$X$,ormodulo~$p^e$foralllarge~$n$(butcompareis~$15$withis$15$~timestheheight).Betweenmathematicalsymbolsinappositionwithnouns:dimension~$d$orfunction~$f(x)$(butcomparewithlength$l$~ormore).Whenasymbolisatightlyboundobjectofapreposition:of~$x$,orfrom$0$to~$1$,orincommonwith~$m$.Betweensymbolsinseries:$1$,~$2$,or~$3$or$1$,~$2$,\ldots,~$n$.Betweenaperson'sforenamesandbetweenmultiplesurnames:Donald~E.Knuth,orLuis~I.Trabb~Pardo,orCharles~XII(butyoumustgiveTeXplacestobreakthelinesoyoumaydoCharlesLouisXavier~Josephde~laVall\'ee~Poussin).Beforeadash:pages12~--14oritis~---itmustbesaid~---plausible.19.8\thinspace&\negthinspaceSynopsis,oneof:\thinspace\negthinspaceProduceanunbreakableandunstretchablespaceof1/6emand-1/6em.Thesearethetextmodeequivalentsof\,and\!(see [Spacinginmathmode/\thinspace],page147 ).Youcanuse\,asasynonymfor\thinspaceintextmode.The\negthinspacecommandisusedintextmodemostlyfor ddlingwithspaces.Onecommonuseof\thinspaceisasthespacebetweennestedquotes.Killickreplied,``IheardtheCaptainsay,`Ahoythere.'\thinspace''Anotheruseisthatsomestyleguidescallfora\thinspacebetweenanellipsisandasentenceendingperiod(otherstyleguides,though,thinkthethreedotsarequiteenoughalready).Stillanotheruseisbetweeninitials,asinD.\thinspaceE.\Knuth. Chapter19:Spaces163 19.9\/Synopsis:before-character\/after-characterInsertanitaliccorrection,asmallspacede nedbythefontdesignerforeachcharacter,toavoidthecharactercollidingwithwhateverfollows.Whenyouuse\/,LATEXtakesthecorrectionfromthefontmetric le,scalesitbyanyscalingthathasbeenappliedtothefont,andtheninsertsthatmuchhorizontalspace.Here,wereitnotforthe\/,thebefore-characteritalicfwouldhittheafter-characterromanH\newcommand{\companylogo}{{\itf}\/H}becausetheitalicletterleansfartotheright.Ifafter-characterisaperiodorcommathendon'tinsertanitaliccorrectionsincethosepunctuationsymbolshaveaverysmallheight.However,withsemicolonsorcolonsaswellaswithnormalletters,theitaliccorrectioncanhelp.Whenyouusecommandssuchas\textitor\itshapetochangefonts,LATEXwillautomaticallyinsertanyneededitaliccorrection(see Section4.1[Fontstyles],page16 ).Romancharacterscanalsohaveanitaliccorrection.Anexampleisinthenamepdf\/\TeX.Thereisnoconceptofitaliccorrectioninmathmode;spacingisdoneinadi erentway.19.10\hrulefill&\dotfillSynopsis,oneof:\hrulefill\dotfillProduceanin nitehorizontalrubberlength(see Chapter14[Lengths],page120 )thatLATEX llswitharule(thatis,aline)orwithdots,insteadofwhitespace.Thisoutputsaline2incheslong.Name:~\makebox[2in]{\hrulefill}Thisexample,whenplacedbetweenblanklines,createsaparagraphthatisleftandrightjusti edandwherethemiddleis lledwithevenlyspaceddots.\noindentJohnAubrey,RN\dotfill{}MelburyLodgeTomaketheruleordotsgototheline'senduse\nullatthestartorend.Tochangetherule'sthickness,copythede nitionandadjustit,ashere\renewcommand{\hrulefill}{%\leavevmode\leaders\hruleheight1pt\hfill\kern\z@}whichchangesthedefaultthicknessof0.4ptto1pt.Similarly,adjustthedotspacingaswith\renewcommand{\dotfill}{%\leavevmode\cleaders\hb@xt@1.00em{\hss.\hss}\hfill\kern\z@}whichchangesthedefaultlengthof0.33emto1.00em. Chapter19:Spaces164 Thisexampleproducesalineforasignature.\begin{minipage}{4cm}\centering\hrulefill\\Signed\end{minipage}Thelineis4cmlong.19.11\bigskip&\medskip&\smallskipSynopsis,oneof:\bigskip\medskip\smallskipProduceanamountofverticalspace,largeormedium-sizedorsmall.Thesecommandsarefragile(see Section12.11[\protect],page113 ).Heretheskipsuggeststhepassageoftime(fromTheGoldenOceanbyO'Brian).MrSaumarezwouldhavesomethingrudetosaytohim,nodoubt:hewasathomeagain,anditwasdelightful.\bigskip``Ahundredandfifty-sevenmilesandonethird,intwenty-fourhours,''saidPeter.Eachcommandisassociatedwithalengthde nedinthedocumentclass le.\bigskipThesameas\vspace{\bigskipamount},ordinarilyaboutonelinespace,withstretchandshrink.Thedefaultforthebookandarticleclassesis12ptplus4ptminus4pt.\medskipThesameas\vspace{\medskipamount},ordinarilyabouthalfofalinespace,withstretchandshrink.Thedefaultforthebookandarticleclassesis6ptplus2ptminus2pt.\smallskipThesameas\vspace{\smallskipamount},ordinarilyaboutaquarterofalinespace,withstretchandshrink.Thedefaultforthebookandarticleclassesis3ptplus1ptminus1pt.Becauseeachcommandisa\vspace,ifyouuseoninmid-paragraphthenitwillinsertitsverticalspacebetweenthelineinwhichyouuseitandthenextline,notnecessarilyattheplacethatyouuseit.Sothesearebestbetweenparagraphs.Thecommands\bigbreak,\medbreak,and\smallbreakaresimilarbutalsosuggesttoLATEXthatthisisagoodplacetoputapagebreak(see Section19.12[\bigbreak&\medbreak&\smallbreak],page165 . Chapter19:Spaces165 19.12\bigbreak&\medbreak&\smallbreakSynopsis,oneof:\bigbreak\medbreak\smallbreakProduceaverticalspacethatisbigormedium-sizedorsmall,andsuggesttoLATEXthatthisisagoodplacetobreakthepage.(Theassociatedpenaltiesare-200,-100,and-50.)See Section19.11[\bigskip&\medskip&\smallskip],page164 ,formore.Thesecom-mandsproducethesameverticalspacebutdi erinthattheyalsoremoveaprecedingverticalspaceifitislessthanwhattheywouldinsert(aswith\addvspace).Inaddition,theyterminateaparagraphwheretheyareused:thisexampleabc\bigbreakdefghijklmnopqrwilloutputthreeparagraphs,the rstendingin`abc'andthesecondstarting,afteranextraverticalspaceandaparagraphindent,with`def'.19.13\strutSynopsis:\strutEnsurethatthecurrentlinehasheightatleast0.7\baselineskipanddepthatleast0.3\baselineskip.Essentially,LATEXinsertsintothelinearectanglehavingzerowidth,\rule[-0.3\baselineskip]{0pt}{\baselineskip}(see Section23.7[\rule],page196 ).The\baselineskipchangeswiththecurrentfontandfontsize.Inthisexamplethe\strutkeepstheboxinsidetheframefromhavingzeroheight.\setlength{\fboxsep}{0pt}\framebox[2in]{\strut}Thisexamplehasfourlists.Inthe rstthereisamuchbiggergapbetweenitems2and3thanthereisbetweenitems1and2.Thesecondlist xesthatwitha\strutattheendofits rstitem'ssecondline.\setlength{\fboxsep}{0pt}\noindent\begin{minipage}[t]{0.2\linewidth}\begin{enumerate}\item\parbox[t]{15pt}{test\\test}\itemtest\itemtest\end{enumerate}\end{minipage}%\begin{minipage}[t]{0.2\linewidth}\begin{enumerate}\item\parbox[t]{15pt}{test\\test\strut}\itemtest\itemtest\end{enumerate} Chapter19:Spaces166 \end{minipage}%\begin{minipage}[t]{0.2\linewidth}\begin{enumerate}\item\fbox{\parbox[t]{15pt}{test\\test}}\item\fbox{test}\item\fbox{test}\end{enumerate}\end{minipage}%\begin{minipage}[t]{0.2\linewidth}\begin{enumerate}\item\fbox{\parbox[t]{15pt}{test\\test\strut}}\item\fbox{test}\item\fbox{test}\end{enumerate}\end{minipage}%The naltwolistsuse\fboxtoshowwhat'shappening.Thethirdlist's\parboxgoesonlytothebottomofitssecond`test',whichhappensnothaveanycharactersthatdescendbelowthebaseline.Thefourthlistaddsthestrutthatgivestheneededextrabelow-baselinespace.The\strutcommandisoftenusefulingraphics,suchasinTikZorAsymptote.Forinstance,youmayhaveacommandsuchas\graphnode{node-name}that tsacirclearoundnode-name.However,unlessyouarecarefulthenode-name's`x'and`y'willproducedi erent-diametercirclesbecausethecharactersaredi erentsizes.Acareful\graphnodemightinserta\strut,thennode-name,andthendrawthecircle.Thegeneralapproachofusingazerowidth\ruleisusefulinmanycircumstances.Inthistable,thezero-widthrulekeepsthetopofthe rstintegralfromhittingthe\hline.Similarly,thesecondrulekeepsthesecondintegralfromhittingthe rst.\begin{tabular}{rl}\textsc{Integral}&\textsc{Value}\\\hline$\int_0^xt\,dt$&$x^2/2$\rule{0em}{2.5ex}\\$\int_0^xt^2\,dt$&$x^3/3$\rule{0em}{2.5ex}\end{tabular}(Althoughtheline-endingdoublebackslashcommandhasanavailableoptionalargumenttoputinmoreverticalroom,thatwon'tworkhere.Changingthe rstdoublebackslashtosomethinglike\\[2.5ex]willputtheroombetweentheheaderlineandthe\hline,andtheintegralwouldstillhittheline.)19.14\vspaceSynopsis,oneof:\vspace{length}\vspace*{length}Addtheverticalspacelength.Thelengthcanbepositive,negative,orzero.Itisarubberlength|itmaycontainaplusorminuscomponent(see Chapter14[Lengths],page120 ). Chapter19:Spaces167 Thisputsspacebetweenthetwoparagraphs.AndIslept.\vspace{1explus0.5ex}Thenewdaydawnedcold.(See Section19.11[\bigskip&\medskip&\smallskip],page164, forcommoninter-paragraphspaces.)The*-versioninsertsverticalspacethatnon-discardable.Moreprecisely,LATEXdiscardsverticalspaceatapagebreakandthe*-versioncausesthespacetostay.Thisexampleleavesspacebetweenthetwoquestions.Question:Findtheintegralof\(5x^4+5\).\vspace*{2cmplus0.5cm}Question:Findthederivativeof\(x^5+5x+9\).Thatspacewillbepresentevenifthepagebreakhappenstofallbetweenthequestions.Ifyouuse\vspaceinthemiddleofaparagraph(i.e.,inhorizontalmode)thenthespaceisinsertedafterthelinecontainingthe\vspacecommand;itdoesnotstartanewparagraphatthe\vspacecommand.Inthisexamplethetwoquestionswillbeevenlyspacedverticallyonthepage,withatleastoneinchofspacebeloweach.\begin{document}1)Whoputthebompinthebompbahbompbahbomp?\vspace{1inplus1fill}2)Whoputtheramintheramalamadingdong?\vspace{1inplus1fill}\end{document}19.15\vfillSynopsis:\vfillEndthecurrentparagraphandinsertaverticalrubberlengththatisin nite,soitcanstretchorshrinkasfarasneeded(see Chapter14[Lengths],page120 ).Itisoftenusedinthesamewayas\vspace{\fill},exceptthat\vfillendsthecurrentparagraphwhereas\vspace{\fill}addsthein niteverticalspacebelowitsline,irrespectiveoftheparagraphstructure.Inbothcasesthatspacewilldisappearatapageboundary;tocircumventthisseethestarredoptionin Section19.14[\vspace],page166 .Inthisexamplethepageis lled,sothetopandbottomlinescontainthetext`LostDog!'andthesecond`LostDog!'isexactlyhalfwaybetweenthem.\begin{document}LostDog!\vfillLostDog!%perfectlyinthemiddle Chapter19:Spaces168 \vfillLostDog!\end{document}19.16\addvspaceSynopsis:\addvspace{vert-length}Addaverticalspaceofvert-length.However,iftherearetwoormore\addvspace'sinasequencethentogethertheyonlyaddthespaceneededtomakethenaturallengthequaltothemaximumofthevert-length'sinthatsequence.Thiscommandisfragile(see Section12.11[\protect],page113 ).Thevert-lengthisarubberlength(see Chapter14[Lengths],page120 ).Thisexampleillustrates.Thepicturedrawsascale.InastandardLATEXarticlethelength\baselineskipis12pt.Thetworuleshereare22ptapart:thesumofthe\baselineskipandthe10ptfromthe rstaddvspace.\documentclass{article}\usepackage{color}\begin{document}\setlength{\unitlength}{2pt}%\noindent\begin{picture}(0,0)%\multiput(0,0)(0,-1){25}{{\color{blue}\line(1,0){1}}}\multiput(0,0)(0,-5){6}{{\color{red}\line(1,0){2}}}\end{picture}%\rule{0.25\linewidth}{0.1pt}%\par\addvspace{10pt}%\addvspace{20pt}%\par\noindent\rule{0.25\linewidth}{0.1pt}%\end{document}Nowuncommentthesecond\addvspace.Itdoesnotmakethegap20ptlonger;insteadthegapisthesumof\baselineskipand20pt.So\addvspaceinasensedoestheoppositeofitsname|itmakessurethatmultipleverticalspacesdonotaccumulate,butinsteadthatonlythelargestoneisused.LATEXusesthiscommandtoadjusttheverticalspaceaboveorbelowanenvironmentthatstartsanewparagraph.Forinstance,atheoremenvironmentbeginsandendswith\addvspacesothattwoconsecutivetheorem'sareseparatedbyoneverticalspace,nottwo.Aerror`Something'swrong--perhapsamissing\item'pointingtoan\addvspacemeansthatyouwerenotinverticalmodewhenyouhitthiscommand.Onewaytochangethatistoprecede\addvspacewitha\parcommand(see Section15.1[\par],page125 ),asintheaboveexample. 169 20BoxesAtitscore,LATEXputsthingsinboxesandthenputstheboxesonapage.Sothesecommandsarecentral.TherearemanypackagesonCTANthatareusefulformanipulatingboxes.Oneusefuladjuncttothecommandshereisadjustbox.20.1\mbox&\makeboxSynopsis,oneof:\mbox{text}\makebox{text}\makebox[width]{text}\makebox[width][position]{text}Createabox,acontainerformaterial.ThetextistypesetinLRmode(see Chapter17[Modes],page151 )soitisnotbrokenintolines.The\mboxcommandisrobust,while\makeboxisfragile(see Section12.11[\protect],page113 ).Becausetextisnotbrokenintolines,youcanuse\mboxtopreventhyphenation.Inthisexample,LATEXwillnothyphenatethetablename,`T-4'.SeeTable~\mbox{T-4}The rsttwocommandversions,\mboxand\makebox,areroughlyequivalent.Theycreateaboxjustwideenoughtocontainthetext.(TheyarelikeplainTEX's\hbox.)Inthethirdversiontheoptionalargumentwidthspeci esthewidthofthebox.Notethatthespaceoccupiedbythetextneednotequalthewidthofthebox.Foronething,textcanbetoosmall;thiscreatesafull-linebox\makebox[\linewidth]{ChapterExam}with`ChapterExam'centered.Buttextcanalsobetoowideforwidth.Seetheexamplebelowofzero-widthboxes.InthewidthargumentyoucanusethefollowinglengthsthatrefertothedimensionoftheboxthatLATEXgetsontypesettingtext:\depth,\height,\width,\totalheight(thisisthebox'sheightplusitsdepth).Forexample,tomakeaboxwiththetextstretchedtodoublethenaturalsizeyoucansaythis.\makebox[2\width]{Getastretcher}Forthefourthcommandversiontheoptionalargumentpositiongivespositionofthetextwithinthebox.Itmaytakethefollowingvalues:cThetextiscentered(default).lThetextis ushleft.rFlushright.sStretchtheinterwordspaceintextacrosstheentirewidth.Thetextmustcontainstretchablespaceforthistowork.Forinstance,thiscouldheadapressrelease:\noindent\makebox[\textwidth][s]{\large\hfilIMMEDIATE\hfilRELEASE\hfil} Chapter20:Boxes170 Acommonuseof\makeboxistomakezero-widthtextboxes.Thisputsthevalueofthequizquestionstotheleftofthosequestions.\newcommand{\pts}[1]{\makebox[0em][r]{#1points\hspace*{1em}}}\pts{10}Whatistheair-speedvelocityofanunladenswallow?\pts{90}AnAfricanorEuropeanswallow?Therightedgeoftheoutput`10points'(notetheendingspace)willbejustbeforethe`What'(notethespaceafter`points').Youcanuse\makeboxsimilarlywhenmakinggraphics,suchasinTikZorAsymptote,whereyouputtheedgeofthetextataknownlocation,regardlessofthelengthofthattext.Forboxeswithframessee Section20.2[\fbox&\framebox],page170 .Forcolorssee Section21.3.3[Coloredboxes],page178 .Thereisarelatedversionof\makeboxthatisusedwithinthepictureenvironment,wherethelengthisgivenintermsof\unitlength(see Section8.19.13[\makebox(picture)],page71 ).Ifyouputadouble-backslashintotextthenLATEXwillnotgiveyouanewline;forinstance\makebox{abcdef\\ghi}outputs`abcdefghi'while\makebox{abcdef\parghi}outputs`abcdefghi',butneithergotoasecondline.Togetmultiplelinessee Section20.3[\parbox],page171, and Section8.18[minipage],page63 .20.2\fbox&\frameboxSynopses,oneof:\fbox{text}\framebox{text}\framebox[width]{text}\framebox[width][position]{text}Createaboxwithanenclosingframe,fourlinessurroundingthespace.Thesecommandsarethesameas\mboxand\makeboxexceptfortheframe(see Section20.1[\mbox&\makebox],page169 ).The\fboxcommandisrobust,the\frameboxcommandisfragile(see Section12.11[\protect],page113 ).\fbox{Warning!Noworkshown,nocreditgiven.}LATEXputsthetextintoaboxthatcannotbesplitorhyphenated.Aroundthatbox,separatedfromitbyasmallgap,arefourlinesmakingaframe.The rsttwocommandinvocations,\fbox{...}and\framebox{...},areroughlythesame.Astothethirdandfourthinvocations,theoptionalargumentsallowyoutospecifytheboxwidthaswidthandthepositionofthetextinsidethatboxasposition.See Section20.1[\mbox&\makebox],page169, forthefulldescriptionbuthereisanexamplecreatinganemptyboxthatis1/4inwide.\setlength{\fboxsep}{0pt}\framebox[0.25in]{\strut}}The\strutinsertsaverticalheightof\baselineskip(see Section19.13[\strut],page165 ).Theseparametersdeterminetheframelayout. Chapter20:Boxes171 \fboxruleThethicknessofthelinesaroundtheenclosedbox.Thedefaultis0.2pt.Changeitwithacommandsuchas\setlength{\fboxrule}{0.8pt}(see Section14.2[\setlength],page122 ).\fboxsepThedistancefromtheframetotheenclosedbox.Thedefaultis3pt.Changeitwithacommandsuchas\setlength{\fboxsep}{0pt}(see Section14.2[\setlength],page122 ).Settingitto0ptisusefulsometimes:thiswillputaframearoundthepicturewithnowhiteborder.{\setlength{\fboxsep}{0pt}\framebox{%\includegraphics[width=0.5\textwidth]{prudence.jpg}}}Theextracurlybraceskeepthee ectofthe\setlengthlocal.Aswith\mboxand\makebox,LATEXwillnotbreaklinesintext.ButthisexamplehasLATEXbreaklinestomakeaparagraph,andthenframetheresult.\framebox{%\begin{minipage}{0.6\linewidth}Mydear,herewemustrunasfastaswecan,justtostayinplace.Andifyouwishtogoanywhereyoumustruntwiceasfastasthat.\end{minipage}}See Section21.3.3[Coloredboxes],page178, forcolorsotherthanblackandwhite.Thepictureenvironmenthasaversionofthiscommandwheretheunitsdependonpicture's\unitlength(see Section8.19.14[\framebox(picture)],page72 ).20.3\parboxSynopses,oneof:\parbox{width}{contents}\parbox[position]{width}{contents}\parbox[position][height]{width}{contents}\parbox[position][height][inner-pos]{width}{contents}Produceaboxoftextthatiswidthwide.Usethiscommandtomakeaboxofsmallpiecesoftext,ofasingleparagraph.Thiscommandisfragile(see Section12.11[\protect],page113 ).\begin{picture}(0,0)...\put(1,2){\parbox{1.75in}{\raggedrightBecausethegraphisalineonthissemilogpaper,therelationshipisexponential.}}\end{picture}Thecontentsareprocessedinatextmode(see Chapter17[Modes],page151 )soLATEXwillbreaklinestomakeaparagraph.Butitwon'tmakemultipleparagraphs;forthat,useaminipageenvironment(see Section8.18[minipage],page63 ).Theoptionsfor\parbox(exceptforcontents)arethesameasthoseforminipage.Forconvenienceasummaryoftheoptionsisherebutsee Section8.18[minipage],page63, foracompletedescription. Chapter20:Boxes172 Therearetworequiredarguments.Thewidthisarigidlength(see Chapter14[Lengths],page120 ).ItsetsthewidthoftheboxintowhichLATEXtypesetscontents.Thecontentsisthetextthatisplacedinthatbox.Itshouldnothaveanyparagraph-makingcomponents.Therearethreeoptionalarguments,position,height,andinner-pos.Thepositiongivestheverticalalignmentoftheparboxwithrespecttothesurroundingmaterial.Thepossiblevaluesarecormtomaketheverticalcenteroftheparboxlinesupwiththecenteroftheadjacentline(thisisthedefault),orttomatchthetoplineoftheparboxwiththebaselineofthesurroundingmaterial,orbtomatchthebottomline.Theoptionalargumentheightoverridesthenaturalheightofthebox.Theoptionalargumentinner-poscontrolstheplacementofcontentinsidetheparbox.Itsdefaultisthevalueofposition.Itspossiblevaluesare:ttoputthecontentatthetopofthebox,ctoputitintheverticalcenter,btoputitatthebottomofthebox,andstostretchitoutvertically(forthis,thetextmustcontainverticallystretchablespace).20.4\raiseboxSynopsis,oneof:\raisebox{distance}{text}\raisebox{distance}[height]{text}\raisebox{distance}[height][depth]{text}Raiseorlowertext.Thiscommandisfragile(see Section12.11[\protect],page113 ).Thisexamplemakesacommandfortherestrictionofafunctionbyloweringtheverticalbarsymbol.\newcommand\restricted[1]{\raisebox{-.5ex}{$|$}_{#1}}$f\restricted{A}$The rstmandatoryargumentdistancespeci eshowfartoraisethesecondmandatoryargumenttext.Thisisarigidlength(see Chapter14[Lengths],page120 ).Ifitisnegativethenitlowerstext.ThetextisprocessedinLRmodesoitcannotcontainlinebreaks(see Chapter17[Modes],page151 ).Theoptionalargumentsheightanddeptharedimensions.Iftheyarespeci ed,theyoverridethenaturalheightanddepthoftheboxLATEXgetsbytypesettingtext.Intheargumentsdistance,height,anddepthyoucanusethefollowinglengthsthatrefertothedimensionoftheboxthatLATEXgetsontypesettingtext:\depth,\height,\width,\totalheight(thisisthebox'sheightplusitsdepth).Thiswillaligntwographicsontheirtop(see Chapter22[Graphics],page179 ).\usepackage{graphicx}\usepackage{calc}%inpreamble...\begin{center}\raisebox{1ex-\height}{%\includegraphics[width=0.4\linewidth]{lion.png}}\qquad\raisebox{1ex-\height}{%\includegraphics[width=0.4\linewidth]{meta.png}}\end{center}The rst\heightistheheightoflion.pngwhilethesecondistheheightofmeta.png. Chapter20:Boxes173 20.5\sbox&\saveboxSynopsis,oneof:\sbox{box-cmd}{text}\savebox{box-cmd}{text}\savebox{box-cmd}[width]{text}\savebox{box-cmd}[width][pos]{text}Typesettextjustaswith\makebox(see Section20.1[\mbox&\makebox],page169 )exceptthatLATEXdoesnotoutputitbutinsteadsavesitinastoragebinnamedbox-cmd.Thebinnamebox-cmdbeginswithabackslash,\.Youmusthavepreviouslyallocatedthebinbox-cmdwith\newsavebox(see Section12.7[\newsavebox],page108 ).The\sboxcommandisrobustwhile\saveboxisfragile(see Section12.11[\protect],page113 ).Thiscreatesandusesabin.\newsavebox{\fullname}\sbox{\fullname}{JohnJacobJingleheimerSchmidt}...\usebox{\fullname}!Hisnameismyname,too!Wheneverwegoout,thepeoplealwaysshout!Theregoes\\usebox{\fullname}!Yadadadadadada.Oneadvantageofusingandreusingabinovera\newcommandiseciency,thatLATEXneednotrepeatedlyretypesetthecontents.Seetheexamplebelow.The rsttwocommandinvocations,\sbox{box-cmd}{text}and\savebox{box-cmd}{text},areroughlyequivalent.Astothethirdandfourth,theoptionalargumentsallowyoutospecifytheboxwidthaswidth,andthepositionofthetextinsidethatboxasposition.See Section20.1[\mbox&\makebox],page169, forthefulldescription.Inthe\sboxand\saveboxcommandsthetextistypesetinLRmodesoitdoesnothavelinebreaks(see Chapter17[Modes],page151 ).IfyouusethesethenLATEXdoesn'tgiveyouanerrorbutitignoreswhatyouwant:ifyouenter\sbox{\newbin}{test\\test}and\usebox{\newbin}thenyouget`testtest',whileifyouenter\sbox{\newbin}{test\partest}and\usebox{\newbin}thenyouget`testtest',butnoerrororwarning.To xthisusea\parboxorminipageashere.\savebox{\abin}{%\begin{minipage}{\linewidth}\begin{enumerate}\itemFirstitem\itemSeconditem\end{enumerate}\end{minipage}}...\usebox{\abin}Asanexampleoftheeciencyofreusingabin'scontents,thisputsthesamepictureoneachpageofthedocumentbyputtingitintheheader.LATEXonlytypesetsitonce.\usepackage{graphicx}%allthisinthepreamble\newsavebox{\sealbin}\savebox{\sealbin}{% Chapter20:Boxes174 \setlength{\unitlength}{1in}%\begin{picture}(0,0)%\put(1.5,-2.5){%\begin{tabular}{c}\includegraphics[height=2in]{companylogo.png}\\OfficeofthePresident\end{tabular}}\end{picture}%}\markright{\usebox{\sealbin}}\pagestyle{headings}Thepictureenvironmentisgoodfor ne-tuningtheplacement.Ifthebinhasnotalreadybeende nedthenyougetsomethinglike`Undefinedcontrolsequence. rgu;&#xment;\nobin'.20.6lrboxSynopsis:\begin{lrbox}{box-cmd}text\end{lrbox}Thetextinsidetheenvironmentissavedinthebinbox-cmd.Thebox-cmdmustbeginwithabackslash.Youmustcreatethisbininadvancewith\newsavebox(see Section12.7[\newsavebox],page108 ).Thisistheenvironmentformofthe\sboxand\saveboxcom-mands,andisequivalenttothem.See Section20.5[\sbox&\savebox],page173, forthefullinformation.Inthisexampletheenvironmentisconvenientforenteringthetabular.\newsavebox{\jhbin}\begin{lrbox}{\jhbin}\begin{tabular}{c}\includegraphics[height=1in]{jh.png}\\JimHef{}feron\end{tabular}\end{lrbox}...\usebox{\jhbin}20.7\useboxSynopsis:\usebox{box-cmd}Producetheboxmostrecentlysavedinthebinbox-cmdbythecommands\sboxor\savebox,orthelrboxenvironment.See Section20.5[\sbox&\savebox],page173, formoreinformationandexamples.(Notethatbox-cmdstartswithabackslash.)Thiscommandisrobust(see Section12.11[\protect],page113 ). 175 21ColorYoucanaddcolortotext,rules,etc.Youcanalsohavecolorinaboxoronanentirepageandwritetextontopofit.Colorsupportcomesasanadditionalpackage.Soput\usepackage{color}inyourdocumentpreambletousethecommandsdescribedhere.ManyotherpackagesalsosupplementLATEX'scolorabilities.Particularlyworthmen-tioningisxcolor,whichiswidelyusedandsigni cantlyextendsthecapabilitiesdescribedhere,includingadding`HTML'and`Hsb'colormodels.21.1colorpackageoptionsSynopsis(mustbeinthedocumentpreamble):\usepackage[comma-separatedoptionlist]{color}Whenyouloadthecolorpackagetherearetwokindsofavailableoptions.The rstspeci estheprinterdriver.LATEXdoesn'tcontaininformationaboutdi erentoutputsystemsbutinsteaddependsoninformationstoredina le.Normallyyoushouldnotspecifythedriveroptioninthedocument,andinsteadrelyonyoursystem'sdefault.Oneadvantageofthisisthatitmakesthedocumentportableacrosssystems.Forcompletenessweincludealistofthedrivers.Thecurrentlyrelevantonesare:dvipdfmx,dvips,dvisvgm,luatex,pdftex,xetex.Thetwoxdviandoztexareessentiallyaliasesfordvips(andxdviismonochrome).Onesthatshouldnotbeusedfornewsystemsare:dvipdf,dvipdfm,dviwin,dvipsone,emtex,pctexps,pctexwin,pctexhp,pctex32,truetex,tcidvi,vtex(anddviwindoisanaliasfordvipsone).Thesecondkindofoptions,beyondthedrivers,arebelow.monochromeDisablethecolorcommands,sothattheydonotgenerateerrorsbutdonotgeneratecoloreither.dvipsnamesMakeavailablealistof68colornamesthatareoftenused,particularlyinlegacydocuments.Thesecolornameswereoriginallyprovidedbythedvipsdriver,givingtheoptionname.nodvipsnamesDonotloadthatlistofcolornames,savingLATEXatinyamountofmemoryspace.21.2ColormodelsAcolormodelisawayofrepresentingcolors.LATEX'scapabilitiesdependontheprinterdriver.However,thepdftex,xetex,andluatexprinterdriversaretodaybyfarthemostcommonlyused.Themodelsbelowworkforthosedrivers.Allbutoneoftheseisalsosupportedbyessentiallyallotherprinterdriversusedtoday.Notethatcolorcombinationcanbeadditiveorsubtractive.Additivemixescolorsoflight,sothatforinstancecombiningfullintensitiesofred,green,andblueproduceswhite. Chapter21:Color176 Subtractivemixespigments,suchaswithinks,sothatcombiningfullintensityofcyan,magenta,andyellowmakesblack.cmykAcomma-separatedlistwithfourrealnumbersbetween0and1,inclusive.The rstnumberistheintensityofcyan,thesecondismagenta,andtheothersareyellowandblack.Anumbervalueof0meansminimalintensity,whilea1isforfullintensity.Thismodelisoftenusedincolorprinting.Itisasubtractivemodel.grayAsinglerealnumberbetween0and1,inclusive.Thecolorsareshadesofgrey.Thenumber0producesblackwhile1giveswhite.rgbAcomma-separatedlistwiththreerealnumbersbetween0and1,inclusive.The rstnumberistheintensityoftheredcomponent,thesecondisgreen,andthethirdtheblue.Anumbervalueof0meansthatnoneofthatcomponentisaddedin,whilea1meansfullintensity.Thisisanadditivemodel.RGB(pdftex,xetex,luatexdrivers)Acomma-separatedlistwiththreeintegersbetween0and255,inclusive.ThismodelisaconvenienceforusingrgbsinceoutsideofLATEXcolorsareoftendescribedinared-green-bluemodelusingnumbersinthisrange.Thevaluesenteredhereareconvertedtothergbmodelbydividingby255.namedColorsareaccessedbyname,suchas`PrussianBlue'.Thelistofnamesdependsonthedriver,butallsupportthenames`black',`blue',`cyan',`green',`magenta',`red',`white',and`yellow'(Seethedvipsnamesoptionin Section21.1[Colorpackageoptions],page175 ).21.3CommandsforcolorThesearethecommandsavailablewiththecolorpackage.21.3.1De necolorsSynopsis:\definecolor{name}{model}{specification}Givethenamenametothecolor.Forexample,afterthis\definecolor{silver}{rgb}{0.75,0.75,0.74}youcanusethatcolornamewithHiho,\textcolor{silver}{Silver}!.Thisexamplegivesthecoloramoreabstractname,soitcouldchangeandnotbemisleading.\definecolor{logocolor}{RGB}{145,92,131}%RGBneedspdflatex\newcommand{\logo}{\textcolor{logocolor}{Bob'sBigBagels}}Oftenadocument'scolorsarede nedinthepreamble,orintheclassorstyle,ratherthaninthedocumentbody.21.3.2ColoredtextSynopses:\textcolor{name}{...} Chapter21:Color177 \textcolor[colormodel]{colorspecification}{...}or\color{name}\color[colormodel]{specification}Thea ectedtextgetsthecolor.Thisline\textcolor{magenta}{MynameisOzymandias,kingofkings:}Lookonmyworks,yeMighty,anddespair!causesthe rsthalftobeinmagentawhiletherestisinblack.Youcanuseacolordeclaredwith\definecolorinexactlythesamewaythatwejustusedthebuiltincolor`magenta'.\definecolor{MidlifeCrisisRed}{rgb}{1.0,0.11,0.0}I'mthinkingaboutgettinga\textcolor{MidlifeCrisisRed}{sportscar}.Thetwo\textcolorand\colordi erinthatthe rstisacommandform,enclosingthetexttobecoloredasanargument.Oftenthisformismoreconvenient,oratleastmoreexplicit.Thesecondformisadeclaration,asinThemoonismadeof{\color{green}green}cheese,soitisine ectuntiltheendofthecurrentgrouporenvironment.Thisissometimesusefulwhenwritingmacrosorasbelowwhereitcolorseverythinginsidethecenterenvironment,includingtheverticalandhorizontallines.\begin{center}\color{blue}\begin{tabular}{l|r}UL&UR\\\hlineLL&LR\end{tabular}\end{center}Youcanusecolorinequations.Adocumentmighthavethisde nitioninthepreamble\definecolor{highlightcolor}{RGB}{225,15,0}andthencontainthisequation.\begin{equation}\int_a^b\textcolor{highlightcolor}{f'(x)}\,dx=f(b)-f(a)\end{equation}Typicallythecolorsusedinadocumentaredeclaredinaclassorstylebutsometimesyouwantaone-o .Thosearethesecondformsinthesynopses.Colorsof\textcolor[rgb]{0.33,0.14,0.47}{Purple}and{\color[rgb]{0.72,0.60,0.37}Gold}fortheteam.Theformatofcolorspeci cationdependsonthecolormodel(see Section21.2[Colormodels],page175 ).Forinstance,whilergbtakesthreenumbers,graytakesonlyone.Theselectionwas\textcolor[gray]{0.5}{grayedout}.Colorsinsidecolorsdonotcombine.Thus\textcolor{green}{kindof\textcolor{blue}{blue}}hasa nalwordthatisblue,notacombinationofblueandgreen. Chapter21:Color178 21.3.3ColoredboxesSynopses:\colorbox{name}{...}\colorbox[modelname]{boxbackgroundcolor}{...}or\fcolorbox{framecolor}{boxbackgroundcolor}{...}\fcolorbox[modelname]{framecolor}{boxbackgroundcolor}{...}Makeaboxwiththestatedbackgroundcolor.The\fcolorboxcommandputsaframearoundthebox.ForinstancethisName:~\colorbox{cyan}{\makebox[5cm][l]{\strut}}makesacyan-coloredboxthatis vecentimeterslongandgetsitsdepthandheightfromthe\strut(sothedepthis-.3\baselineskipandtheheightis\baselineskip).Thisputswhitetextonabluebackground.\colorbox{blue}{\textcolor{white}{Welcometothemachine.}}The\fcolorboxcommandsusethesameparametersas\fbox(see Section20.2[\fbox&\framebox],page170 ),\fboxruleand\fboxsep,tosetthethicknessoftheruleandtheboundarybetweentheboxinteriorandthesurroundingrule.LATEX'sdefaultsare0.4ptand3pt,respectively.Thisexamplechangesthethicknessoftheborderto0.8points.Notethatitissurroundedbycurlybracessothatthechangeendsattheendofthesecondline.{\setlength{\fboxrule}{0.8pt}\fcolorbox{black}{red}{Undernocircumstancesturnthisknob.}}21.3.4ColoredpagesSynopses:\pagecolor{name}\pagecolor[colormodel]{colorspecification}\nopagecolorThe rsttwosetthebackgroundofthepage,andallsubsequentpages,tothecolor.Foranexplanationofthespeci cationinthesecondformsee Section21.3.2[Coloredtext],page176 .Thethirdreturnsthebackgroundtonormal,whichisatransparentbackground.(Ifthatisnotsupporteduse\pagecolor{white},althoughthatwillmakeawhiteback-groundratherthanthedefaulttransparentbackground.)...\pagecolor{cyan}...\nopagecolor 179 22GraphicsYoucanusegraphicssuchasPNGorPDF lesinyourLATEXdocument.Youneedanadditionalpackage,whichcomesstandardwithLATEX.Thisexampleistheshorthow-to.\include{graphicx}%goesinthepreamble...\includegraphics[width=0.5\linewidth]{plot.pdf}Tousethecommandsdescribedhereyourdocumentpreamblemustcontaineither\usepackage{graphicx}or\usepackage{graphics}.Mostofthetime,graphicxisthebetterchoice.Graphicscomeintwomaintypes,rasterandvector.LATEXcanuseboth.Inrastergraphicsthe lecontainsanentryforeachlocationinanarray,describingwhatcoloritis.Anexampleisaphotograph,inJPGformat.Invectorgraphics,the lecontainsalistofinstructionssuchas`drawacirclewiththisradiusandthatcenter'.AnexampleisalinedrawingproducedbytheAsymptoteprogram,inPDFformat.Generallyvectorgraphicsaremoreusefulbecauseyoucanrescaletheirsizewithoutpixelationorotherproblems,andbecausetheyoftenhaveasmallersize.Therearesystemsparticularlywell-suitedtomakegraphicsforaLATEXdocument.Forexample,theseallowyoutousethesamefontsasinyourdocument.LATEXcomeswithapictureenvironment(see Section8.19[picture],page65 )thathassimplecapabilities.Be-sidesthat,thereareotherwaystoincludethegraphic-makingcommandsinthedocument.TwosuchsystemsarethePSTricksandTikZpackages.TherearealsosystemsexternaltoLATEX,thatgenerateagraphicthatyouincludeusingthecommandsofthischapter.TwothatuseaprogramminglanguageareAsymptoteandMetaPost.OnethatusesagraphicalinterfaceisX g.Fulldescriptionofthesesystemsisoutsidethescopeofthisdocument;seetheirdocumentationonCTAN.22.1graphicspackageoptionsSynopsis(mustbeinthedocumentpreamble):\usepackage[comma-separatedoptionlist]{graphics}or\usepackage[comma-separatedoptionlist]{graphicx}Thegraphicxpackagehasaformatforoptionalargumentstothe\includegraphicscommandthatisconvenient(itisthekey-valueformat),soitisthebetterchoicefornewdocuments.Whenyouloadthegraphicsorgraphicxpackagewith\usepackagetherearetwokindsofavailableoptions.The rstisthatLATEXdoesnotcontaininformationaboutdi erentoutputsystemsbutinsteaddependsoninformationstoredinaprinterdriver le.Normallyyoushouldnotspecifythedriveroptioninthedocument,andinsteadrelyonyoursystem'sdefault.Oneadvantageofthisisthatitmakesthedocumentportableacrosssystems.Forcompletenesshereisalistofthedrivers.Thecurrentlyrelevantonesare:dvipdfmx,dvips,dvisvgm,luatex,pdftex,xetex.Thetwoxdviandoztexareessentiallyaliasesfordvips(andxdviismonochrome).Onesthatshouldnotbeusedfornewsystemsare:dvipdf,dvipdfm,dviwin,dvipsone,emtex,pctexps,pctexwin,pctexhp,pctex32, Chapter22:Graphics180 truetex,tcidvi,vtex(anddviwindoisanaliasfordvipsone).Thesearestoredin leswitha.defextension,suchaspdftex.def.Thesecondkindofoptionsarebelow.demoInsteadofanimage le,LATEXputsina150ptby100ptrectangle(unlessanothersizeisspeci edinthe\includegraphicscommand).draftForeachgraphic le,itisnotshownbutinsteadthe lenameisprintedinaboxofthecorrectsize.Inordertodeterminethesize,the lemustbepresent.final(Default)Overrideanypreviousdraftoption,sothatthedocumentshowsthecontentsofthegraphic les.hiderotateDonotshowrotatedtext.(Thisallowsforthepossibilitythatapreviewerdoesnothavethecapabilitytorotatetext.)hidescaleDonotshowscaledtext.(Thisallowsforthepossibilitythatapreviewerdoesnothavethecapabilitytoscale.)hiresbbInaPSorEPS lethegraphicsizemaybespeci edintwoways.The%%BoundingBoxlinesdescribethegraphicsizeusingintegermultiplesofaPost-Scriptpoint,thatis,integermultiplesof1/72inch.AlateradditiontothePost-Scriptlanguageallowsdecimalmultiples,suchas1.23,in%%HiResBoundingBoxlines.ThisoptionhasLATEXtoreadthesizefromthelatter.22.2graphicspackagecon gurationThesecommandscon gurethewayLATEXsearchesthe lesystemforthegraphic.Thebehaviorof lesystemsearchcodeisnecessarilyplatformdependent.Inthisdoc-umentwecoverGNU/Linux,Macintosh,andWindows,asthosesystemsaretypicallycon gured.Forothersituationsconsultthedocumentationingrfguide.pdf,ortheLATEXsource,oryourTEXdistribution'sdocumentation.22.2.1\graphicspathSynopsis:\graphicspath{listofdirnamesinsidecurlybrackets}Declarealistofdirectoriestosearchforgraphics les.Thisallowsyoutolatersaysomethinglike\includegraphics{lion.png}insteadofhavingtogiveitspath.LATEXalwayslooksforgraphic les rstinthecurrentdirectory.Thedeclarationbelowtellsthesystemtothenlookinthesubdirectorypix,andthen../pix.\usepackage{graphicx}%orgraphics;putinpreamble...\graphicspath{{pix/}{../pix/}}The\graphicspathdeclarationisoptional.Ifyoudon'tincludeitthenLATEX'sdefaultistosearchalloftheplacesthatitusuallylooksfora le(itusesLATEX's\input@path).Inparticular,inthiscaseoneoftheplacesitlooksisthecurrentdirectory. Chapter22:Graphics181 Encloseeachdirectorynameincurlybraces;forexample,aboveitsays`{pix}'.Dothisevenifthereisonlyonedirectory.Eachdirectorynamemustendinaforwardslash,/.ThisistrueevenonWindows,wheregoodpracticeistouseforwardslashesforallthedirectoryseparatorssinceitmakesthedocumentportabletootherplatforms.Ifyouhavespacesinyourdirectorynamethenusedoublequotes,aswith{"mydocs/"}.GettingoneoftheseruleswrongwillcauseLATEXtoreportError:File`filename'notfound.Basically,thealgorithmisthatwiththisexample,afterlookinginthecurrentdirectory,\graphicspath{{pix/}{../pix/}}...\usepackage{lion.png}foreachofthelisteddirectories,LATEXconcatenatesitwiththe lenameandsearchesfortheresult,checkingforpix/lion.pngandthen../pix/lion.png.Thisalgorithmmeansthatthe\graphicspathcommanddoesnotrecursivelysearchsubdirectories:ifyouissue\graphicspath{{a/}}andthegraphicisina/b/lion.pngthenLATEXwillnot ndit.Italsomeansthatyoucanuseabsolutepathssuchas\graphicspath{{/home/jim/logos/}}or\graphicspath{{C:/Users/Albert/Pictures/}}.However,usingthesemeansthatthedocumentisnotportable.(YoucouldpreserveportabilitybyadjustingyourTEXsystemsettingscon guration leparameterTEXINPUTS;seethedocumentationofyoursystem.)Youcanuse\graphicspathanywhereinthedocument.Youcanuseitmorethanonce.Showitsvaluewith\makeatletter\typeout{\Ginput@path}\makeatother.Thedirectoriesaretakenwithrespecttothebase le.Thatis,supposethatyouarework-ingonadocumentbasedonbook/book.texanditcontains\include{chapters/chap1}.Ifinchap1.texyouput\graphicspath{{plots/}}thenLATEXwillnotsearchforgraphicsinbook/chapters/plots,butinsteadinbook/plots.22.2.2\DeclareGraphicsExtensionsSynopses:\DeclareGraphicsExtensions{comma-separatedlistoffileextensions}Declarethe lenameextensionstotry.Thisallowsyoutospecifytheorderinwhichtochoosegraphicformatswhenyouincludegraphic lesbygivingthe lenamewithouttheextension,asin\includegraphics{functionplot}.Inthisexample,LATEXwill nd lesinthePNGformatbeforePDF les.\DeclareGraphicsExtensions{.png,PNG,.pdf,.PDF}...\includegraphics{lion}%willfindlion.pngbeforelion.pdfBecausethe lenameliondoesnothaveaperiod,LATEXusestheextensionlist.Foreachdirectoryinthegraphicspath(see Section22.2.1[\graphicspath],page180 ),LATEXwilltrytheextensionsintheordergiven.Ifitdoesnot ndsucha leaftertryingallthedirectoriesandextensionsthenitreports`!LaTeXError:File`lion'notfound'.Notethatyoumustincludetheperiodsatthestartoftheextensions.BecauseGNU/LinuxandMacintosh lenamesarecasesensitive,thelistof leextensionsiscasesensitiveonthoseplatforms.TheWindowsplatformisnotcasesensitive.Youarenotrequiredtoinclude\DeclareGraphicsExtensionsinyourdocument;theprinterdriverhasasensibledefault.Forexample,themostrecentpdftex.defhasthisextensionlist. Chapter22:Graphics182 .png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2Youcanusethiscommandanywhereinthedocument.Youcanuseitmorethanonce.Showitsvaluewith\makeatletter\typeout{\Gin@extensions}\makeatother.22.2.3\DeclareGraphicsRuleSynopsis:\DeclareGraphicsRule{extension}{type}{size-fileextension}{command}Declarehowtohandlegraphic leswhosenamesendinextension.Thisexampledeclaresthatall leswithnameshavetheformfilename-without-dot.mpswillbetreatedasoutputfromMetaPost,meaningthattheprinterdriverwilluseitsMetaPost-handlingcodetoinputthe le.\DeclareGraphicsRule{.mps}{mps}{.mps}{}This\DeclareGraphicsRule{*}{mps}{*}{}tellsLATEXthatitshouldhandleasMetaPostoutputany lewithanextensionnotcoveredbyanotherrule,soitcoversfilename.1,filename.2,etc.Thisdescribesthefourarguments.extensionThe leextensiontowhichthisruleapplies.Theextensionisanythingafterandincludingthe rstdotinthe lename.UsetheKleenestar,*,todenotethedefaultbehaviourforallundeclaredextensions.typeThetypeof leinvolved.Thistypeisastringthatmustbede nedintheprinterdriver.Forinstance, leswithextensions.ps,.eps,or.ps.gzmayallbeclassedastypeeps.All lesofthesametypewillbeinputwiththesameinternalcommandbytheprinterdriver.Forexample,the letypesthatpdftexrecognizesare:jpg,jbig2,mps,pdf,png,tif.size- leextensionTheextensionofthe letobereadtodeterminethesizeofthegraphic,ifthereissucha le.Itmaybethesameasextensionbutitmaybedi erent.Asanexample,consideraPostScriptgraphic.Tomakeitsmaller,itmightbecompressedintoa.ps.gz le.Compressed lesarenoteasilyreadbyLATEXsoyoucanputtheboundingboxinformationinaseparate le.Ifsize- leextensionisemptythenyoumustspecifysizeinformationintheargumentsof\includegraphics.Ifthedriver lehasaprocedureforreadingsize lesfortypethenthatwillbeused,otherwiseitwillusetheprocedureforreading.eps les.(Thusyoumayspecifythesizeofbitmap lesina lewithaPostScriptstyle%%BoundingBoxlineifnootherformatisavailable.)commandAcommandthatwillbeappliedtothe le.Thisisveryoftenleftblank.Thiscommandmuststartwithasinglebackwardquote.Thus,\DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{`gunzip-c#1}speci esthatany lewiththeextension.eps.gzshouldbetreatedasaneps le,withtheBoundingBoxinformationstoredinthe lewithextension.eps.bb,and Chapter22:Graphics183 thatthecommandgunzip-cwillrunonyourplatformtodecompressesthe le.Suchacommandisspeci ctoyourplatform.Inaddition,yourTEXsystemmustallowyoutorunexternalcommands;asasecuritymeasuremodernsys-temsrestrictrunningcommandsunlessyouexplicitlyallowit.Seethedocu-mentationforyourTEXdistribution.22.3CommandsforgraphicsThesearethecommandsavailablewiththegraphicsandgraphicxpackages.22.3.1\includegraphicsSynopsesforgraphicspackage:\includegraphics{filename}\includegraphics[urx,ury]{filename}\includegraphics[llx,lly][urx,ury]{filename}\includegraphics*{filename}\includegraphics*[urx,ury]{filename}\includegraphics*[llx,lly][urx,ury]{filename}Synopsesforgraphicxpackage:\includegraphics{filename}\includegraphics[key-valuelist]{filename}\includegraphics*{filename}\includegraphics*[key-valuelist]{filename}Includeagraphics le.Thestarredform\includegraphics*willclipthegraphictothesizespeci ed,whilefortheunstarredformanypartofthegraphicthatisoutsidetheboxofthespeci edsizewillover-printthesurroundingarea.This\usepackage{graphicx}%inpreamble...\begin{center}\includegraphics{plot.pdf}\end{center}willincorporateintothedocumentthegraphicinplot.pdf,centeredandatitsnominalsize.Youcanalsogiveapathtothe le,aswith\includegraphics{graphics/plot.pdf}.Tospecifyalistoflocationstosearchforthe le,see Section22.2.1[\graphicspath],page180 .Ifyour lenameincludesspacesthenputitindoublequotes.Anexampleis\includegraphics{"sisterpicture.jpg"}.The\includegraphics{filename}commanddecidesonthetypeofgraphicbysplitting lenameonthe rstdot.Youcanuse lenamewithnodot,asin\includegraphics{turing}andthenLATEXtriesasequenceofextensionssuchas.pngand.pdfuntilit ndsa lewiththatextension(see Section22.2.2[\DeclareGraphicsExtensions],page181 ).Ifyour lenamecontainsdotsbeforetheextensionthenyoucanhidethemwithcurlybraces,asin\includegraphics{{plot.2018.03.12.a}.pdf}.Or,ifyouusethegraphicx Chapter22:Graphics184 packagethenyoucanusetheoptionstypeandext;seebelow.Thisandother lenameissuesarealsohandledwiththepackagegrffile.Thisexampleputsagraphicina gureenvironmentsoLATEXcanmoveittothenextpageif ttingitonthecurrentpageisawkward(see Section8.10[ gure],page52 ).\begin{figure}\centering\includegraphics[width=3cm]{lungxray.jpg}\caption{Theevidenceisoverwhelming:don'tsmoke.}\label{fig:xray}\end{figure}Thisplacesagraphicthatwillnot oat,soitissuretoappearatthispointinthedocumentevenifmakesLATEXstretchthetextorresorttoblankareasonthepage.Itwillbecenteredandwillhaveacaption.\usepackage{caption}%inpreamble...\begin{center}\includegraphics{pix/nix.png}\captionof{figure}{Thespiritofthenight}\label{pix:nix}%optional\end{center}Thisexampleputsaboxwithagraphicsidebysidewithonehavingtext,withthetwoverticallycentered.\newcommand*{\vcenteredhbox}[1]{\begin{tabular}{@{}c@{}}#1\end{tabular}}...\begin{center}\vcenteredhbox{\includegraphics[width=0.4\textwidth]{plot}}\hspace{1em}\vcenteredhbox{\begin{minipage}{0.4\textwidth}\begin{displaymath}f(x)=x\cdot\sin(1/x)\end{displaymath}\end{minipage}}\end{center}Ifyouusethegraphicspackagethentheonlyoptionsinvolvethesizeofthegraphic(butsee Section22.3.2[\rotatebox],page188, and Section22.3.3[\scalebox],page189 ).Whenoneoptionalargumentispresentthenitis[urx,ury]anditgivesthecoordinatesofthetoprightcorneroftheimage,asapairofTEXdimensions(see Section14.1[Unitsoflength],page121 ).Iftheunitsareomittedtheydefaulttobp.Inthiscase,thelowerleftcorneroftheimageisassumedtobeat(0,0).Iftwooptionalargumentsarepresentthentheleadingoneis[llx,lly],specifyingthecoordinatesoftheimage'slowerleft.Thus,\includegraphics[1in,0.618in]{...}callsforthegraphictobeplacedsoitis1inchwideand0.618inchestallandsoitsoriginisat(0,0).Thegraphicxpackagegivesyoumanymoreoptions.Specifytheminakey-valueform,ashere.\begin{center}\includegraphics[width=1in,angle=90]{lion}\hspace{2em} Chapter22:Graphics185 \includegraphics[angle=90,width=1in]{lion}\end{center}Theoptionsarereadleft-to-right.Sothe rstgraphicaboveismadeoneinchwideandthenrotated,whilethesecondisrotatedandthenmadeoneinchwide.Thus,unlessthegraphicisperfectlysquare,thetwowillendwithdi erentwidthsandheights.Therearemanyoptions.Theprimaryonesarelisted rst.NotethatagraphicisplacedbyLATEXintoabox,whichistraditionallyreferredtoasitsboundingbox(distinctfromthePostScriptBoundingBoxdescribedbelow).Thegraphic'sprintedareamaygobeyondthisbox,orsitinsidethisbox,butwhenLATEXmakesupapageitputstogetherboxesandthisistheboxallocatedforthegraphic.widthThegraphicwillbeshownsoitsboundingboxisthiswidth.Anexampleis\includegraphics[width=1in]{plot}.YoucanusethestandardTEXdi-mensions(see Section14.1[Unitsoflength],page121 )andalsoconvenientis\linewidth,orinatwo-columndocument,\columnwidth(see Section5.5[Pagelayoutparameters],page24 ).Anexampleisthatbyusingthecalcpackageyoucanmakethegraphicbe1cmnarrowthanthewidthofthetextwith\includegraphics[width=\linewidth-1.0cm]{hefferon.jpg}.heightThegraphicwillbeshownsoitsboundingboxisthisheight.YoucanusethestandardTEXdimensions(see Section14.1[Unitsoflength],page121 ),andalsoconvenientare\pageheightand\textheight(see Section5.5[Pagelayoutparameters],page24 ).Forinstance,thecommand\includegraphics[height=0.25\textheight]{godel}willmakethegraphicaquarteroftheheightofthetextarea.totalheightThegraphicwillbeshownsoitsboundingboxhasthisheightplusdepth.Thisdi ersfromtheheightifthegraphicwasrotated.Forinstance,ifithasbeenrotatedby-90thenitwillhavezeroheightbutalargedepth.keepaspectratioIfsettotrue,orjustspeci edashere\includegraphics[...,keepaspectratio,...]{...}andyougiveasoptionsbothwidthandheight(ortotalheight),thenLATEXwillmakethegraphicisaslargeaspossiblewithoutdistortion.Thatis,LATEXwillensurethatneitheristhegraphicwiderthanwidthnortallerthanheight(ortotalheight).scaleFactorbywhichtoscalethegraphic.Tomakeagraphictwiceitsnominalsize,enter\includegraphics[scale=2.0]{...}.Thisnumbermaybeanyvalue;anumberbetween1and0willshrinkthegraphicandanegativenumberwillre ectit.angleRotatethegraphic.Theangleistakenindegreesandcounterclockwise.Thegraphicisrotatedaboutitsorigin;seethatoption.Foracompletedescriptionofhowrotatedmaterialistypeset,see Section22.3.2[\rotatebox],page188 .originThepointofthegraphicaboutwhichtherotationhappens.Possiblevaluesareanystringcontainingoneortwoof:lforleft,rforright,b Chapter22:Graphics186 forbottom,cforcenter,tfortop,andBforbaseline.Thus,enteringthecommand\includegraphics[angle=180,origin=c]{moon}willturnthepictureupsidedownaboutthatpicture'scenter,whilethecommand\includegraphics[angle=180,origin=lB]{LeBateau}willturnitspictureupsidedownaboutitsleftbaseline.(Thecharactercgivesthehorizontalcenterinbcortc,butgivestheverticalcenterinlcorrc.)ThedefaultislB.Torotateaboutanarbitrarypoint,see Section22.3.2[\rotatebox],page188 .Thesearelesser-usedoptions.viewportPickoutasubregionofthegraphictoshow.Takesfourarguments,separatedbyspacesandgiveninTEXdimensions,aswith\includegraphics[..,viewport=0in0in1in0.618in]{...}.Thedimensionsdefaulttobigpoints,bp.Theyaretakenrelativetotheoriginspeci edbytheboundingbox.Seealsothetrimoption.trimGivespartsofthegraphictonotshow.Takesfourarguments,separatedbyspa-ces,thataregiveninTEXdimensions,aswith\includegraphics[..,trim=0in0.1in0.2in0.3in,...]{...}.Thesegivetheamountsofthegraphicnottoshow,thatis,LATEXwillcropthepictureby0inchesontheleft,0.1inchesonthebottom,0.2inchesontheright,and0.3inchesonthetop.Seealsotheviewportoption.clipIfsettotrue,orjustspeci edashere\includegraphics[...,clip,...]{...}thenthegraphiciscroppedtotheboundingbox.Thisisthesameasusingthestarredformofthecommand,\includegraphics*[...]{...}.pageGivethepagenumberofamulti-pagePDF le.Thedefaultispage=1.pageboxSpeci eswhichboundingboxtouseforPDF lesfromamongmediabox,cropbox,bleedbox,trimbox,orartbox.PDF lesdonothavetheBounding-BoxthatPostScript leshave,butmayspecifyuptofourprede nedrectangles.TheMediaBoxgivestheboundariesofthephysicalmedium.TheCropBoxistheregiontowhichthecontentsofthepagearetobeclippedwhendisplayed.TheBleedBoxistheregiontowhichthecontentsofthepageshouldbeclippedinproduction.TheTrimBoxistheintendeddimensionsofthe nishedpage.TheArtBoxistheextentofthepage'smeaningfulcontent.ThedriverwillsettheimagesizebasedonCropBoxifpresent,otherwiseitwillnotuseoneoftheothers,withadriver-de nedorderofpreference.MediaBoxisalwayspresent.interpolateEnableordisableinterpolationofrasterimagesbytheviewer.Canbesetwithinterpolate=trueorjustspeci edashere.\includegraphics[...,interpolate,...]{...}quietDonotwriteinformationtothelog.Youcansetitwithquiet=trueorjustspeci editwith\includegraphics[...,quite,...]{...},draftIfyousetitwithdraft=trueorjustspecifyitwith\includegraphics[...,draft,...]{...} Chapter22:Graphics187 thenthegraphicwillnotappearinthedocument,possiblysavingcolorprinterink.Instead,LATEXwillputanemptyboxofthecorrectsizewiththe lenameprintedinit.TheseoptionsaddresstheboundingboxforEncapsulatedPostScriptgraphic les,whichhaveasizespeci edwithaline%%BoundingBoxthatappearsinthe le.Ithasfourval-ues,givingthelowerxcoordinate,lowerycoordinate,upperxcoordinate,andupperycoordinate.TheunitsarePostScriptpoints,equivalenttoTEX'sbigpoints,1/72inch.Forexample,ifan.eps lehastheline%%BoundingBox10204080thenitsnaturalsizeis30/72inchwideby60/72inchtall.bbSpecifytheboundingboxofthedisplayedregion.Theargumentisfourdimen-sionsseparatedbyspaces,aswith\includegraphics[..,bb=0in0in1in0.618in]{...}.Usually\includegraphicsreadstheBoundingBoxnumbersfromtheEPS leautomatically,sothisoptionisonlyusefuliftheboundingboxismissingfromthat leorifyouwanttochangeit.bbllx,bblly,bburx,bburySettheboundingbox.Thesefourareobsolete,butareretainedforcompati-bilitywitholdpackages.natwidth,natheightAnalternativeforbb.Setting\includegraphics[...,natwidth=1in,natheight=0.618in,...]{...}isthesameassettingbb=001in0.618in.hiresbbIfsettotrue,orjustspeci edaswith\includegraphics[...,hiresbb,...]{...}thenLATEXwilllookfor%%HiResBoundingBoxlinesinsteadof%%BoundingBoxlines.(TheBoundingBoxlinesuseonlynaturalnumberswhiletheHiResBoundingBoxlinesusedecimals;bothuseunitsequivalenttoTEX'sbigpoints,1/72inch.)Tooverrideapriorsettingoftrue,youcansetittofalse.ThesefollowingoptionsallowausertooverrideLATEX'smethodofchoos-ingthegraphictypebasedonthe lenameextension.Anexampleisthat\includegraphics[type=png,ext=.xxx,read=.xxx]{lion}willreadthe lelion.xxxasthoughitwerelion.png.Formoreonthese,see Section22.2.3[\DeclareGraphicsRule],page182 .typeSpecifythegraphicstype.extSpecifythegraphicsextension.Onlyusethisinconjunctionwiththeoptiontype.readSpecifythe leextensionoftheread le.Onlyusethisinconjunctionwiththeoptiontype.commandSpecifyacommandtobeappliedtothis le.Onlyusethisinconjunctionwiththeoptiontype.See Section28.1[Commandlineoptions],page220, foradiscussionofenablingthe\write18functionalitytorunexternalcommands. Chapter22:Graphics188 22.3.2\rotateboxSynopsisifyouusethegraphicspackage:\rotatebox{angle}{material}Synopsesifyouusethegraphicxpackage:\rotatebox{angle}{material}\rotatebox[key-valuelist]{angle}{material}Putmaterialinaboxandrotateitangledegreescounterclockwise.Thisexamplerotatesthetablecolumnheadsforty vedegrees.\begin{tabular}{ll}\rotatebox{45}{Character}&\rotatebox{45}{NATOphonetic}\\A&AL-FAH\\B&BRAH-VOH\end{tabular}Thematerialcanbeanythingthatgoesinabox,includingagraphic.\rotatebox[origin=c]{45}{\includegraphics[width=1in]{lion}}Toplacetherotatedmaterial,the rststepisthatLATEXsetsmaterialinabox,withareferencepointontheleftbaseline.Thesecondstepistherotation,bydefaultaboutthereferencepoint.ThethirdstepisthatLATEXcomputesaboxtoboundtherotatedmaterial.Fourth,LATEXmovesthisboxhorizontallysothattheleftedgeofthisnewboundingboxcoincideswiththeleftedgeoftheboxfromthe rststep(theyneednotcoincidevertically).Thisnewboundingbox,initsnewposition,iswhatLATEXusesastheboxwhentypesettingthismaterial.Ifyouusethegraphicspackagethentherotationisaboutthereferencepointofthebox.Ifyouusethegraphicxpackagethenthesearetheoptionsthatcangointhekey-valuelist,butnotethatyoucangetthesamee ectwithoutneedingthispackage,exceptforthexandyoptions(see Section22.3.1[\includegraphics],page183 ).originThepointofthematerial'sboxaboutwhichtherotationhappens.Possiblevalueisanystringcontainingoneortwoof:lforleft,rforright,bforbottom,cforcenter,tfortop,andBforbaseline.Thus,the rstlinehere\rotatebox[origin=c]{180}{moon}\rotatebox[origin=lB]{180}{LeBateau}willturnthepictureupsidedownfromthecenterwhilethesecondwillturnitspictureupsidedownaboutitsleftbaseline.(Thecharactercgivesthehorizontalcenterinbcortcbutgivestheverticalcenterinlcorrc,andgivesbothinc.)ThedefaultislB.x,ySpecifyanarbitrarypointofrotationwith\rotatebox[x=TEXdimension,y=TEXdimension]{...}(see Section14.1[Unitsoflength],page121 ).Thesegivetheo setfromthebox'sreferencepoint.unitsThiskeyallowsyoutochangethedefaultofdegreescounterclockwise.Settingunits=-360changesthedirectiontodegreesclockwiseandsettingunits=6.283185changestoradianscounterclockwise. Chapter22:Graphics189 22.3.3\scaleboxSynopses:\scalebox{horizontalfactor}{material}\scalebox{horizontalfactor}[verticalfactor]{material}\reflectbox{material}Scalethematerial.Thisexamplehalvesthesize,bothhorizontallyandvertically,ofthe rsttextanddoublesthesizeofthesecond.\scalebox{0.5}{DRINKME}and\scalebox{2.0}{EatMe}Ifyoudonotspecifytheoptionalverticalfactorthenitdefaultstothesamevalueasthehorizontalfactor.Youcanusethiscommandtoresizeagraphic,ashere.\scalebox{0.5}{\includegraphics{lion}}Ifyouusethegraphicxpackagethenyoucanaccomplishthesamethingwithoptionalargumentsto\includegraphics(see Section22.3.1[\includegraphics],page183 ).The\reflectboxcommandabbreviates\scalebox{-1}[1]{material}.Thus,AblewasI\reflectbox{AblewasI}willshowthephrase`AblewasI'immediatelyfollowedbyitsmirrorre ection.22.3.4\resizeboxSynopses:\resizebox{horizontallength}{verticallength}{material}\resizebox*{horizontallength}{verticallength}{material}Givenasize,suchas3cm,transformmaterialtomakeitthatsize.Ifeitherhorizontallengthorverticallengthisanexclamationpoint!thentheotherargumentisusedtodetermineascalefactorforbothdirections.Thisexamplemakesthegraphicbeahalfinchwideandscalesitverticallybythesamefactortokeepitfrombeingdistorted.\resizebox{0.5in}{!}{\includegraphics{lion}}Theunstarredform\resizeboxtakesverticallengthtobethebox'sheightwhilethestarredform\resizebox*takesittobeheight+depth.Forinstance,makethetexthaveaheight+depthofaquarterinchwith\resizebox*{!}{0.25in}{\parbox{1in}{Thisboxhasbothheightanddepth.}}.Youcanuse\depth,\height,\totalheight,and\widthtorefertotheoriginalsizeofthebox.Thus,makethetexttwoincheswidebutkeeptheoriginalheightwith\resizebox{2in}{\height}{Twoinches}. 190 23SpecialinsertionsLATEXprovidescommandsforinsertingcharactersthathaveaspecialmeaningdonotcorrespondtosimplecharactersyoucantype.23.1ReservedcharactersLATEXsetsasidethefollowingcharactersforspecialpurposes.Forexample,thepercentsign%isforcomments.Theyarecalledreservedcharactersorspecialcharacters.#$%&{}_~^\Ifyouwantareservedcharactertobeprintedasitself,inthetextbodyfont,forallbutthe nalthreecharactersinthatlistsimplyputabackslash\infrontofthecharacter.Thus,typing\$1.23willproduce$1.23inyouroutput.Astothelastthreecharacters,togetatildeinthetextbodyfontuse\~{}(omittingthecurlybraceswouldresultinthenextcharacterreceivingatildeaccent).Similarly,togetagetatextbodyfontcircum exuse\^{}.Togetabackslashinthefontofthetextbody,enter\textbackslash{}.Toproducethereservedcharactersinatypewriterfontuse\verb!!asbelow(thedoublebackslash\\isonlytheretosplitthelines).\begin{center}\#\$\%\&\{\}\_\~{}\^{}\textbackslash\\\verb!#$%&{}_~^\!\end{center}23.2UpperandlowercaseSynopsis:\uppercase{text}\lowercase{text}\MakeUppercase{text}\MakeLowercase{text}Changethecaseofcharacters.TheTEXprimitivescommands\uppercaseand\lowercaseonlyworkforAmericancharacters.TheLATEXcommands\MakeUppercaseand\MakeLowercasecommandsalsochangecharactersaccessedbycommandssuchas\aeor\aa.Thecommands\MakeUppercaseand\MakeLowercasearerobustbuttheyhavemovingarguments(see Section12.11[\protect],page113 ).Thesecommandsdonotchangethecaseoflettersusedinthenameofacommandwithintext.ButtheydochangethecaseofeveryotherLatinletterinsidetheargumenttext.Thus,\MakeUppercase{Let$y=f(x)$gproduces`LETY=F(X)'.Anotherexampleisthatthenameofanenvironmentwillbechanged,sothat\MakeUppercase{\begin{tabular}...\end{tabular}}willproduceanerrorbecausethe rsthalfischangedto\begin{TABULAR}.LATEXusesthesame xedtableforchangingcasethroughoutadocument,ThetableusedisdesignedforthefontencodingT1;thisworkswellwiththestandardTEXfontsforallLatinalphabetsbutwillcauseproblemswhenusingotheralphabets. Chapter23:Specialinsertions191 Tochangethecaseoftextthatresultsfromamacroinsidetextyouneedtodoexpansion.Herethe\Schoolnameproduces`COLLEGEOFMATHEMATICS'.\newcommand{\schoolname}{CollegeofMathematics}\newcommand{\Schoolname}{\expandafter\MakeUppercase\expandafter{\schoolname}}ThetextcasepackagebringssomeofthemissingfeatureofthestandardLATEXcom-mands\MakeUppercaseand\MakeLowerCase.Touppercaseonlythe rstletterofwords,youcanusethepackagemfirstuc.23.3SymbolsbyfontpositionYoucanaccessanycharacterofthecurrentfontusingitsnumberwiththe\symbolcom-mand.Forexample,thevisiblespacecharacterusedinthe\verb*commandhasthecodedecimal32,soitcanbetypedas\symbol{32}.Youcanalsospecifynumbersinoctal(base8)byusinga'pre x,orhexadecimal(base16)witha"pre x,sothepreviousexamplecouldalsobewrittenas\symbol{'40}or\symbol{"20}.23.4TextsymbolsLATEXprovidescommandstogenerateanumberofnon-lettersymbolsinrunningtext.Someofthese,especiallythemoreobscureones,arenotavailableinOT1.UnlessyouareusingXeLATEXorLuaLATEXthenyoumayneedtoloadthetextcomppackage.\copyright\textcopyrightc Thecopyrightsymbol.\dagyThedaggersymbol(intext).\ddagzThedoubledaggersymbol(intext).\LaTeXTheLATEXlogo.\LaTeXeTheLATEX2elogo.\guillemotleft()\guillemotright()\guilsinglleft()\guilsinglright(),,,Doubleandsingleanglequotationmarks,commonlyusedinFrench.\ldots\dots\textellipsis...Anellipsis(threedotsatthebaseline):\ldotsand\dotsalsoworkinmathmode.\lq`Left(opening)quote.\P\textparagraph{Paragraphsign(pilcrow). Chapter23:Specialinsertions192 \pounds\textsterling$Englishpoundssterling.\quotedblbase()\quotesinglbase( )and Doubleandsinglequotationmarksonthebaseline.\rq'Right(closing)quote.\S\textsectionxSectionsign.\TeXTheTEXlogo.\textasciicircum^ASCIIcircum ex.\textasciitilde~ASCIItilde.\textasteriskcentered*Centeredasterisk.\textbackslash\Backslash.\textbar|Verticalbar.\textbardbljjDoubleverticalbar.\textbigcircleBigcirclesymbol.\textbraceleftfLeftbrace.\textbracerightgRightbrace.\textbulletBullet.\textcircled{letter}Circlearoundletter.\textcompwordmark\textcapitalcompwordmark\textascendercompwordmarkUsedtoseparatelettersthatwouldnormallyligature.Forexample,f\textcompwordmarkiproduces`fi'withoutaligature.Thisismostusefulinnon-Englishlanguages.The\textcapitalcompwordmarkformhasthecapheightofthefontwhilethe\textascendercompwordmarkformhastheascenderheight. Chapter23:Specialinsertions193 \textdaggeryDagger.\textdaggerdblzDoubledagger.\textdollar(or\$)$Dollarsign.\textemdash(or---)|Em-dash(usedforpunctuation,asinTheplayoffs---ifyouarefortunateenoughtomaketheplayoffs---ismorelikeasprint.).\textendash(or--){En-dash(usedforranges,asinSeepages12--14).\texteuroTheEurosymbol:e.Foranalternativeglyphdesign,trytheeurosympack-age;also,mostfontsnowadayscomewiththeirownEurosymbol(UnicodeU+20AC).\textexclamdown(or!`)Upsidedownexclamationpoint.\textgreater&#x-333;Greaterthansymbol.\textlessLessthansymbol.\textleftarrowLeftarrow.\textordfeminine\textordmasculinea ,o Feminineandmasculineordinalsymbols.\textperiodcenteredCenteredperiod.\textquestiondown(or?`)�Upsidedownquestionmark.\textquotedblleft(or``)\Doubleleftquote.\textquotedblright(or'')"Doublerightquote.\textquoteleft(or`)`Singleleftquote.\textquoteright(or')'Singlerightquote.\textquotesingleStraightsinglequote.(FromTS1encoding.) Chapter23:Specialinsertions194 \textquotestraightbase\textquotestraightdblbaseSingleanddoublestraightquotesonthebaseline.\textregisteredR Registeredsymbol.\textrightarrowRightarrow.\textthreequartersemdash\Three-quarters"em-dash,betweenen-dashandem-dash.\texttrademarkTMTrademarksymbol.\texttwelveudash\Two-thirds"em-dash,betweenen-dashandem-dash.\textunderscore Underscore.\textvisiblespaceVisiblespacesymbol.23.5AccentsLATEXhaswidesupportformanyoftheworld'sscriptsandlanguages,throughthebabelpackageandrelatedsupportifyouareusingpdfLATEX,orpolyglossiaifyouareusingXeLATEXorLuaLATEX.Thissectiondoesnotcoverthatsupport.ItonlyliststhecoreLATEXcommandsforcreatingaccentedcharacters.The\capital...commandsshownhereproducealternativeformsforusewithcapitalletters.ThesearenotavailablewithOT1.Below,tomakethemeasierto nd,theaccentsareallillustratedwithlowercase`o'.Notethat\iproducesadotlessi,and\jproducesadotlessj.Theseareoftenusedinplaceoftheirdottedcounterpartswhentheyareaccented.\"\capitaldieresisoUmlaut(dieresis).\'\capitalacuteoAcuteaccent.\._oDotaccent.\=\capitalmacronoMacron(overbar)accent.\^\capitalcircumflex^oCircum ex(hat)accent. Chapter23:Specialinsertions195 \`\capitalgraveoGraveaccent.\~\capitaltilde~nTildeaccent.\boBaraccentunderneath.Relatedtothis,\underbar{text}producesabarundertext.TheargumentisalwaysprocessedinLRmode(see Chapter17[Modes],page151 ).Thebarisalwaysa xedpositionunderthebaseline,thuscrossingthroughdescenders.Seealso\underlinein Section16.7[Mathmiscellany],page149 .\c\capitalcedillacCedillaaccentunderneath.\d\capitaldotaccento.Dotaccentunderneath.\H\capitalhungarumlaut}oLongHungarianumlautaccent.\k\capitalogonek oOgonek.NotavailableintheOT1encoding.\r\capitalringoRingaccent.\t\capitaltie\newtie\capitalnewtieooTie-afteraccent.The\newtieformiscenteredinitsbox.\u\capitalbreveoBreveaccent.\v\capitalcaronoHacek(check,caron)accent.23.6AdditionalLatinlettersHerearethebasicLATEXcommandsforinsertinglettersbeyondA{ZthatextendtheLatinalphabet,usedprimarilyinlanguagesotherthanEnglish.\aa\AAaandA. Chapter23:Specialinsertions196 \ae\AEand.\dh\DHIcelandiclettereth:ðandÐ.NotavailablewithOT1encoding,youneedthefontencpackagetoselectanalternatefontencoding,suchasT1.\dj\DJCrosseddandD,a.k.a.capitalandsmallletterdwithstroke.NotavailablewithOT1encoding,youneedthefontencpackagetoselectanalternatefontencoding,suchasT1.\ij\IJijandIJ(exceptsomewhatclosertogetherthanappearshere).\l\L land L.\ng\NGLappishlettereng,alsousedinphonetics.\o\Oand.\oe\OEand.\ss\SSandSS.\th\THIcelandicletterthorn:þandÞ.NotavailablewithOT1encoding,youneedthefontencpackagetoselectanalternatefontencoding,suchasT1.23.7\ruleSynopsis,oneof:\rule{width}{thickness}\rule[raise]{width}{thickness}Producearule,a lled-inrectangle.Thisproducesarectangularblob,sometimescalledaHalmossymbol,oftenusedtomarktheendofaproof.\newcommand{\qedsymbol}{\rule{0.4em}{2ex}}Theamsthmpackageincludesthiscommand,withasomewhatdi erent-lookingsymbol.Themandatoryargumentsgivethehorizontalwidthandverticalthicknessoftherect-angle.Theyarerigidlengths(see Chapter14[Lengths],page120 ).Theoptionalargumentraiseisalsoarigidlength,andtellsLATEXhowmuchtoraisetheruleabovethebaseline,orloweritifthelengthisnegative.Thisproducesaline,arectanglethatiswidebutnottall.\noindent\rule{\textwidth}{0.4pt} Chapter23:Specialinsertions197 Thelineisthewidthofthepageand0.4pointstall.ThislinethicknessiscommoninLATEX.Arulethathaszerowidth,orzerothickness,willnotshowupintheoutput,butcancauseLATEXtochangetheoutputaroundit.See Section19.13[\strut],page165, forexamples.23.8\todaySynopsis:\todayProducetoday'sdateintheformat`monthdd,yyyy'.Anexampleofadateinthatformatis`July4,1976'.Multilingualpackagessuchasbabelorpolyglossia,orclassessuchaslettre,willlocalize\today.Forexample,thefollowingwilloutput`4juillet1976':\year=1976\month=7\day=4\documentclass{minimal}\usepackage[french]{babel}\begin{document}\today\end{document}\todayusesthecounters\day,\month,and\year(see Section13.8[\day&\month&\year],page119 ).AnumberofpackageonCTANworkwithdates.Oneisdatetimepackagewhichcanproduceawidevarietyofdateformats,includingISOstandards.ThedateisnotupdatedastheLATEXprocessruns,soinprinciplethedatecouldbeincorrectbythetimetheprogram nishes. 198 24SplittingtheinputLATEXletsyousplitalargedocumentintoseveralsmallerones.Thiscansimplifyeditingorallowmultipleauthorstoworkonthedocument.Itcanalsospeedprocessing.Regardlessofhowmanyseparate lesyouuse,thereisalwaysoneroot le,onwhichLATEXcompilationstarts.Thisshowssucha lewith veincluded les.\documentclass{book}\includeonly{%commentoutlinesbelowtoomitcompilingpref,chap1,chap2,append,bib}\begin{document}\frontmatter\include{pref}\mainmatter\include{chap1}\include{chap2}\appendix\include{append}\backmatter\include{bib}\end{document}Thiswillbringinmaterialfrompref.tex,chap1.tex,chap2.tex,append.tex,andbib.tex.Ifyoucompilethis le,andthencommentoutallofthelinesinside\includeonly{...}exceptforchap1,andcompileagain,thenLATEXwillonlyprocessthematerialinthe rstchapter.Thus,youroutputwillappearmorequicklyandbeshortertoprint.However,theadvantageofthe\includeonlycommandisthatLATEXwillretainthepagenumbersandallofthecrossreferenceinformationfromtheotherpartsofthedocumentsothesewillappearinyouroutputcorrectly.See SectionA.4[Largerbooktemplate],page225, foranotherexampleof\includeonly.24.1\endinputSynopsis:\endinputWhenyou\include{filename},insidefilename.texthematerialafter\endinputwillnotbeincluded.Thiscommandisoptional;iffilename.texhasno\endinputthenLATEXwillreadallofthe le.Forexample,supposethatadocument'sroot lehas\input{chap1}andthisischap1.tex.\chapter{One}Thismaterialwillappearinthedocument. Chapter24:Splittingtheinput199 \endinputThiswillnotappear.Thiscanbeusefulforputtingdocumentationorcommentsattheendofa le,orforavoidingjunkcharactersthatcanbeaddedduringmailing.Itisalsousefulfordebugging:onestrategytolocalizeerrorsistoput\endinputhalfwaythroughtheincluded leandseeiftheerrordisappears.Now,knowingwhichhalfcontainstheerror,moving\endinputtohalfwaythroughthatareafurthernarrowsdownthelocation.Thisprocessrapidly ndstheo endingline.Afterreading\endinput,LATEXcontinuestoreadtotheendoftheline,sosomethingcanfollowthiscommandandbereadnonetheless.Thisallowsyou,forinstance,toclosean\if...witha\fi.24.2\include&\includeonlySynopsis:\includeonly{%indocumentpreamble...filename,...}...\include{filename}%indocumentbodyBringmaterialfromtheexternal lefilename.texintoaLATEXdocument.The\includecommanddoesthreethings:itexecutes\clearpage(see Section10.1[\clearpage&\cleardoublepage],page95 ),thenitinputsthematerialfromfilename.texintothedocument,andthenitdoesanother\clearpage.Thiscommandcanonlyappearinthedocumentbody.The\includeonlycommandcontrolswhich leswillbereadbyLATEXundersubsequent\includecommands.Itslistof lenamesiscomma-separated,anditcanonlyappearinthepreamble.Thisexamplerootdocument,constitution.tex,bringsinthree les,preamble.tex,articles.tex,andamendments.tex.\documentclass{book}\includeonly{preamble,articles,amendments}\begin{document}\include{preamble}\include{articles}\include{amendments}\end{document}The lepreamble.texcontainsnospecialcode;youhavejustexcerptedthechapterfromconsitution.texandputitinaseparate lejustforeditingconvenience.\chapter{Preamble} Chapter24:Splittingtheinput200 WethePeopleoftheUnitedStates,inOrdertoformamoreperfectUnion,...RunningLATEXonconstitution.texmakesthematerialfromthethree lesappearinthedocumentbutalsogeneratestheauxiliary lespreamble.aux,articles.aux,andamendments.tex.Thesecontaininformationsuchaspagenumbersandcross-references(see Chapter7[Crossreferences],page41 ).Ifyounowcommentout\includeonly'slineswithpreambleandamendmentsandrunLATEXagainthentheresultingdocumentshowsonlythematerialfromarticles.tex,notthematerialfrompreamble.texoramendments.tex.Nonetheless,alloftheauxiliaryinformationfromtheomitted lesisstillthere,includingthestartingpagenumberofthechapter.Ifthedocumentpreambledoesnothave\includeonlythenLATEXwillincludeallthe lesyoucallforwith\includecommands.The\includecommandmakesanewpage.Toavoidthat,see Section24.3[\input],page201, (which,however,doesnotretaintheauxiliaryinformation).See SectionA.4[Largerbooktemplate],page225, foranotherexampleusing\includeand\includeonly.Thatexamplealsouses\inputforsomematerialthatwillnotneces-sarilystartonanewpage.Filenamescaninvolvepaths.\documentclass{book}\includeonly{chapters/chap1,}\begin{document}\include{chapters/chap1}\end{document}Tomakeyourdocumentportableacrossdistributionsandplatformsyoushouldavoidspacesinthe lenames.Thetraditionistoinsteadusedashesorunderscores.Nevertheless,forthename`amoamasamat',thisworksunderTEXLiveonGNU/Linux:\documentclass{book}\includeonly{"amo\spaceamas\spaceamat"}\begin{document}\include{"amo\spaceamas\spaceamat"}\end{document}andthisworksunderMiKTEXonWindows:\documentclass{book}\includeonly{{"amoamasamat"}}\begin{document}\include{{"amoamasamat"}}\end{document} Chapter24:Splittingtheinput201 Youcannotuse\includeinsidea lethatisbeingincludedoryouget`LaTeXError:\includecannotbenested.'The\includecommandcannotappearinthedocumentpreamble;youwillget`LaTeXError:Missing\begin{document}'.Ifa lethatyou\includedoesnotexist,forinstanceifyou\include{athiesm}butyoumeant\include{atheism},thenLATEXdoesnotgiveyouanerrorbutwillwarnyou`Nofileathiesm.tex.'(Itwillalsocreateathiesm.aux.)Ifyou\includetheroot leinitselfthenyou rstget`LaTeXError:Canbeusedonlyinpreamble.'Laterrunsget`TeXcapacityexceeded,sorry[textinputlevels=15]'.To xthis,youmustremovetheinclusion\include{root}butalsodeletethe leroot.auxandrerunLATEX.24.3\inputSynopsis:\input{filename}LATEXprocessesthe leasifitscontentswereinsertedinthecurrent le.Foramoresophisticatedinclusionmechanismsee Section24.2[\include&\includeonly],page199 .If lenamedoesnotendin`.tex'thenLATEX rsttriesthe lenamewiththatextension;thisistheusualcase.If lenameendswith`.tex'thenLATEXlooksforthe lenameasitis.Forexample,this\input{macros}willcauseLATEXto rstlookformacros.tex.Ifit ndsthat lethenitprocessesitscontentsasthoughttheyhadbeencopy-pastedin.Ifthereisno leofthenamemacros.texthenLATEXtriesthenamemacros,withoutanextension.(Thismayvarybydistribution.)Tomakeyourdocumentportableacrossdistributionsandplatformsyoushouldavoidspacesinthe lenames.Thetraditionistoinsteadusedashesorunderscores.Nevertheless,forthename`amoamasamat',thisworksunderTEXLiveonGNU/Linux:\input{"amo\spaceamas\spaceamat"}andthisworksunderMiKTEXonWindows:\input{{"amoamasamat"}} 202 25Front/backmatter25.1Tableofcontentsetc.Synopsis,oneof:\tableofcontents\listoffigures\listoftablesProduceatableofcontents,orlistof gures,orlistoftables.Putthecommandintheinput lewhereyouwantthetableorlisttogo.Youdonottypetheentries;forexample,typicallythetableofcontentsentriesareautomaticallygeneratedfromthesectioningcommands\chapter,etc.Thisexampleillustratesthe rstcommand,\tableofcontents.LATEXwillproduceatableofcontentsonthebook's rstpage.\documentclass{book}%\setcounter{tocdepth}{1}\begin{document}\tableofcontents\newpage...\chapter{...}...\section{...}...\subsection{...}...\end{document}Uncommentingthesecondlinewouldcausethattabletocontainchapterandsectionlistingsbutnotsubsectionlistings,becausethe\sectioncommandhaslevel1.See Chapter6[Sectioning],page30, forlevelnumbersofthesectioningunits.Formoreonthetocdepthsee [Sectioning/tocdepth],page31 .Anotherexampleoftheuseof\tableofcontentsisin SectionA.4[Largerbooktem-plate],page225 .Ifyouwantapagebreakafterthetableofcontents,writea\newpagecommandafterthe\tableofcontentscommand,asabove.TomakethetableofcontentsLATEXstorestheinformationinanauxiliary lenamedroot-file.toc(see Chapter24[Splittingtheinput],page198 ).Forexample,thisLATEX letest.tex\documentclass{article}\begin{document}\tableofcontents\newpage\section{Firstsection}\subsection{Firstsubsection}... Chapter25:Front/backmatter203 writesthefollowinglinetotest.toc.\contentsline{section}{\numberline{1}Firstsection}{2}\contentsline{subsection}{\numberline{1.1}Firstsubsection}{2}Thesectionorsubsectionisthesectioningunit.Thehook\numberlineletsyoutochangehowtheinformationappearsinthetableofcontents.Ofitstwoarguments,1or1.1isthesectioningunitnumberandFirstsectionorFirstsubsectionisthetitle.Finally,2isthepagenumberonwhichthesectioningunitsstart.Oneconsequenceofthisauxiliary lestoragestrategyisthattogetthecontentspagecorrectyoumustrunLATEXtwice,oncetostoretheinformationandoncetogetit.Inparticular,the rsttimethatyourunLATEXonanewdocument,thetableofcontentspagewillbeemptyexceptforits`Contents'header.Justrunitagain.Thecommands\listoffiguresand\listoftablesproducealistof guresandalistoftables.Theyworkthesamewayasthecontentscommands;forinstance,theseworkwithinformationstoredin.lofand.lot les.Tochangetheheaderforthetableofcontentspagedosomethinglikethe rstlinehere.\renewcommand{\contentsname}{Tableofcontents}\renewcommand{\listfigurename}{Plots}\renewcommand{\listtablename}{Tables}Similarly,theothertwolineswilldotheothertwo.Internationalizationpackagessuchasbabelorpolyglossiawillchangetheheadersdependingonthechosenbaselanguage.CTANhasmanypackagesforthetableofcontentsandlistsof guresandtables.Oneconvenientoneforadjustingsomeaspectsofthedefault,suchasspacing,istocloft.And,tocbibbindwillautomaticallyaddthebibliography,index,etc.tothetableofcontents.25.1.1\addcontentslineSynopsis:\addcontentsline{ext}{unit}{text}Addanentrytothe lespeci edbyext.Usuallyextisoneoftocforthetableofcontents,lofforthelistof gures,orlotforthelistoftables.Thefollowingwillresultinan`Appendices'lineinthetableofcontents.\addcontentsline{toc}{section}{\protect\textbf{Appendices}}Itwillappearatthesameindentationlevelasthesections,willbeinboldface,andwillbeassignedthepagenumberassociatedwiththepointwhereitappearsintheinput le.The\addcontentslinecommandwritesinformationtothe leroot-name.ext.Itwritesthatinformationasthetextofthecommand\contentsline{unit}{text}{num},wherenumisthecurrentvalueofcounterunit.Themostcommoncaseisthetableofcontentsandtherenumisthepagenumberofthe rstpageofunit.Thiscommandisinvokedbythesectioningcommands\chapter,etc.,andalsoby\captioninsidea oatenvironment.Butitisalsousedbyauthors.Forexample,inabooktohavetheprefaceunnumbered,youmayusethestarred\chapter*.Butthatdoesnotputintableofcontentsinformation,soyoucanenteritmanually,ashere.\chapter*{Preface}\addcontentsline{toc}{chapter}{\protect\numberline{}Preface} Chapter25:Front/backmatter204 Inthe.toc leLATEXwillputtheline\contentsline{chapter}{\numberline{}Preface}{3};notethepagenumber`3'.Alloftheargumentsfor\addcontentslinearerequired.extTypicallyoneofthestringstocforthetableofcontents,lofforthelistof gures,orlotforthelistoftables.The lenameextensionoftheinformation le.unitAstringthatdependsonthevalueoftheextargument:tocForthetableofcontents,thisisthenameofasectionalunit:part,chapter,section,subsection,etc.lofForthelistof gures:figure.lotForthelistoftables:table.textThetextoftheentry.Youmust\protectanycommandsthatarefragile(see Section12.11[\protect],page113 ).The\addcontentslinecommandhasaninteractionwith\include(see Section24.2[\include&\includeonly],page199 ).Ifyouusethematthesamelevel,aswith\addcontentsline{...}{...}{...}\include{...}thenlinesinthetableofcontentscancomeoutinthewrongorder.Thesolutionistomove\addcontentslineintothe lebeingincluded.IfyouuseaunitthatLATEXdoesnotrecognize,ashere\addcontentsline{toc}{setcion}{\protect\textbf{Appendices}}thenyoudon'tgetanerrorbuttheformattinginthetableofcontentswillnotmakesense.25.1.2\addtocontentsSynopsis:\addtocontents{ext}{text}Addtext,whichmaybetextorformattingcommands,directlytotheauxiliary lewithextensionext.Thisismostcommonlyusedforthetableofcontentssothatisthediscussionhere,butthisalsoappliestothelistof guresandlistoftables.Thiswillputsomeverticalspaceinthetableofcontentsafterthe`Contents'header.\tableofcontents\newpage\addtocontents{toc}{\protect\vspace*{3ex}}The\addtocontentscommandhastwoarguments.Botharerequired.extTypicallyoneof:tocforthetableofcontents,lofforthelistof gures,orlotforthelistoftables.Theextensionofthe leholdingtheinformation.textThetext,andpossiblycommands,tobewritten.Thesectioningcommandssuchas\chapterusethe\addcontentslinecommandtostoreinformation.Thiscommandcreateslinesinthe.tocauxiliary lecontainingthe\contentslinecommand(see Section25.1.1[\addcontentsline],page203 ).Incontrast,thecommand\addtocontentsputsmaterialdirectlyinthat le. Chapter25:Front/backmatter205 The\addtocontentscommandhasaninteractionwith\include(see Section24.2[\include&\includeonly],page199 ).Ifyouusethematthesamelevel,aswith\addtocontents{...}{...}\include{...}thenlinesinthetableofcontentscancomeoutinthewrongorder.Thesolutionistomove\addtocontentsintothe lebeingincluded.25.1.3\nofilesSynopsis:\nofilesPreventLATEXfromwritinganyauxiliary les.Theonlyoutputwillbethe.logand.pdf(or.dvi) les.Thiscommandmustgointhepreamble.Becauseofthe\nofilescommandthisexamplewillnotproducea.toc le.\documentclass{book}\nofiles\begin{document}\tableofcontents\newpage\chapter{...}...LATEXwillnoteraseanyexistingauxiliary les,soifyouinsertthe\nofilescommandafteryouhaverunthe leandgottena.tocthenthetableofcontentspagewillcontinuetoshowtheoldinformation.25.2IndexesThisdocumenthasanindex.\documentclass{article}\usepackage{makeidx}\makeindex...\begin{document}...RecallWilson'sTheorem:\index{Wilson'sTheorem}anumber\(�n1\)isprimeifandonlyifthefactorialof\(n-1\)iscongruentto\(-1\)modulo~\(n\)....\printindex...The\usepackage{makeidx}and\makeindexinthepreamblebringintherelevantcom-mands.Producinganindexisathreestageprocess.First,inthedocumentbodyyoudeclareindexentrieswiththe\indexcommand(see Section25.2.1[\index],page206 ).WhenyourunLATEX,the\indexwritesitsinformationtoanauxiliary leroot-name.idx.Next,toalphabetizeandtodoothermanipulationsyourunanexternalcommand,typicallymakeindexorxindy(see Section25.2.2[makeindex],page207 ).Theseoutputa leroot-name.ind.Finally,youbringtheinformationbackintoyourdocumentandtypesetitwiththe\printindexcommand(see Section25.2.3[\printindex],page210 ). Chapter25:Front/backmatter206 Therearemanypackagesthatapplytoindexingcommands.Theshowidxpackagecauseseachindexentriestobeshowninthemarginonthepagewheretheentryappears.Thiscanhelpinpreparingtheindex.Themultindpackagesupportsmultipleindexes.SeealsotheTEXFAQentryonthistopic, http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multind .25.2.1\indexSynopsis:\index{index-entry-string}Declareanentryintheindex.Thiscommandisfragile(see Section12.11[\protect],page113 ).Forexample,asdescribedin Section25.2[Indexes],page205 ,onewaytogetanindexfromwhat'sbelowistocompilethedocumentwithpdflatextest,thenprocesstheindexentrieswithmakeindextest,andthencompileagainwithpdflatextest.W~Ackermann(1896--1962).\index{Ackermann}...Ackermannfunction\index{Ackermann!function}...rateofgrowth\index{Ackermann!function!growthrate}Allthreeindexentrieswillgetapagenumber,suchas`Ackermann,22'.LATEXwillformatthesecondasasubitemofthe rst,onthelinebelowitandindented,andthethirdasasubitemofthesecond.Threelevelsdeepisasfarasyoucannestsubentries.(Ifyouadd\index{Ackermann!function!growthrate!comparison}thenmakeindexsays`Scanninginputfiletest.idx....done(4entriesaccepted,1rejected)'andnothingappearsintheindex).Ifyouenterasecond\indexwiththesameindex-entry-stringthenyouwillgetasingleindexentrywithtwopagenumbers(unlesstheyhappentofallonthesamepage).Thus,addingasforAckermann.\index{Ackermann}laterinthesamedocumentasabovewillgiveanindexentrylike`Ackermann,22,151'.Also,youcanentertheindexentriesinanyorder,soforinstance\index{Ackermann!function}couldcomebefore\index{Ackermann}.Getapagerangeintheoutput,like`Hilbert,23--27',ashere.W~Ackermann(1896--1962).\index{Ackermann}...D~Hilbert(1862--1943)\index{Ackermann!Hilbert\(}...disapprovedofhismarriage.\index{Ackermann!Hilbert\)}Ifthebeginningandendingofthepagerangeareequalthenthesystemjustgivesasinglepageentry,notarange.Ifyouindexsubentriesbutnotamainentry,aswith\index{Jones!program}and\index{Jones!results},thentheoutputistheitem`Jones'withnocommaorpagenumber,followedbytwosubitems,like`program,50'and`results,51'.Generateaindexentrythatsays`See'byusingaverticalbarcharacter:\index{Ackermann!function|see{P\'eter'sfunction}}.Youcaninsteadget`See Chapter25:Front/backmatter207 also'withseealso.(Thetext`See'isde nedby\seename,and`Seealso'by\alsoname.Youcanrede netheseeitherbyusinganinternationalizationpackagesuchasbabelorpolyglossia,ordirectlyaswith\renewcommand{\alsoname}[1]{Alsosee#1}.)The`See'featureispartofamoregeneralfunctionality.Aftertheverticalbaryoucanputthenameofaone-inputcommand,asin\index{group|textit}(notethemiss-ingbackslashonthe\textitcommand)andthesystemwillapplythatcommandtothepagenumber,heregivingsomethinglike\textit{7}.Youcande neyourownone-inputcommands,suchas\newcommand{\definedpage}[1]{{\color{blue}#1}}andthen\index{Ackermann!function|definedpage}willgiveabluepagenumber(see Chapter21[Color],page175 ).Another,lesspractical,exampleisthis,\newcommand\indexownpage[1]{#1,\thepage}...Epimenides.\index{self-reference|indexownpage}whichcreatesanentrycitingthepagenumberofitsownindexlisting.Thetwofunctionsjustdescribedcombine,ashere\index{Ackermann!function|(definedpage}...\index{Ackermann!function|)}whichoutputsanindexentrylike`function,23--27'wherethepagenumberrangeisinblue.Consideranindexentrysuchas` -ring'.Enteringitas$\alpha$-ringwillcauseittobealphabetizedaccordingtothedollarsign.Youcaninsteadenteritusinganat-sign,as\index{alpha-ring@$\alpha$-ring}.Ifyouspecifyanentrywithanat-signseparatingtwostrings,pos@text,thenposgivesthealphabeticalpositionoftheentrywhiletextproducesthetextoftheentry.Anotherexampleisthat\index{SaintMichael'sCollege@SMC}producesanindexentry`SMC'alphabetizedintoadi erentlocationthanitsspellingwouldnaturallygiveit.Toputa!,or@,or|characterinanindexentry,precedingitwithadoublequote,".(Thedoublequotegetsdeletedbeforealphabetization.)AnumberofpackagesonCTANhaveadditionalfunctionalitybeyondthatprovidedbymakeidx.Oneisindex,whichallowsformultipleindicesandcontainsacommand\index*{index-entry-string}thatprintstheindex-entry-stringaswellasindexingit.The\indexcommandwritestheindexinginformationtothe leroot-name.idx le.Speci cally,itwritestextofthecommand\indexentry{index-entry-string}{page-num},wherepage-numisthevalueofthe\thepagecounter.Onoccasion,whenthe\printindexcommandisconfused,youhavetodeletethis letostartwithafreshslate.Ifyouomittheclosingbraceofan\indexcommandthenyougetamessagelikethis.Runawayargument?{Ackermann!function!Paragraphendedbefore\@wrindexwascomplete.25.2.2makeindexSynopsis,oneof:makeindexfilenamemakeindex-sstyle-filefilenamemakeindexoptionsfilename0... Chapter25:Front/backmatter208 Sort,andotherwiseprocess,theindexinformationintheauxiliary le lename.Thisisacommandlineprogram.Ittakesoneormorerawindex les,filename.idx les,andproducestheactualindex le,thefilename.ind lethatisinputby\printindex(see Section25.2.3[\printindex],page210 ).The rstformofthecommandsucesformanyuses.Thesecondallowsyoutoformattheindexbyusinganindexstyle le,a.isty le.Thethirdformisthemostgeneral;seethefulldocumentationonCTAN.Thisisasimple.isty le.%book.isty%$makeindex-sbook.isty-poddbook.idx%createstheindexasbook.ind,startingonanoddpage.preamble"\\pagestyle{empty}\\small\\begin{theindex}\\thispagestyle{empty}"postamble"\n\\end{theindex}"Thedescriptionherecoversonlysomeoftheindexformattingpossibilitiesinstyle- le.ForafulllistseethedocumentationonCTAN.Astyle leconsistsofalistofpairs:speci erandattribute.Thesecanappearinthe leinanyorder.Alloftheattributesarestrings,exceptwherenoted.Stringsaresurroundedwithdoublequotes,",andthemaximumlengthofastringis144characters.The\nisforanewlineand\tisforatab.Backslashesareescapedwithanotherbackslash,\\.Ifalinebeginswithapercentsign,%,thenitisacomment.preamblePreambleoftheoutput le.De nesthecontextinwhichtheindexisformatted.Default:"\\begin{theindex}\n".postamblePostambleoftheoutput le.Default:"\n\n\\end{theindex}\n".group_skipTraditionallyindexitemsarebrokenintogroups,typicallyagroupforentriesstartingwith`a',etc.Thisspeci ergiveswhatisinsertedwhenanewgroupbegins.Default:"\n\n\\indexspace\n"(\indexspaceisarubberlengthwithdefaultvalue10ptplus5ptminus3pt).lethead_flagAninteger.Itgovernswhatisinsertedforanewgrouporletter.Ifitis0(whichisthedefault)thenotherthangroup_skipnothingwillbeinsertedbeforethegroup.Ifitispositivethenatanewletterthelethead_prefixandlethead_suffixwillbeinserted,withthatletterinuppercasebetweenthem.Ifitisnegativethenwhatwillbeinsertedistheletterinlowercase.Thedefaultis0. Chapter25:Front/backmatter209 lethead_prefixIfanewgroupbeginswithadi erentletterthenthisisthepre xinsertedbeforethenewletterheader.Default:""lethead_suffixIfagroupbeginswithadi erentletterthenthisisthesuxinsertedafterthenewletterheader.Default:"".item_0Whatisputbetweentwolevel0items.Default:"\n\\item".item_1Putbetweentwolevel1items.Default:"\n\\subitem".item_2putbetweentwolevel2items.Default:"\n\\subsubitem".item_01Whatisputbetweenalevel0itemandalevel1item.Default:"\n\\subitem".item_x1Whatisputbetweenalevel0itemandalevel1iteminthecasethatthelevel0itemdoesn'thaveanypagenumbers(asin\index{aaa|see{bbb}}).Default:"\n\\subitem".item_12Whatisputbetweenalevel1itemandalevel2item.Default:"\n\\subsubitem".item_x2Whatisputbetweenalevel1itemandalevel2item,ifthelevel1itemdoesn'thavepagenumbers.Default:"\n\\subsubitem".delim_0Delimiterputbetweenalevel0keyandits rstpagenumber.Default:acommafollowedbyablank,",".delim_1Delimiterputbetweenalevel1keyandits rstpagenumber.Default:acommafollowedbyablank,",".delim_2Delimiterbetweenalevel2keyandits rstpagenumber.Default:acommafollowedbyablank,",".delim_nDelimiterbetweentwopagenumbersforthesamekey(atanylevel).Default:acommafollowedbyablank,",".delim_rWhatisputbetweenthestartingandendingpagenumbersofarange.Default:"--".line_maxAninteger.Maximumlengthofanindexentry'slineintheoutput,beyondwhichthelinewraps.Default:72.indent_spaceWhatisinsertedatthestartofawrappedline.Default:"\t\t".indent_lengthAnumber.Thelengthofthewrappedlineindentation.Thedefaultindent_spaceistwotabsandeachtabiseightspacessothedefaulthereis16.page_precedenceAdocumentmayhavepagesnumberedindi erentways.Forexample,abookmayhavefrontmatterpagesnumberedinlowercaseromanwhilemainmatterpagesareinarabic.Thisstringspeci estheorderinwhichtheywillappearin Chapter25:Front/backmatter210 theindex.Themakeindexcommandsupports vedi erenttypesofnumerals:lowercaseromanr,andnumericorarabicn,andlowercasealphabetica,anduppercaseromanR,anduppercasealphabeticA.Default:"rnaRA".Thereareanumberofotherprogramsthatdothejobmakeindexdoes.Oneisxindy,whichdoesinternationalizationandcanprocessindexesfordocumentsmarkedupusingLATEXandanumberofotherlanguages.Itishighlycon gurable,bothinmarkuptermsandintermsofthecollatingorderofthetext,asdescribedinitsdocumentation.25.2.3\printindexSynopsis:\printindexPlacetheindexintotheoutput.Togetanindexyoumust rstinclude\usepackage{makeidx}\makeindexinthedoc-umentpreambleandcompilethedocument,thenrunthesystemcommandmakeindex,andthencompilethedocumentagain.See Section25.2[Indexes],page205, forfurtherdiscussionandanexampleoftheuseof\printindex.25.3GlossariesSynopsis:\usepackage{glossaries}\makeglossaries...\newglossaryentry{label}{settings}...\gls{label}....\printglossariesTheglossariespackageallowsyoutomakeglossaries,includingmultipleglossaries,aswellaslistsofacronyms.Togettheoutputfromthisexample,compilethedocument(forinstancewithpdflatexfilename),thenrunthecommandlinecommandmakeglossariesfilename,andthencompilethedocumentagain.\documentclass{...}\usepackage{glossaries}\makeglossaries\newglossaryentry{tm}{%name={Turingmachine},description={Amodelofamachinethatcomputes.Themodelissimplebutcancomputeanythinganyexistingdevicecancompute.ItisthestandardmodelusedinComputerScience.},}\begin{document}Everythingbeginswiththedefinitionofa\gls{tm}....\printglossaries\end{document} Chapter25:Front/backmatter211 Thatgivestwothings.Inthemaintextitoutputs`...definitionofaTuringmachine'.Inaddition,inaseparatesectionalunitheaded`Glossary'thereappearsadescriptionlist.Inboldfaceitsays`Turingmachine'andtherestoftheitemsaysinnormaltype`Amodelofamachine...ComputerScience'.Thecommand\makeglossaryopensthe lethatwillcontaintheentryinformation,root-file.glo.Putthe\printglossariescommandwhereyouwanttheglossariestoappearinyourdocument.Theglossariespackageisverypowerful.Forinstance,besidesthecommands\newglossaryentryand\gls,therearesimilarcommandsforalistofacronyms.SeethepackagedocumentationsonCTAN.25.3.1\newglossaryentrySynopsis,oneof:\newglossaryentry{label}{name={name},description={description},otheroptions,...}or\longnewglossaryentry{label}{name={name},otheroptions...,}{description}Declareanewentryforaglossary.Thelabelmustbeuniqueforthedocument.Thesettingsassociatedwiththelabelarepairs:key=value.Thisputstheblackboardboldsymbolfortherealnumbersintheglossary.\newglossaryentry{R}{name={\ensuremath{\mathbb{R}}},description={therealnumbers},}Usethesecondcommandformifthedescriptionspansmorethanoneparagraph.ForafulllistofkeysseethepackagedocumentationonCTANbuthereareafew.name(Required.)Theword,phrase,orsymbolthatyouarede ning.description(Required.)Thedescriptionthatwillappearintheglossary.Ifthishasmorethanoneparagraphthenyoumustusethesecondcommandformgiveninthesynopsis.pluralThepluralformofname.Refertothepluralformusing\glsplor\Glspl(see Section25.3.2[\gls],page212 ). Chapter25:Front/backmatter212 sortHowtoplacethisentryinthelistofentriesthattheglossaryholds.symbolAsymbol,suchasamathematicalsymbol,besidesthename.25.3.2\glsSynopsis,oneof:\gls{label}\glspl{label}\Gls{label}\Glspl{label}Refertoaglossaryentry.Theentriesaredeclaredwith\newglossaryentry(see Section25.3.1[\newglossaryentry],page211 ).This\newglossaryentry{N}{%name={thenaturalnumbers},description={Thenumbers$0$,$1$,$2$,$\ldots$\@},symbol={\ensuremath{\mathbb{N}}},}...Consider\gls{N}.givestheoutput`Considerthenaturalnumbers'.Thesecondcommandform\glspl{label}producesthepluralofname(bydefaultittriesaddingan`s').Thethirdformcapitalizesthe rstletterofname,asdoesthefourthform,whichalsotakestheplural. 213 26LettersSynopsis:\documentclass{letter}\address{sendersaddress}%returnaddress\signature{sendername}\begin{document}\begin{letter}{recipientaddress}\opening{salutation}letterbody\closing{closingtext}\end{letter}...\end{document}Produceoneormoreletters.Eachletterisinaseparateletterenvironment,whoseargumentrecipientaddressoftencontainsmultiplelinesseparatedwithadoublebackslash,(\\).Forexample,youmighthave:\begin{letter}{Ninondel'Enclos\\l'h\^otelSagonne}...\end{letter}Thestartoftheletterenvironmentresetsthepagenumberto1,andthefootnotenumberto1also.Thesenderaddressandsendernamearecommontoalloftheletters,whetherthereisoneormore,sothesearebestputinthepreamble.Aswiththerecipientaddress,oftensenderaddresscontainsmultiplelinesseparatedbyadoublebackslash(\\).LATEXwillputthesendernameundertheclosing,afteraverticalspaceforthetraditionalhand-writtensignature.Eachletterenvironmentbodybeginswitharequired\openingcommandsuchas\opening{DearMadamorSir:}.TheletterbodytextisordinaryLATEXsoitcancon-taineverythingfromenumeratedliststodisplayedmath,exceptthatcommandssuchas\chapterthatmakenosenseinaletterareturnedo .Eachletterenvironmentbodytypicallyendswitha\closingcommandsuchas\closing{Yours,}.Additionalmaterialmaycomeafterthe\closing.Youcansaywhoisreceivingacopyoftheletterwithacommandlike\cc{theBoss\\theBoss'sBoss}.There'sasimilar\enclcommandforalistofenclosures.And,youcanaddapostscriptwith\ps.LATEX'sdefaultistoindentthesendernameandtheclosingaboveitbyalengthof\longindentation.Bydefaultthisis0.5\textwidth.Tomakethem ushleft,put\setlength{\longindentation}{0em}inyourpreamble.Toseta xeddateusesomethinglike\renewcommand{\today}{1958-Oct-12}.Ifputinyourpreamblethenitwillapplytoalltheletters.Thisexampleshowsonlyoneletterenvironment.Thethreelinesmarkedasoptionalaretypicallyomitted.\documentclass{letter} Chapter26:Letters214 \address{Sender'sstreet\\Sender'stown}\signature{Sender'sname\\Sender'stitle}%optional:\location{Mailbox13}%optional:\telephone{(102)555-0101}\begin{document}\begin{letter}{Recipient'sname\\Recipient'saddress}\opening{Sir:}%optional:\thispagestyle{firstpage}Iamnotinterestedinenteringabusinessarrangementwithyou.\closing{Yourmosthumble,etc.,}\end{letter}\end{document}Thesecommandsareusedwiththeletterclass.26.1\addressSynopsis:\address{sendersaddress}Specifythereturnaddress,asitappearsontheletterandontheenvelope.Separatemultiplelinesinsendersaddresswithadoublebackslash,\\.Becauseitcanapplytomultiplelettersthisdeclarationisoftenputinthepreamble.However,itcangoanywhere,includinginsideanindividualletterenvironment.Thiscommandisoptional:ifyoudonotuseitthentheletterisformattedwithsomeblankspaceontop,forcopyingontopre-printedletterheadpaper.Ifyoudousethe\addressdeclarationthenitisformattedasapersonalletter.Hereisanexample.\address{StephenMaturin\\TheGrapesoftheSavoy}26.2\ccSynopsis:\cc{name0\\...}Producealistofnamestowhichcopiesoftheletterweresent.Thiscommandisoptional.Ifitappearsthentypicallyitcomesafter\closing.Putthenamesondi erentlinesbyseparatingthemwithadoublebackslash,\\,asin:\cc{President\\VicePresident}26.3\closingSynopsis:\closing{text} Chapter26:Letters215 Producetheletter'sclosing.Thisisoptional,butusual.Itappearsattheendofaletter,aboveahandwrittensignature.Forexample:\closing{Regards,}26.4\enclSynopsis:\encl{firstenclosedobject\\...}Producealistofthingsincludedwiththeletter.Thiscommandisoptional;whenitisused,ittypicallyisputafter\closing.Separatemultiplelineswithadoublebackslash,\\.\encl{License\\Passport}26.5\locationSynopsis:\location{text}Thetextappearscenteredatthebottomofthepage.Itonlyappearsifthepagestyleisfirstpage.26.6\makelabelsSynopsis:\makelabels%inpreambleOptional,foradocumentthatcontainsletterenvironments.Ifyoujustput\makelabelsinthepreamblethenattheendofthedocumentyouwillgetasheetwithlabelsforalltherecipients,oneforeachletterenvironment,thatyoucancopytoasheetofpeel-o addresslabels.Customizethelabelsbyrede ningthecommands\startlabels,\mlabel,and\returnaddress(andperhaps\name)inthepreamble.Thecommand\startlabelssetsthewidth,height,numberofcolumns,etc.,ofthepageontowhichthelabelsareprinted.Thecommand\mlabel{returnaddress}{recipientaddress}producesthetwolabels(orone,ifyouchoosetoignorethereturnaddress)foreachletterenvironment.The rstargument,returnaddress,isthevaluereturnedbythemacro\returnaddress.Thesecondargument,recipientaddress,isthevaluepassedintheargumenttotheletterenvironment.Bydefault\mlabelignoresthe rstargument,thereturnaddress,causingthedefaultbehaviordescribedinthepriorparagraph.Thisillustratescustomization.Itsoutputincludesapagewithtwocolumnshavingtwolabelseach.\documentclass{letter}\renewcommand*{\returnaddress}{FredMcGuilicuddy\\Oshkosh,Mineola12305}\newcommand*\originalMlabel{} Chapter26:Letters216 \let\originalMlabel\mlabel\def\mlabel#1#2{\originalMlabel{}{#1}\originalMlabel{}{#2}}\makelabels...\begin{document}\begin{letter}{AEinstein\\112MercerStreet\\Princeton,NewJersey,USA08540}...\end{letter}\begin{letter}{KG\"odel\\145LindenLane\\Princeton,NewJersey,USA08540}...\end{letter}\end{document}The rstcolumncontainsthereturnaddresstwice.Thesecondcolumncontainstheaddressforeachrecipient.Thepackageenvlabmakesformattingthelabelseasier,withstandardsizesalreadypro-vided.Thepreamblelines\usepackage[personalenvelope]{envlab}and\makelabelsareallthatyouneedtoprintenvelopes.26.7\nameSynopsis:\name{name}Optional.Sender'sname,usedforprintingontheenvelopetogetherwiththereturnaddress.26.8\openingSynopsis:\opening{salutation}Required.Followsthe\begin{letter}{...}.Theargumentsalutationismandatory.Forinstance:\opening{DearJohn:}26.9\psSynopsis:\ps{text}Addapostscript.Thiscommandisoptionalandusuallyisusedafter\closing.\ps{P.S.Afteryouhavereadthisletter,burnit.Oreatit.} Chapter26:Letters217 26.10\signatureSynopsis:\signature{firstline\\...}Thesender'sname.Thiscommandisoptional,althoughitsinclusionisusual.Theargumenttextappearsattheendoftheletter,aftertheclosing.LATEXleavessomeverticalspaceforahandwrittensignature.Separatemultiplelineswithadoublebackslash,\\.Forexample:\signature{JFredMuggs\\WhiteHouse}LATEX'sdefaultfortheverticalspacefromthe\closingtextdowntothe\signaturetextis6\medskipamount,whichissixtimes\medskipamount(where\medskipamountisequaltoa\parskip,whichinturnisde nedbydefaulthereto0.7em).Thiscommandisusuallyinthepreamble,toapplytoallthelettersinthedocument.Tohaveitapplytooneletteronly,putitinsidealetterenvironmentandbeforethe\closing.Youcanincludeagraphicinthesignatureashere.\signature{\vspace{-6\medskipamount}\includegraphics{sig.png}\\Myname}Forthisyoumustput\usepackage{graphicx}inthepreamble(see Chapter22[Graphics],page179 ).26.11\telephoneSynopsis:\telephone{number}Thesender'stelephonenumber.Thisistypicallyinthepreamble,whereitappliestoallletters.Thisonlyappearsifthefirstpagepagestyleisselected.Ifso,itappearsonthelowerrightofthepage. 218 27Terminalinput/output27.1\typeinSynopsis,oneof:\typein{prompt-msg}\typein[cmd]{prompt-msg}Printprompt-msgontheterminalandcauseLATEXtostopandwaitforyoutotypealineofinput.Thislineofinputendswhenyouhitthereturnkey.Forexample,thisAslongasIliveIshallneverforget\typein{Enterstudentname:}coupledwiththiscommandlineinteractionEnterstudentname:\@typein=AphraBehngivestheoutput`...neverforgetAphraBehn'.The rstcommandversion,\typein{prompt-msg},causestheinputyoutypedtobeprocessedasifithadbeenincludedintheinput leinplaceofthe\typeincommand.Inthesecondcommandversiontheoptionalargumentcmdargumentmustbeacommandname|itmustbeginwithabackslash,\.Thiscommandnameisthende nedorrede nedtobetheinputthatyoutyped.Forexample,this\typein[\student]{Enterstudentname:}\typeout{Recommendationfor\student.}givesthisoutputonthecommandline,Enterstudentname:\student=JohnDeeRecommendationforJohnDee.wheretheuserhasentered`JohnDee.'27.2\typeoutSynopsis:\typeout{msg}Printmsgontheterminalandinthelog le.This\newcommand{\student}{JohnDee}\typeout{Recommendationfor\student.}outputs`RecommendationforJohnDee'.Likewhathappensherewith\student,com-mandsthatarede nedwith\newcommandor\renewcommand(amongothers)arereplacedbytheirde nitionsbeforebeingprinted.LATEX'susualrulesfortreatingmultiplespacesasasinglespaceandignoringspacesafteracommandnameapplytomsg.Asabove,usethecommand\spacetogetasinglespace, 219 independentofsurroundingspaces.Use^^Jtogetanewline.Getapercentcharacterwith\csname@percentchar\endcsname.Thiscommandcanbeusefulforsimpledebugging,ashere:\newlength{\jhlength}\setlength{\jhlength}{5pt}\typeout{Thelengthis\the\jhlength.}producesonthecommandline`Thelengthis5.0pt'. 220 28CommandlineSynopsis(fromaterminalcommandline):pdflatexoptionsargumentRunLATEXonargument.Inplaceofpdflatexyoucanalsousexelatex,orlualatex,ordviluatex,orlatex.Forexample,thiswillrunLATEXonthe lethesis.tex,creatingtheoutputthesis.pdf.pdflatexthesisNotethat.texisthedefault leextension.pdfTEXisadevelopmentoftheoriginalTEXprogram,asareXeTEXandLuaTEX(see Section2.3[TEXengines],page4 ).Theyarecompletelybackwardcompatible.Buttheoriginalprogramhadacustomoutputformat,DVI,whiletheneweronescanoutputdirectlytoPDF.ThisallowsthemtotakeadvantageoftheextrafeaturesinPDFsuchashyperlinks,supportformodernimageformatssuchasJPGandPNG,andubiquitousviewingprograms.Inshort,ifyourunpdflatexorxelatexorlualatexthenyouwillbydefaultgetPDFandhaveaccesstoallitsmodernfeatures.Ifyourunlatex,ordvilualatex,thenyouwillgetDVI.ThedescriptionhereassumespdfLATEX.See Section28.1[Commandlineoptions],page220 ,foraselectionofthemostusefulcommandlineoptions.Astoargument,theusualcaseisthatitdoesnotbeginwithabackslash,sothesystemtakesittobethenameofa leanditcompilesthat le.IfargumentbeginswithabackslashthenthesystemwillinterpretitasalineofLATEXinput,whichcanbeusedforspeciale ects(see Section28.2[Commandlineinput],page222 ).Ifyougavenoargumentsoroptionsthenpdflatexpromptsforinputfromtheterminal.Youcanescapefromthisbyentering ont;&#xrol0;.IfLATEX ndsanerrorinyourdocumentthenbydefaultitstopsandasksyouaboutit.See Section28.3[Recoveringfromerrors],page222, foranoutlineofwhattodo.28.1CommandlineoptionsThesearethecommand-lineoptionsrelevanttoordinarydocumentauthoring.Forafulllist,tryrunning`latex--help'fromthecommandline.Withmanyimplementationsyoucanspecifycommandlineoptionsbypre xingthemwith`-'or`--'.ThisisthecaseforbothTEXLive(andMacTEX)andMiKTEX.Wewillusebothconventionsinterchangeably.-versionShowthecurrentversion,like`pdfTeX3.14159265-2.6-1.40.16(TeXLive2015/Debian)'alongwithasmallamountofadditionalinformation,andexit.-helpGiveabriefusagemessagethatisusefulasapromptandexit.-interaction=modeTEXcompilesadocumentinoneoffourinteractionmodes:batchmode,nonstopmode,scrollmode,errorstopmode.Inerrorstopmode(thedefault),TEXstopsateacherrorandasksforuserintervention.Inbatchmodeitprintsnothingontheterminal,errorsarescrolledasiftheuserhit&#xretu;&#xrn00;ateveryerror,andmissing lescausethejobtoabort.Innonstopmode,diagnosticmessageappearontheterminalbutasinbatchmodethereisno Chapter28:Commandline221 userinteraction.Inscrollmode,TEXonlystopsformissing lesorkeyboardinput.Forinstance,startingLATEXwiththiscommandlinepdflatex-interaction=batchmodefilenameeliminatesmostterminaloutput.-jobname=stringSetthevalueofTEX'sjobnametothestring.Thelog leandoutput lewillthenbenamedstring.logandstring.pdf.Whenyourunpdflatexoptionsargument,ifargumentdoesnotstartwithabackslashthenTEXconsidersitthenameofa letoinput.Otherwiseitwaitsforthe rst\inputinstructionandthenameoftheinput lewillbethejobname.Thisisusedtonamethelog letheoutput le.Thejobnameoptionoverridesthatprocessanddirectlyspeci esthename.See Section28.2[Commandlineinput],page222, foranexampleofitsuse.-output-directory=directoryWrite lesinthedirectorydirectory.Itmustalreadyexist.--shell-escape--no-shell-escape--enable-write18--disable-write18Enableordisable\write18{shellcommand}.The rsttwooptionsareforwithTEXLiveorMacTEXwhilethesecondtwoareforMiKTEX.SometimesyouwanttorunexternalsystemcommandsfrominsideaLATEX le.ForinstancethepackagesagetexallowsyoutohavethemathematicssoftwaresystemSagedocalculationsordrawgraphsandthenincorporatethatoutputinyourdocument.ForthisTEXprovidesthe\write18command.Butwiththisfunctionalityenabled,securityissuescouldhappenifyoucompiledaLATEX lefromtheInternet.Bydefault\write18isdisabled.(Moreprecisely,bydefaultTEXLive,MacTEX,andMiKTEXonlyallowtheexecutionofalimitednumberofTEX-relatedprograms,whichtheydistribute.)IfyouinvokeLATEXwiththeoptionno-shell-escape,andinyourdocumentyoucall\write18{ls-l},thenyoudonotgetanerrorbutthelog lesays`runsystem(ls-l)...disabled'.-halt-on-errorStopprocessingatthe rsterror.-file-line-error-no-file-line-errorEnableordisablefilename:lineno:error-styleerrormessages.TheseareonlyavailablewithTEXLiveorMacTEX. Chapter28:Commandline222 28.2CommandlineinputAspartofthecommandlineinvocationpdflatexoptionsargumentyoucanspecifyar-bitraryLATEXinputbystartingargumentwithabackslash.Thisallowsyoutodosomespeciale ects.Forexample,this le(whichusesthehyperrefpackageforhyperlinks)canproducetwokindsofoutput,oneforpaperandoneforaPDF.\ifdefined\paperversion%inpreamble\newcommand{\urlcolor}{black}\else\newcommand{\urlcolor}{blue}\fi\usepackage[colorlinks=true,urlcolor=\urlcolor]{hyperref}...\href{https://www.ctan.org}{CTAN}%inbody...Compilingthisdocumentbook.texwiththecommandlinepdflatexbookwillgivethe`CTAN'linkinblue.Butcompilingitwithpdflatex"\def\paperversion{}\inputbook.tex"hasthelinkinblack.(Notetheuseofdoublequotestopreventinterpretationofthesymbolsbythecommandlineshell;yoursystemmaydothisdi erently.)Inasimilarway,fromthesingle lemain.texyoucancompiletwodi erentversions.pdflatex-jobname=students"\def\student{}\input{main}"pdflatex-jobname=teachers"\def\teachers{}\input{main}"Thejobnameoptionistherebecauseotherwiseboth leswouldbecalledmain.pdfandthesecondwouldoverwritethe rst.A nalexample.Thisloadsthepackagegraphicxwiththeoptiondraftpdflatex-jobname=aa"\RequirePackage[draft]{graphicx}\input{aa.tex}"sothegraphic lesarereadfortheirsizeinformationbutnotincorporatedintothePDF.(Thejobnameoptionistherebecauseotherwisetheoutput lewouldbegraphicx.pdf,as\RequirePackagedoesan\inputofitsown.)28.3RecoveringfromerrorsIfLATEX ndsanerrorinyourdocumentthenitgivesyouanerrormessageandpromptsyouwithaquestionmark,?.Forinstance,runningLATEXonthis le\newcommand{\NP}{\ensuremath{\textbf{NP}}}The\PN{}problemisamilliondollarone.causesitshowthis,andwaitforinput.!Undefinedcontrolsequence.l.5The\PN{}problemisamilliondollarone.?Thesimplestthingistoenter`x'and&#xretu;&#xrn00;and xthetypo.Youcouldinsteadenter`?'and&#xretu;&#xrn00;toseeotheroptions. 223 Therearetwoothererrorscenarios.The rstisthatyouforgottoincludethe\end{document}ormisspelledit.InthiscaseLATEXgivesyoua`*'prompt.Youcangetbacktothecommandlinebytyping\stopand&#xretu;&#xrn00;.Thelastscenarioisthatyoumistypedthe lename.Forinstance,insteadofpdflatextestyoumighttypepdflatextste.!Ican'tfindfile`tste'.&#x*000;tste(PressEntertoretry,orControl-Dtoexit)Pleasetypeanotherinputfilename:Thesimplestthingistoenter ont;&#xrol0;and`d'(holdingthemdownatthesametime),andthenretypethecorrectcommandline. 224 AppendixADocumenttemplatesAlthoughnotreferencematerial,perhapsthesedocumenttemplateswillbeuseful.Addi-tionaltemplateresourcesarelistedat http://tug.org/interest.html#latextemplates .A.1beamertemplateThebeamerclasscreatespresentationslides.Ithasavastarrayoffeatures,buthereisabasictemplate:\documentclass{beamer}\title{BeamerClasstemplate}\author{AlexAuthor}\date{July31,2007}\begin{document}\maketitle%without[fragile],any{verbatim}codegetsmysteriouserrors.\begin{frame}[fragile]\frametitle{FirstSlide}\begin{verbatim}Thisis\verbatim!\end{verbatim}\end{frame}\end{document}Onewebresourceforthis: http://robjhyndman.com/hyndsight/beamer/ .A.2articletemplate\documentclass{article}\title{ArticleClassTemplate}\author{AlexAuthor}\begin{document}\maketitle\section{Firstsection}Sometext.\subsection{Firstsection,firstsubsection}Additionaltext. AppendixA:Documenttemplates225 \section{Secondsection}Somemoretext.\end{document}A.3booktemplateThisisastraightforwardtemplateforabook.SeeSee SectionA.4[Largerbooktemplate],page225, foramoreelaborateone.\documentclass{book}\title{BookClassTemplate}\author{AlexAuthor}\begin{document}\maketitle\chapter{First}Sometext.\chapter{Second}Someothertext.\section{Asubtopic}Theend.\end{document}A.4LargerbooktemplateThisisamoreelaboratetemplateforabook.Ithas\frontmatter,\mainmatter,and\backmattertocontrolthetypographyofthethreemainareasofabook(see Section6.7[\frontmatter&\mainmatter&\backmatter],page37 ).Thebookhasabibliographyandanindex.Notableisthatituses\includeand\includeonly(see Chapter24[Splittingtheinput],page198 ).Whileyouareworkingonachapteryoucancommentoutalltheotherchapterentriesfromtheargumentto\includeonly.Thatwillspeedupcompilationwithoutlosinganyinformationsuchascross-references.(Materialthatdoesnotneedtocomeonanewpageisbroughtinwith\inputinsteadof\include.Youdon'tgetthecross-referencebene tthisway.)\documentclass[titlepage]{book}\usepackage{makeidx}\makeindex\title{BookClassTemplate}\author{AlexAuthor}\includeonly{%frontcover,preface,chap1, AppendixA:Documenttemplates226 ...}\begin{document}\frontmatter\include{frontcover}%maybecommentoutwhiledrafting:\maketitle\input{dedication}\input{copyright}\tableofcontents\include{preface}\mainmatter\include{chap1}...\appendix\include{appena}...\backmatter\bibliographystyle{apalike}\addcontentsline{toc}{chapter}{Bibliography}\bibliography\addcontentsline{toc}{chapter}{Index}\printindex\include{backcover}\end{document}A.5tugboattemplateTUGboatisthejournaloftheTEXUsersGroup, http://tug.org/TUGboat .\documentclass{ltugboat}\usepackage{graphicx}\usepackage{ifpdf}\ifpdf\usepackage[breaklinks,hidelinks]{hyperref}\else\usepackage{url}\fi%%%Startofmetadata%%%\title{Example\TUB\article}%repeatinfoforeachauthor.\author{FirstLast}\address{StreetAddress\\Town,Postal\\Country}\netaddress{user(at)exampledotorg}\personalURL{http://example.org/~user/} AppendixA:Documenttemplates227 %%%Endofmetadata%%%\begin{document}\maketitle\begin{abstract}Thisisanexamplearticlefor\TUB{}.Pleasewriteanabstract.\end{abstract}\section{Introduction}Thisisanexamplearticlefor\TUB,linkedfrom\url{http://tug.org/TUGboat/location.html}.Werecommendthe\texttt{graphicx}packageforimageinclusions,andthe\texttt{hyperref}packageifactiveurlsaredesired(inthe\acro{PDF}output).Nowadays\TUB\isproducedusing\acro{PDF}filesexclusively.The\texttt{ltugboat}classprovidestheseabbreviations(andmanymore):%verbatimblocksareoftenbetterin\small\begin{verbatim}[\small]\AllTeX\AMS\AmS\AmSLaTeX\AmSTeX\aw\AW\BibTeX\CTAN\DTD\HTML\ISBN\ISSN\LaTeXe\mf\MFB\plain\POBox\PS\SGML\TANGLE\TB\TP\TUB\TUG\tug\UNIX\XeT\WEB\WEAVE\,\bull\Dash\dash\hyph\acro{FRED}�-{\small[er]fred}%pleaseuse!\cs{fred}�-\fred\meta{fred}�-red;\nth{n}red;-1st,2nd,...\sfrac{3/4}red;-3/4\booktitle{BookofFred}\end{verbatim}Forreferencestoother\TUB\issue,pleaseusetheformat\textsl{volno:issno},e.g.,``\TUB\32:1''forour\nth{100}issue.Thisfileisjustatemplate.The\TUB\styledocumentationisthe\texttt{ltubguid}documentat\url{http://ctan.org/pkg/tugboat}.(For 228 \CTAN\references,wheresensiblewerecommendthatformofurl,using\texttt{/pkg/};or,ifyouneedtorefertoaspecificfilelocation,\texttt{http://mirror.ctan.org/\textsl{path}}.)Email\verb|tugboat@tug.org|ifproblemsorquestions.\bibliographystyle{plain}%werecommendtheplainbibliographystyle\nocite{book-minimal}%justmakingthebibliographynon-empty\bibliography{xampl}%xampl.bibcomeswithBibTeX\makesignature\end{document} 229 Index*`*'prompt:::::::::::::::::::::::::::::::::::: 219 *-formofenvironmentcommands::::::::::::: 107 *-formofsectioningcommands::::::::::::::::: 31 *-form,de ningnewcommands::::::::::::::: 103 ..glo le:::::::::::::::::::::::::::::::::::::: 207 .idx le::::::::::::::::::::::::::::::::: 202 , 204 .ind le:::::::::::::::::::::::::::::::::::::: 204 .isty le::::::::::::::::::::::::::::::::::::: 204 :::::::::::::::::::::::::::::::::::::::::::::::: 145 ``see'and`seealso'indexentries::::::::::::::: 203 n\fboxrule::::::::::::::::::::::::::::::::::::: 168 \fboxsep:::::::::::::::::::::::::::::::::::::: 168 \NEWLINE:::::::::::::::::::::::::::::::::: 158 \SPACE:::::::::::::::::::::::::::::::::::::: 158 \TAB:::::::::::::::::::::::::::::::::::::::: 158 Aabstracts:::::::::::::::::::::::::::::::::::::: 46 accents::::::::::::::::::::::::::::::::::::::: 191 accents,mathematical:::::::::::::::::::::::: 143 accessinganycharacterofafont:::::::::::::: 188 acronyms,listof:::::::::::::::::::::::::::::: 207 acuteaccent:::::::::::::::::::::::::::::::::: 191 acuteaccent,math:::::::::::::::::::::::::::: 143 additionalpackages,loading::::::::::::::::::::: 9 aeligature:::::::::::::::::::::::::::::::::::: 193 algorithm2epackage:::::::::::::::::::::::::: 76 alignenvironment,fromamsmath::::::::::::::: 52 aligningequations:::::::::::::::::::::::::::::: 52 alignmentviatabbing:::::::::::::::::::::::::: 74 amsfontspackage::::::::::::::::::::::::::::: 127 amsmathpackage::::: 47 , 50 , 87 , 127 , 141 , 143 , 145 amsmathpackage,replacingeqnarray:::::::::: 52 amsthmpackage::::::::::::::::::::::::::: 87 , 193 appendices::::::::::::::::::::::::::::::::::::: 37 appendix:::::::::::::::::::::::::::::::::::::: 37 appendixpackage:::::::::::::::::::::::::::::: 38 aring::::::::::::::::::::::::::::::::::::::::: 192 arrays,math::::::::::::::::::::::::::::::::::: 47 arrow,left,intext:::::::::::::::::::::::::::: 190 arrow,right,intext::::::::::::::::::::::::::: 191 ascenderheight::::::::::::::::::::::::::::::: 189 ASCIIcircum ex,intext::::::::::::::::::::: 189 ASCIItilde,intext::::::::::::::::::::::::::: 189 asterisk,centered,intext::::::::::::::::::::: 189 Asymptotepackage::::::::::::::::::::::: 163 , 167 atclause,infontde nitions::::::::::::::::::: 110 author,fortitlepage:::::::::::::::::::::::::: 150 auxiliary le:::::::::::::::::::::::::::::::::::: 4 Bbabelpackage::::::::::: 34 , 84 , 191 , 194 , 200 , 203 background,colored::::::::::::::::::::::::::: 175 backslash,intext::::::::::::::::::::::::::::: 189 bar,doublevertical,intext::::::::::::::::::: 189 bar,vertical,intext:::::::::::::::::::::::::: 189 bar-overaccent::::::::::::::::::::::::::::::: 191 bar-overaccent,math::::::::::::::::::::::::: 143 bar-underaccent:::::::::::::::::::::::::::::: 192 basicsofLATEX::::::::::::::::::::::::::::::::: 3 beamertemplateandclass:::::::::::::::::::: 221 beginningofdocumenthook::::::::::::::::::: 51 bibliographyformat,open::::::::::::::::::::::: 9 bibliography,creating(automatically):::::::::: 86 bibliography,creating(manually)::::::::::::::: 83 bibTEX,using:::::::::::::::::::::::::::::::::: 86 bigcirclesymbols,intext::::::::::::::::::::: 189 Bigpoint::::::::::::::::::::::::::::::::::::: 119 bigfootpackage:::::::::::::::::::::::::::::: 102 blackboxes,omitting::::::::::::::::::::::::::: 9 blackboardbold:::::::::::::::::::::::::::::: 140 bmpackage:::::::::::::::::::::::::::::::::::: 140 boldfont:::::::::::::::::::::::::::::::::::::: 18 boldmath::::::::::::::::::::::::::::::::::::: 18 boldtypewriter,avoiding::::::::::::::::::::::: 49 boldfacemathematics::::::::::::::::::::::::: 140 book,backmatter::::::::::::::::::::::::::::: 38 book,endmatter:::::::::::::::::::::::::::::: 38 book,frontmatter::::::::::::::::::::::::::::: 38 book,mainmatter::::::::::::::::::::::::::::: 38 box::::::::::::::::::::::::::::::::::::::::::: 166 box,allocatingnew::::::::::::::::::::::::::: 106 box,colored:::::::::::::::::::::::::::::::::: 174 box,save::::::::::::::::::::::::::::::::::::: 170 box,usesavedbox:::::::::::::::::::::::::::: 171 boxes::::::::::::::::::::::::::::::::::::::::: 166 brace,left,intext::::::::::::::::::::::::::::: 189 brace,right,intext::::::::::::::::::::::::::: 189 breakinglines:::::::::::::::::::::::::::::::::: 90 breakingpages::::::::::::::::::::::::::::::::: 95 breaks,multiplicationdiscretionary::::::::::: 145 breveaccent:::::::::::::::::::::::::::::::::: 192 breveaccent,math:::::::::::::::::::::::::::: 143 bugreporting::::::::::::::::::::::::::::::::::: 2 Index230 bulletsymbol::::::::::::::::::::::::::::::::: 130 bullet,intext::::::::::::::::::::::::::::::::: 189 bulletedlists::::::::::::::::::::::::::::::::::: 57 Ccalligraphicfonts:::::::::::::::::::::::::::::: 140 calligraphiclettersformath:::::::::::::::::::: 18 capheight:::::::::::::::::::::::::::::::::::: 189 caronaccent:::::::::::::::::::::::::::::::::: 192 catcode::::::::::::::::::::::::::::::::::::::::: 6 categorycode,character::::::::::::::::::::::::: 6 cclist,inletters:::::::::::::::::::::::::::::: 211 cedillaaccent::::::::::::::::::::::::::::::::: 192 centeredasterisk,intext:::::::::::::::::::::: 189 centeredequations:::::::::::::::::::::::::::::: 9 centeredperiod,intext::::::::::::::::::::::: 190 centeringtext,declarationfor:::::::::::::::::: 48 centeringtext,environmentfor::::::::::::::::: 48 Centimeter::::::::::::::::::::::::::::::::::: 119 chapter:::::::::::::::::::::::::::::::::::: 31 , 33 charactercategorycode::::::::::::::::::::::::: 6 characters,accented:::::::::::::::::::::::::: 191 characters,caseof:::::::::::::::::::::::::::: 187 characters,non-English::::::::::::::::::::::: 192 characters,reserved::::::::::::::::::::::::::: 187 characters,special:::::::::::::::::::::::::::: 187 checkaccent:::::::::::::::::::::::::::::::::: 192 checkaccent,math:::::::::::::::::::::::::::: 143 Cicero:::::::::::::::::::::::::::::::::::::::: 119 circlesymbol,big,intext::::::::::::::::::::: 189 circledletter,intext:::::::::::::::::::::::::: 189 circum exaccent::::::::::::::::::::::::::::: 191 circum exaccent,math::::::::::::::::::::::: 143 circum ex,ASCII,intext::::::::::::::::::::: 189 citationkey:::::::::::::::::::::::::::::::::::: 84 classandpackagecommands::::::::::::::::::: 11 classandpackagedi erence:::::::::::::::::::: 10 classandpackagestructure:::::::::::::::::::: 10 class leexample:::::::::::::::::::::::::::::: 10 class lelayout:::::::::::::::::::::::::::::::: 10 classoptions::::::::::::::::::::::::::::: 8 , 10 , 12 classesofdocuments:::::::::::::::::::::::::::: 8 cleverefpackage::::::::::::::::::::::::: 43 , 100 closingletters::::::::::::::::::::::::::::::::: 211 closingquote::::::::::::::::::::::::::::::::: 189 code,typesetting::::::::::::::::::::::::::::::: 88 coloncharacter::::::::::::::::::::::::::::::: 145 color::::::::::::::::::::::::::: 172 , 173 , 174 , 175 colormodels:::::::::::::::::::::::::::::::::: 172 colorpackagecommands:::::::::::::::::::::: 173 colorpackageoptions::::::::::::::::::::::::: 172 color,de ne:::::::::::::::::::::::::::::::::: 173 coloredboxes::::::::::::::::::::::::::::::::: 174 coloredpage:::::::::::::::::::::::::::::::::: 175 coloredtext::::::::::::::::::::::::::::::::::: 173 commandline::::::::::::::::::::::::::::::::: 217 commandsyntax:::::::::::::::::::::::::::::::: 5 commands,classandpackage:::::::::::::::::: 11 commands,de ningnewones:::::::::::: 103 , 105 commands,documentclass::::::::::::::::::::: 10 commands,graphicspackage:::::::::::::::::: 180 commands,ignorespaces:::::::::::::::::::::: 112 commands,rede ning::::::::::::::::::::::::: 103 commands,star-variants:::::::::::::::::::::::: 7 compositewordmark,intext::::::::::::::::: 189 computerprograms,typesetting:::::::::::::::: 88 con guration,graphicspackage::::::::::::::: 177 contents le::::::::::::::::::::::::::::::::::::: 4 copyrightsymbol::::::::::::::::::::::::::::: 188 counters,alistof::::::::::::::::::::::::::::: 114 counters,de ningnew:::::::::::::::::::::::: 105 counters,gettingvalueof::::::::::::::::::::: 115 counters,printing::::::::::::::::::::::::::::: 114 counters,setting:::::::::::::::::::::::::::::: 116 cprotectpackage:::::::::::::::::::::::::: 88 , 89 creatingpictures::::::::::::::::::::::::::::::: 66 creatingtables::::::::::::::::::::::::::::::::: 77 creditfootnote:::::::::::::::::::::::::::::::: 151 crossreferences:::::::::::::::::::::::::::::::: 43 crossreferences,resolving::::::::::::::::::::::: 4 crossreferencingwithpagenumber::::::::::::: 44 crossreferencing,symbolic::::::::::::::::::::: 44 currency,dollar::::::::::::::::::::::::::::::: 190 currency,euro:::::::::::::::::::::::::::::::: 190 Ddagger,double,intext:::::::::::::::::::::::: 190 dagger,intext::::::::::::::::::::::::::: 188 , 190 date,fortitlepage::::::::::::::::::::::::::::: 151 date,today's:::::::::::::::::::::::::::::::::: 194 datetimepackage::::::::::::::::::::::::::::: 194 de necolor::::::::::::::::::::::::::::::::::: 173 de ninganewcommand::::::::::::::::: 103 , 105 de ningnewenvironments:::::::::::::::::::: 106 de ningnewfonts:::::::::::::::::::::::::::: 110 de ningnewtheorems:::::::::::::::::::::::: 108 de nitions:::::::::::::::::::::::::::::::::::: 103 delimiters,paired::::::::::::::::::::::::::::: 146 descriptionlists,creating::::::::::::::::::::::: 49 designsize,infontde nitions::::::::::::::::: 110 Didotpoint::::::::::::::::::::::::::::::::::: 119 dieresisaccent:::::::::::::::::::::::::::::::: 191 di erencebetweenclassandpackage::::::::::: 10 discretionarybreaks,multiplication::::::::::: 145 discretionaryhyphenation:::::::::::::::::::::: 92 displaymathmode::::::::::::::::::::::::::: 148 displayingquotedtextwithparagraphindentation::::::::::::::::::::::: 74 displayingquotedtextwithoutparagraphindentation::::::::::::::::::::::: 74 documentclasscommands::::::::::::::::::::: 10 documentclassoptions:::::::::::::::::::::::::: 8 documentclass,de ned::::::::::::::::::::::::: 3 documentclasses:::::::::::::::::::::::::::::::: 8 Index231 documenttemplates:::::::::::::::::::::::::: 221 dollarsign:::::::::::::::::::::::::::::::::::: 190 dotaccent:::::::::::::::::::::::::::::::::::: 191 dotoveraccent,math::::::::::::::::::::::::: 143 dot-overaccent::::::::::::::::::::::::::::::: 191 dot-underaccent:::::::::::::::::::::::::::::: 192 dotlessi:::::::::::::::::::::::::::::::::::::: 191 dotlessi,math:::::::::::::::::::::::::::::::: 132 dotlessj:::::::::::::::::::::::::::::::::::::: 191 dotlessj,math:::::::::::::::::::::::::::::::: 132 dots:::::::::::::::::::::::::::::::::::::::::: 141 doubleanglequotationmarks::::::::::::::::: 188 doubledagger,intext:::::::::::::::::::: 188 , 190 doubledotaccent,math:::::::::::::::::::::: 143 doubleguillemets::::::::::::::::::::::::::::: 188 doubleleftquote:::::::::::::::::::::::::::::: 190 doublelow-9quotationmark:::::::::::::::::: 189 doublequote,straightbase:::::::::::::::::::: 191 doublerightquote:::::::::::::::::::::::::::: 190 doublespacing::::::::::::::::::::::::::::::::: 21 doubleverticalbar,intext:::::::::::::::::::: 189 doublestruck:::::::::::::::::::::::::::::::::: 140 Ee-dash:::::::::::::::::::::::::::::::::::::::: 190 e-TEX::::::::::::::::::::::::::::::::::::::::::: 4 ellipses::::::::::::::::::::::::::::::::::::::: 141 ellipsis:::::::::::::::::::::::::::::::::::::::: 188 em::::::::::::::::::::::::::::::::::::::::::: 119 em-dash:::::::::::::::::::::::::::::::::::::: 190 em-dash,three-quarters::::::::::::::::::::::: 191 em-dash,two-thirds::::::::::::::::::::::::::: 191 emphasis:::::::::::::::::::::::::::::::::::::: 18 enclosurelist::::::::::::::::::::::::::::::::: 212 endofdocumenthook::::::::::::::::::::::::: 51 endingandstarting::::::::::::::::::::::::::::: 3 engines,TEX:::::::::::::::::::::::::::::::::::: 4 enlargecurrentpage::::::::::::::::::::::::::: 96 enumitempackage:::::::::::::::::::::::::::::: 62 environment:::::::::::::::::::::::::::::::::::: 3 environment,theorem-like::::::::::::::::::::: 108 environments:::::::::::::::::::::::::::::::::: 46 environments,de ning:::::::::::::::::::::::: 106 envlabpackage::::::::::::::::::::::::::::::: 213 EPS les::::::::::::::::::::::::::::::::: 177 , 180 equationnumber,crossreferencing::::::::::::: 44 equationnumbers,leftvs.right:::::::::::::::::: 9 equationnumbers,omitting:::::::::::::::::::: 53 equations,aligning::::::::::::::::::::::::::::: 52 equations,environmentfor::::::::::::::::::::: 53 equations, ushleftvs.centered::::::::::::::::: 9 es-zetGermanletter:::::::::::::::::::::::::: 193 eth,Icelandicletter::::::::::::::::::::::::::: 193 etoolboxpackage:::::::::::::::::::::::::::::: 12 eurosymbol:::::::::::::::::::::::::::::::::: 190 eurosympackage:::::::::::::::::::::::::::::: 190 ex:::::::::::::::::::::::::::::::::::::::::::: 119 exclamationpoint,upside-down::::::::::::::: 190 exponent::::::::::::::::::::::::::::::::::::: 128 extendedLatin::::::::::::::::::::::::::::::: 192 external les,writing::::::::::::::::::::::::::: 54 Ffamilies,offonts::::::::::::::::::::::::::::::: 19 fancyhdrpackage:::::::::::::::::::::::: 150 , 152 fancyvrbpackage:::::::::::::::::::::::::: 76 , 88 feminineordinalsymbol::::::::::::::::::::::: 190 gurenumber,crossreferencing:::::::::::::::: 44 gures,footnotesin:::::::::::::::::::::::::::: 66 gures,inserting::::::::::::::::::::::::::::::: 53 le,root:::::::::::::::::::::::::::::::::::::: 195 xed-widthfont:::::::::::::::::::::::::::::::: 18 flafterpackage::::::::::::::::::::::::::::::: 28 floatpackage::::::::::::::::::::::::::::::::: 28 oatpage:::::::::::::::::::::::::::::::::::::: 28 ushleftequations:::::::::::::::::::::::::::::: 9 ushing oatsandstartingapage:::::::::::::: 95 fontcatalogue:::::::::::::::::::::::::::::::::: 19 fontcommands,low-level::::::::::::::::::::::: 19 fontsize::::::::::::::::::::::::::::::::::::::: 21 fontsizes:::::::::::::::::::::::::::::::::::::: 19 fontstyles::::::::::::::::::::::::::::::::::::: 17 fontsymbols,bynumber:::::::::::::::::::::: 188 fonts::::::::::::::::::::::::::::::::::::::::::: 17 fonts,newcommandsfor:::::::::::::::::::::: 110 fonts,script::::::::::::::::::::::::::::::::::: 140 footerstyle::::::::::::::::::::::::::::::::::: 152 footer,parametersfor:::::::::::::::::::::::::: 25 footnotenumber,crossreferencing::::::::::::: 44 footnoteparameters:::::::::::::::::::::::::::: 98 footnote,inatable::::::::::::::::::::::::::: 100 footnote,insectionheadings:::::::::::::::::: 100 footnote,ofafootnote:::::::::::::::::::::::: 102 footnotesin gures::::::::::::::::::::::::::::: 66 footnotes,creating::::::::::::::::::::::::::::: 98 Footnotes,inaminipage::::::::::::::::::::::: 99 footnotes,symbolsinsteadofnumbers:::::::::: 98 formulas,environmentfor:::::::::::::::::::::: 53 formulas,math::::::::::::::::::::::::::::::: 127 forwardreference:::::::::::::::::::::::::::::: 43 forwardreferences,resolving::::::::::::::::::::: 4 fraction::::::::::::::::::::::::::::::::::::::: 146 fragilecommands::::::::::::::::::::::::::::: 111 Frenchquotationmarks::::::::::::::::::::::: 188 functions,math::::::::::::::::::::::::::::::: 142 Index232 Ggeometrypackage::::::::::::::::::::::::::::::: 9 globaloptions::::::::::::::::::::::::::::::: 8 , 10 glossaries::::::::::::::::::::::::::::::::::::: 207 glossary:::::::::::::::::::::::::::::::::::::: 207 glossary,entries::::::::::::::::::::::::::::::: 208 glossary,entryreference::::::::::::::::::::::: 208 glueregister,plainTEX::::::::::::::::::::::: 106 graphics::::::::::::::::::::::::::::: 176 , 177 , 180 graphicspackage:::::::::::::::::::: 176 , 177 , 180 graphicspackagecommands::::::::::::::::::: 180 graphicspackageoptions:::::::::::::::::::::: 176 graphicspackages:::::::::::::::::::::::::::::: 70 graphics,resizing::::::::::::::::::::::::::::: 186 graphics,scaling:::::::::::::::::::::::::::::: 186 graveaccent:::::::::::::::::::::::::::::::::: 192 graveaccent,math:::::::::::::::::::::::::::: 143 greaterthansymbol,intext:::::::::::::::::: 190 greekletters:::::::::::::::::::::::::::::::::: 129 group,andenvironments::::::::::::::::::::::: 46 Hhacekaccent:::::::::::::::::::::::::::::::::: 192 hacekaccent,math::::::::::::::::::::::::::: 143 Halmossymbol::::::::::::::::::::::::::::::: 193 hataccent:::::::::::::::::::::::::::::::::::: 191 hataccent,math:::::::::::::::::::::::::::::: 143 headerstyle::::::::::::::::::::::::::::::::::: 152 header,parametersfor::::::::::::::::::::::::: 25 hello,world::::::::::::::::::::::::::::::::::::: 3 here,putting oats::::::::::::::::::::::::::::: 28 horizontalspace:::::::::::::::::::::::::::::: 155 horizontalspace,stretchable:::::::::::::::::: 155 hungarianumlautaccent:::::::::::::::::::::: 192 hyperrefpackage::::::::::::::::::: 100 , 152 , 218 hyphenation,de ning:::::::::::::::::::::::::: 93 hyphenation,discretionary::::::::::::::::::::: 92 hyphenation,forcing::::::::::::::::::::::::::: 92 hyphenation,preventing:::::::::::::::::::::: 166 IIcelandiceth:::::::::::::::::::::::::::::::::: 193 Icelandicthorn::::::::::::::::::::::::::::::: 193 idx le:::::::::::::::::::::::::::::::::::::::: 204 ijletter,Dutch:::::::::::::::::::::::::::::::: 193 implementationsofTEX::::::::::::::::::::::::: 4 importinggraphics:::::::::::::::::::::::::::: 180 in-lineformulas:::::::::::::::::::::::::::::::: 64 includinggraphics:::::::::::::::::::::::::::: 180 indent,forcing:::::::::::::::::::::::::::::::: 124 indentationofparagraphs,inminipage::::::::: 66 indentfirstpackage::::::: 32 , 33 , 35 , 36 , 37 , 124 indexentries,`see'and`seealso':::::::::::::: 203 indexentry::::::::::::::::::::::::::::::::::: 203 indexpackage:::::::::::::::::::::::::::::::: 204 index,pagerange::::::::::::::::::::::::::::: 203 index,printing:::::::::::::::::::::::::::::::: 207 index,processing::::::::::::::::::::::::::::: 204 indexes::::::::::::::::::::::::::::::::::::::: 202 in nitehorizontalstretch::::::::::::::::::::: 155 in niteverticalstretch:::::::::::::::::::::::: 164 innerparagraphmode:::::::::::::::::::::::: 148 input le::::::::::::::::::::::::::::::::::::: 195 input/output,toterminal::::::::::::::::::::: 215 inserting gures:::::::::::::::::::::::::::::::: 53 insertionsofspecialcharacters:::::::::::::::: 187 internalverticalmode::::::::::::::::::::::::: 148 italiccorrection::::::::::::::::::::::::::::::: 160 italicfont:::::::::::::::::::::::::::::::::::::: 18 JJPEG les::::::::::::::::::::::::::::::: 177 , 180 JPG les::::::::::::::::::::::::::::::::: 177 , 180 justi cation,raggedleft:::::::::::::::::::::::: 56 justi cation,raggedright:::::::::::::::::::::: 56 KKnuth,DonaldE.::::::::::::::::::::::::::::::: 3 Llabel::::::::::::::::::::::::::::::::::::::::::: 43 labelledlists,creating:::::::::::::::::::::::::: 49 LamportTEX::::::::::::::::::::::::::::::::::: 3 Lamport,Leslie::::::::::::::::::::::::::::::::: 3 landscapeorientation:::::::::::::::::::::::::::: 9 LATEXlogo:::::::::::::::::::::::::::::::::::: 188 LATEXoverview::::::::::::::::::::::::::::::::: 3 LATEXProjectteam::::::::::::::::::::::::::::: 2 LATEXvs.LATEX2e:::::::::::::::::::::::::::::: 2 LATEX2elogo::::::::::::::::::::::::::::::::: 188 Latinletters,additional::::::::::::::::::::::: 192 layoutcommands:::::::::::::::::::::::::::::: 23 layout,pageparametersfor:::::::::::::::::::: 25 leftanglequotationmarks:::::::::::::::::::: 188 leftarrow,intext::::::::::::::::::::::::::::: 190 leftbrace,intext::::::::::::::::::::::::::::: 189 leftquote::::::::::::::::::::::::::::::::::::: 188 leftquote,double::::::::::::::::::::::::::::: 190 leftquote,single:::::::::::::::::::::::::::::: 190 left-handequationnumbers::::::::::::::::::::: 9 left-justifyingtext:::::::::::::::::::::::::::::: 56 left-justifyingtext,environmentfor::::::::::::: 55 left-to-rightmode::::::::::::::::::::::::::::: 148 lengths,addingto::::::::::::::::::::::::::::: 120 lengths,allocatingnew:::::::::::::::::::::::: 106 lengths,de ningandusing:::::::::::::::::::: 118 lengths,prede ned:::::::::::::::::::::::::::: 121 lengths,setting::::::::::::::::::::::::::::::: 120 lessthansymbol,intext:::::::::::::::::::::: 190 letters,accented:::::::::::::::::::::::::::::: 191 letters,additionalLatin::::::::::::::::::::::: 192 Index233 letters,ending:::::::::::::::::::::::::::::::: 211 letters,starting::::::::::::::::::::::::::::::: 213 letters,writing:::::::::::::::::::::::::::::::: 210 linebreak,forcing:::::::::::::::::::::::::::::: 90 linebreaking::::::::::::::::::::::::::::::::::: 90 linebreaks,changing::::::::::::::::::::::::::: 93 linebreaks,forcing::::::::::::::::::::::::::::: 94 linebreaks,multiplicationdiscretionary::::::: 145 linebreaks,preventing::::::::::::::::::::::::: 94 linesintables:::::::::::::::::::::::::::::::::: 78 liningnumerals:::::::::::::::::::::::::::::::: 18 liningtextupintables::::::::::::::::::::::::: 78 liningtextupusingtabstops:::::::::::::::::: 74 listitems,specifyingcounter:::::::::::::::::: 115 listof gures le:::::::::::::::::::::::::::::::: 4 listoftables le::::::::::::::::::::::::::::::::: 4 listingspackage:::::::::::::::::::::::::: 76 , 88 listsofitems::::::::::::::::::::::::::::::::::: 57 listsofitems,generic::::::::::::::::::::::::::: 58 listsofitems,numbered:::::::::::::::::::::::: 51 loadingadditionalpackages:::::::::::::::::::::: 9 log le:::::::::::::::::::::::::::::::::::::::::: 4 logo,LATEX::::::::::::::::::::::::::::::::::: 188 logo,LATEX2e::::::::::::::::::::::::::::::::: 188 logo,TEX::::::::::::::::::::::::::::::::::::: 189 longcommand::::::::::::::::::::::::::::::::: 11 low-9quotationmarks,singleanddouble:::::: 189 low-levelfontcommands::::::::::::::::::::::: 19 lowercase::::::::::::::::::::::::::::::::::::: 187 LRmode::::::::::::::::::::::::::::::::::::: 148 ltugboatclass:::::::::::::::::::::::::::::::: 223 LuaTEX::::::::::::::::::::::::::::::::::::::::: 4 Mm-width:::::::::::::::::::::::::::::::::::::: 119 macropackage,LATEXas:::::::::::::::::::::::: 3 macronaccent:::::::::::::::::::::::::::::::: 191 macronaccent,math:::::::::::::::::::::::::: 143 macros2epackage::::::::::::::::::::::::::::::: 6 Madsen,Lars:::::::::::::::::::::::::::::::::: 52 makeabox::::::::::::::::::::::::::::::::::: 166 makeindexprogram::::::::::::::::::::::::::: 204 makingatitlepage:::::::::::::::::::::::::::: 87 makingparagraphs::::::::::::::::::::::::::: 123 marginalnotes:::::::::::::::::::::::::::::::: 125 masculineordinalsymbol::::::::::::::::::::: 190 matchingbrackets:::::::::::::::::::::::::::: 146 matchingparentheses::::::::::::::::::::::::: 146 mathaccents::::::::::::::::::::::::::::::::: 143 mathformulas:::::::::::::::::::::::::::::::: 127 mathfunctions::::::::::::::::::::::::::::::: 142 mathmiscellany:::::::::::::::::::::::::::::: 145 mathmode::::::::::::::::::::::::::::::::::: 148 mathmode,entering:::::::::::::::::::::::::: 127 mathmode,spacing:::::::::::::::::::::::::: 144 mathsymbols::::::::::::::::::::::::::::::::: 129 math,bold::::::::::::::::::::::::::::::::::::: 18 mathtoolspackage::::::::::::::::::::::: 127 , 144 mfirstucpackage::::::::::::::::::::::::::::: 188 mhchempackage::::::::::::::::::::::::::::::: 128 Millimeter:::::::::::::::::::::::::::::::::::: 119 minipage,creatinga::::::::::::::::::::::::::: 64 mintedpackage::::::::::::::::::::::::::::: 76 , 88 modes:::::::::::::::::::::::::::::::::::::::: 148 monospacefont:::::::::::::::::::::::::::::::: 18 movingarguments:::::::::::::::::::::::::::: 111 mpfootnotecounter:::::::::::::::::::::::::::: 99 mu,mathunit:::::::::::::::::::::::::::::::: 119 multicolumntext:::::::::::::::::::::::::::::: 23 multilingualsupport:::::::::::::::::::::::::: 191 multindpackage:::::::::::::::::::::::::::::: 202 multiplication,discretionary:::::::::::::::::: 145 NNBSP:::::::::::::::::::::::::::::::::::::::: 158 nested\include,notallowed::::::::::::::::: 197 newclasscommands::::::::::::::::::::::::::: 10 newcommand,check::::::::::::::::::::::::::: 11 newcommand,de nition::::::::::::::::::::::: 12 newcommands,de ning::::::::::::::::: 103 , 105 newline,outputasinput::::::::::::::::::::::: 91 newline,starting:::::::::::::::::::::::::::::: 90 newline,starting(paragraphmode):::::::::::: 92 newpage,starting::::::::::::::::::::::::::::: 96 non-Englishcharacters:::::::::::::::::::::::: 192 notesinthemargin::::::::::::::::::::::::::: 125 nulldelimiter::::::::::::::::::::::::::::::::: 146 numbereditems,specifyingcounter::::::::::: 115 numerals,old-style::::::::::::::::::::::::::::: 18 Oobliquefont:::::::::::::::::::::::::::::::::::: 18 oeligature:::::::::::::::::::::::::::::::::::: 193 ogonek::::::::::::::::::::::::::::::::::::::: 192 old-stylenumerals:::::::::::::::::::::::::::::: 18 one-columnoutput::::::::::::::::::::::::::::: 23 openingquote:::::::::::::::::::::::::::::::: 188 OpenTypefonts::::::::::::::::::::::::::::::::: 4 options,class:::::::::::::::::::::::::::::::::: 12 options,colorpackage::::::::::::::::::::::::: 172 options,documentclass::::::::::::::::::::: 8 , 10 options,global::::::::::::::::::::::::::::::::: 10 options,graphicspackage::::::::::::::::::::: 176 options,package:::::::::::::::::::::::::::: 10 , 12 ordinals,feminineandmasculine:::::::::::::: 190 oslash:::::::::::::::::::::::::::::::::::::::: 193 outerparagraphmode:::::::::::::::::::::::: 148 overbaraccent:::::::::::::::::::::::::::::::: 191 overdotaccent,math:::::::::::::::::::::::::: 143 overlining::::::::::::::::::::::::::::::::::::: 143 overviewofLATEX::::::::::::::::::::::::::::::: 3 Index234 Ppackage lelayout::::::::::::::::::::::::::::: 10 packageoptions:::::::::::::::::::::::::::: 10 , 12 package,algorithm2e:::::::::::::::::::::::::: 76 package,amsfonts:::::::::::::::::::::::::::: 127 package,amsmath:::: 47 , 50 , 87 , 127 , 141 , 143 , 145 package,amsthm::::::::::::::::::::::::::: 87 , 193 package,appendix::::::::::::::::::::::::::::: 38 package,Asymptote:::::::::::::::::::::: 163 , 167 package,babel:::::::::: 34 , 84 , 191 , 194 , 200 , 203 package,bigfoot::::::::::::::::::::::::::::: 102 package,bm::::::::::::::::::::::::::::::::::: 140 package,cleveref:::::::::::::::::::::::: 43 , 100 package,cprotect:::::::::::::::::::::::::: 88 , 89 package,datetime:::::::::::::::::::::::::::: 194 package,enumitem::::::::::::::::::::::::::::: 62 package,envlab:::::::::::::::::::::::::::::: 213 package,etoolbox::::::::::::::::::::::::::::: 12 package,eurosym::::::::::::::::::::::::::::: 190 package,fancyhdr::::::::::::::::::::::: 150 , 152 package,fancyvrb:::::::::::::::::::::::::: 76 , 88 package,flafter:::::::::::::::::::::::::::::: 28 package,float::::::::::::::::::::::::::::::::: 28 package,geometry:::::::::::::::::::::::::::::: 9 package,hyperref::::::::::::::::::: 100 , 152 , 218 package,indentfirst::::::: 32 , 33 , 35 , 36 , 37 , 124 package,index:::::::::::::::::::::::::::::::: 204 package,listings:::::::::::::::::::::::::: 76 , 88 package,macros2e:::::::::::::::::::::::::::::: 6 package,mathtools:::::::::::::::::::::: 127 , 144 package,mfirstuc:::::::::::::::::::::::::::: 188 package,mhchem:::::::::::::::::::::::::::::: 128 package,minted:::::::::::::::::::::::::::: 76 , 88 package,multind::::::::::::::::::::::::::::: 202 package,pict2e:::::::::::::::::::::::::::::::: 70 package,polyglossia:::::::::: 191 , 194 , 200 , 203 package,sagetex::::::::::::::::::::::::::::: 218 package,setspace::::::::::::::::::::::::::::: 21 package,showidx::::::::::::::::::::::::::::: 202 package,siunitx::::::::::::::::::::::::::::: 159 package,symbols::::::::::::::::::::::::::::: 129 package,textcase:::::::::::::::::::::::::::: 188 package,textcomp::::::::::::::::::::::::::::: 18 package,TikZ:::::::::::::::::::::::::::: 163 , 167 package,titlesec::::::::::::::: 32 , 34 , 35 , 36 , 37 package,tocbibbind:::::::::::::::::::::::::: 200 package,tocloft::::::::::::::::::::::::::::: 200 package,ulem::::::::::::::::::::::::::::::::: 144 package,url::::::::::::::::::::::::::::::::::: 88 package,verbatimbox:::::::::::::::::::::::::: 88 packages,loadingadditional::::::::::::::::::::: 9 pagebreak,forcing::::::::::::::::::::::::::::: 97 pagebreak,preventing::::::::::::::::::::::::: 97 pagebreaking:::::::::::::::::::::::::::::::::: 95 pagelayoutparameters:::::::::::::::::::::::: 25 pagenumber,crossreferencing::::::::::::::::: 44 pagenumberingstyle::::::::::::::::::::::::: 151 pagestyle,thispage:::::::::::::::::::::::::: 153 pagestyles:::::::::::::::::::::::::::::::::::: 150 page,colored::::::::::::::::::::::::::::::::: 175 paireddelimiters:::::::::::::::::::::::::::::: 146 paragraph:::::::::::::::::::::::::::::::::: 31 , 36 paragraphindentation:::::::::::::::::::::::: 125 paragraphindentation,inminipage::::::::::::: 66 paragraphindentationsinquotedtext:::::::::: 74 paragraphindentationsinquotedtext,omitting::::::::::::::::::::::::::::::: 74 paragraphmode::::::::::::::::::::::::: 148 , 168 paragraphsymbol::::::::::::::::::::::::::::: 188 paragraph,ending:::::::::::::::::::::::::::: 123 paragraph,inabox::::::::::::::::::::::::::: 168 paragraphs::::::::::::::::::::::::::::::::::: 123 parameters,forfootnotes::::::::::::::::::::::: 98 parameters,pagelayout:::::::::::::::::::::::: 25 part:::::::::::::::::::::::::::::::::::::::: 31 , 32 PDFgraphic les:::::::::::::::::::::::: 177 , 180 pdfTEX::::::::::::::::::::::::::::::::::::::::: 4 pdfTEXengine:::::::::::::::::::::::::::::::::: 4 period,abbreviation-ending::::::::::::::::::: 157 period,centered,intext::::::::::::::::::::::: 190 period,sentence-ending::::::::::::::::::::::: 157 period,spacingafter:::::::::::::::::::::::::: 157 pica:::::::::::::::::::::::::::::::::::::::::: 119 pict2epackage:::::::::::::::::::::::::::::::: 70 pictures,creating:::::::::::::::::::::::::::::: 66 pilcrow::::::::::::::::::::::::::::::::::::::: 188 placementof oats::::::::::::::::::::::::::::: 28 PNG les:::::::::::::::::::::::::::::::: 177 , 180 poetry,anenvironmentfor::::::::::::::::::::: 89 Point::::::::::::::::::::::::::::::::::::::::: 119 polishl::::::::::::::::::::::::::::::::::::::: 193 polyglossiapackage::::::::::: 191 , 194 , 200 , 203 portraitorientation::::::::::::::::::::::::::::: 9 position,inpicture::::::::::::::::::::::::::::: 68 positionalparameter:::::::::::::::::::::::::: 103 postscript,inletters:::::::::::::::::::::::::: 213 poundssymbol::::::::::::::::::::::::::::::: 189 preamble,de ned::::::::::::::::::::::::::::::: 3 prede nedlengths:::::::::::::::::::::::::::: 121 prompt,`*'::::::::::::::::::::::::::::::::::: 219 pronunciation::::::::::::::::::::::::::::::::::: 3 Qquad::::::::::::::::::::::::::::::::::::::::: 145 questionmark,upside-down::::::::::::::::::: 190 quotationmarks,French:::::::::::::::::::::: 188 quote,singlestraight:::::::::::::::::::::::::: 190 quote,straightbase::::::::::::::::::::::::::: 191 quotedtextwithparagraphindentation,displaying::::::::::::::::::::::: 74 quotedtextwithoutparagraphindentation,displaying::::::::::::::::::::::: 74 Index235 Rradical:::::::::::::::::::::::::::::::::::::::: 146 raggedlefttext:::::::::::::::::::::::::::::::: 56 raggedlefttext,environmentfor::::::::::::::: 56 raggedrighttext::::::::::::::::::::::::::::::: 56 raggedrighttext,environmentfor:::::::::::::: 55 rede ningenvironments::::::::::::::::::::::: 106 reference,forward:::::::::::::::::::::::::::::: 43 references,resolvingforward::::::::::::::::::::: 4 registeredsymbol::::::::::::::::::::::::::::: 191 relation,textabove::::::::::::::::::::::::::: 147 remarksinthemargin:::::::::::::::::::::::: 125 reportingbugs:::::::::::::::::::::::::::::::::: 2 reservedcharacters:::::::::::::::::::::::::::: 187 resizing::::::::::::::::::::::::::::::::::::::: 186 rightanglequotationmarks::::::::::::::::::: 188 rightarrow,intext::::::::::::::::::::::::::: 191 rightbrace,intext:::::::::::::::::::::::::::: 189 rightquote::::::::::::::::::::::::::::::::::: 189 rightquote,double:::::::::::::::::::::::::::: 190 rightquote,single::::::::::::::::::::::::::::: 190 right-handequationnumbers:::::::::::::::::::: 9 right-justifyingtext:::::::::::::::::::::::::::: 56 right-justifyingtext,environmentfor::::::::::: 56 ringaccent::::::::::::::::::::::::::::::::::: 192 ringaccent,math::::::::::::::::::::::::::::: 143 robustcommands::::::::::::::::::::::::::::: 111 romanfont::::::::::::::::::::::::::::::::::::: 18 root le::::::::::::::::::::::::::::::::::::::: 195 roots::::::::::::::::::::::::::::::::::::::::: 146 rotatinggraphics:::::::::::::::::::::::::::::: 185 rotatingtext:::::::::::::::::::::::::::::::::: 185 rotation:::::::::::::::::::::::::::::::::::::: 185 row,tabbing::::::::::::::::::::::::::::::::::: 75 rubberlengths,de ningnew:::::::::::::::::: 106 runningheaderandfooter:::::::::::::::::::::: 25 runningheaderandfooterstyle::::::::::::::: 152 Ssagetexpackage:::::::::::::::::::::::::::::: 218 sansseriffont:::::::::::::::::::::::::::::::::: 18 Scaledpoint:::::::::::::::::::::::::::::::::: 119 scaling:::::::::::::::::::::::::::::::::::::::: 186 scriptfonts::::::::::::::::::::::::::::::::::: 140 scriptlettersformath:::::::::::::::::::::::::: 18 section::::::::::::::::::::::::::::::::::::: 31 , 34 sectionnumber,crossreferencing::::::::::::::: 44 sectionnumbers,printing:::::::::::::::::::::: 31 sectionsymbol:::::::::::::::::::::::::::::::: 189 section,rede ning:::::::::::::::::::::::::::::: 38 sectioningcommands:::::::::::::::::::::::::: 31 sectioning,part:::::::::::::::::::::::::::::::: 32 series,offonts::::::::::::::::::::::::::::::::: 20 setspacepackage:::::::::::::::::::::::::::::: 21 settingcounters::::::::::::::::::::::::::::::: 116 shapes,offonts:::::::::::::::::::::::::::::::: 21 sharpSletters:::::::::::::::::::::::::::::::: 193 showidxpackage:::::::::::::::::::::::::::::: 202 simulatingtypedtext:::::::::::::::::::::::::: 88 singleanglequotationmarks:::::::::::::::::: 188 singleguillemets:::::::::::::::::::::::::::::: 188 singleleftquote::::::::::::::::::::::::::::::: 190 singlelow-9quotationmark::::::::::::::::::: 189 singlequote,straight:::::::::::::::::::::::::: 190 singlerightquote::::::::::::::::::::::::::::: 190 siunitxpackage:::::::::::::::::::::::::::::: 159 sizesoftext:::::::::::::::::::::::::::::::::::: 19 skipregister,plainTEX::::::::::::::::::::::: 106 slantedfont:::::::::::::::::::::::::::::::::::: 18 sloppyparenvironment::::::::::::::::::::::::: 93 smallcapsfont::::::::::::::::::::::::::::::::: 18 space,hard::::::::::::::::::::::::::::::::::: 158 space,insertinghorizontal::::::::::::::::::::: 155 space,insertingvertical::::::::::::::::::::::: 165 space,negativethin::::::::::::::::::::::::::: 159 space,thin:::::::::::::::::::::::::::::::::::: 159 space,unbreakable:::::::::::::::::::::::::::: 158 space,vertical:::::::::::::::::::::::::::::::: 163 spaces:::::::::::::::::::::::::::::::::::::::: 154 spaces,ignorearoundcommands:::::::::::::: 112 spacingwithinmathmode:::::::::::::::::::: 144 spacing,inter-sentence::::::::::::::::::: 157 , 158 Spanishordinals,feminineandmasculine:::::: 190 specialcharacters:::::::::::::::::::::::: 187 , 192 specialinsertions:::::::::::::::::::::::::::::: 187 speci er, oatplacement::::::::::::::::::::::: 28 splittingtheinput le::::::::::::::::::::::::: 195 squareroot::::::::::::::::::::::::::::::::::: 146 stackmath::::::::::::::::::::::::::::::::::: 147 star-variants,commands:::::::::::::::::::::::: 7 starredform,de ningnewcommands::::::::: 103 startinganewpage:::::::::::::::::::::::::::: 96 startinganewpageandclearing oats::::::::: 95 startingandending::::::::::::::::::::::::::::: 3 startingonaright-handpage:::::::::::::::::: 95 sterlingsymbol::::::::::::::::::::::::::::::: 189 straightdoublequote,base:::::::::::::::::::: 191 straightquote,base::::::::::::::::::::::::::: 191 straightsinglequote:::::::::::::::::::::::::: 190 stretch,in nitehorizontal::::::::::::::::::::: 155 stretch,in nitevertical::::::::::::::::::::::: 164 stretch,omittingvertical::::::::::::::::::::::: 25 strut:::::::::::::::::::::::::::::::::::::::::: 162 stylesoftext::::::::::::::::::::::::::::::::::: 17 styles,page::::::::::::::::::::::::::::::::::: 150 subparagraph:::::::::::::::::::::::::::::: 31 , 36 subscript::::::::::::::::::::::::::::::::::::: 128 subsection:::::::::::::::::::::::::::::::::: 31 , 35 subsubsection:::::::::::::::::::::::::::::::::: 36 superscript::::::::::::::::::::::::::::::::::: 128 symbolspackage:::::::::::::::::::::::::::::: 129 symbols,boldface::::::::::::::::::::::::::::: 140 symbols,math:::::::::::::::::::::::::::::::: 129 symbols,text::::::::::::::::::::::::::::::::: 188 Index236 Ttabstops,using:::::::::::::::::::::::::::::::: 74 tableofcontentsentry,manuallyadding::::::: 200 tableofcontents le::::::::::::::::::::::::::::: 4 tableofcontents,avoidingfootnotes::::::::::: 100 tableofcontents,creating::::::::::::::::::::: 199 tableofcontents,sectioningnumbersprinted::: 32 tables,creating:::::::::::::::::::::::::::::::: 77 template,article:::::::::::::::::::::::::::: 221 template,beamer::::::::::::::::::::::::::::: 221 template,book:::::::::::::::::::::::::::::::: 222 template,TUGboat::::::::::::::::::::::::::: 223 templates,document:::::::::::::::::::::::::: 221 terminalinput/output:::::::::::::::::::::::: 215 TEXlogo::::::::::::::::::::::::::::::::::::: 189 textsymbols:::::::::::::::::::::::::::::::::: 188 text,resizing:::::::::::::::::::::::::::::::::: 186 text,scaling:::::::::::::::::::::::::::::::::: 186 textcasepackage::::::::::::::::::::::::::::: 188 textcomppackage:::::::::::::::::::::::::::::: 18 thanks,fortitlepage:::::::::::::::::::::::::: 151 theorem-likeenvironment::::::::::::::::::::: 108 theorems,de ning:::::::::::::::::::::::::::: 108 theorems,typesetting:::::::::::::::::::::::::: 86 thinspace:::::::::::::::::::::::::::::::: 145 , 159 thinspace,negative:::::::::::::::::::::: 145 , 159 thorn,Icelandicletter::::::::::::::::::::::::: 193 three-quartersem-dash:::::::::::::::::::::::: 191 tie:::::::::::::::::::::::::::::::::::::::::::: 158 tie-afteraccent:::::::::::::::::::::::::::::::: 192 TikZpackage::::::::::::::::::::::::::::: 163 , 167 tildeaccent::::::::::::::::::::::::::::::::::: 192 tildeaccent,math:::::::::::::::::::::::::::: 143 tilde,ASCII,intext:::::::::::::::::::::::::: 189 titlepage,separateorrun-in:::::::::::::::::::: 9 titlepages,creating:::::::::::::::::::::::::::: 87 title,fortitlepage::::::::::::::::::::::::::::: 151 titles,making::::::::::::::::::::::::::::::::: 150 titlesecpackage::::::::::::::: 32 , 34 , 35 , 36 , 37 tocbibbindpackage:::::::::::::::::::::::::: 200 tocloftpackage:::::::::::::::::::::::::::::: 200 today'sdate:::::::::::::::::::::::::::::::::: 194 tombstone:::::::::::::::::::::::::::::::::::: 193 trademarksymbol:::::::::::::::::::::::::::: 191 transcript le::::::::::::::::::::::::::::::::::: 4 TrueTypefonts::::::::::::::::::::::::::::::::: 4 TUGboattemplate::::::::::::::::::::::::::: 223 two-columnoutput::::::::::::::::::::::::::::: 23 two-thirdsem-dash::::::::::::::::::::::::::: 191 typestyles::::::::::::::::::::::::::::::::::::: 17 typedtext,simulating:::::::::::::::::::::::::: 88 typefacesizes:::::::::::::::::::::::::::::::::: 19 typefaces:::::::::::::::::::::::::::::::::::::: 17 typewriterfont::::::::::::::::::::::::::::::::: 18 typewriterlabelsinlists:::::::::::::::::::::::: 49 Uulempackage::::::::::::::::::::::::::::::::: 144 umlautaccent:::::::::::::::::::::::::::::::: 191 underbar::::::::::::::::::::::::::::::::::::: 192 underlining::::::::::::::::::::::::::::::::::: 143 underscore,intext:::::::::::::::::::::::::::: 191 Unicodeinput,native::::::::::::::::::::::::::: 4 units,oflength::::::::::::::::::::::::::::::: 119 unocialnatureofthismanual:::::::::::::::::: 2 unorderedlists::::::::::::::::::::::::::::::::: 57 uppercase::::::::::::::::::::::::::::::::::::: 187 urlpackage:::::::::::::::::::::::::::::::::::: 88 usingBibTEX:::::::::::::::::::::::::::::::::: 86 UTF-8:::::::::::::::::::::::::::::::::::::::::: 4 Vvariables,alistof::::::::::::::::::::::::::::: 114 vectorsymbol,math:::::::::::::::::::::::::: 143 verbatimtext:::::::::::::::::::::::::::::::::: 88 verbatimtext,inline::::::::::::::::::::::::::: 88 verbatimboxpackage:::::::::::::::::::::::::: 88 verticalbar,double,intext::::::::::::::::::: 189 verticalbar,intext::::::::::::::::::::::::::: 189 verticalmode::::::::::::::::::::::::::::::::: 148 verticalspace:::::::::::::::::::::::::::: 163 , 165 verticalspacebeforeparagraphs::::::::::::::: 125 visiblespace::::::::::::::::::::::::::::::::::: 88 visiblespacesymbol,intext:::::::::::::::::: 191 Wweights,offonts::::::::::::::::::::::::::::::: 20 whitespace::::::::::::::::::::::::::::::::::: 154 widehataccent,math:::::::::::::::::::::::: 143 widetildeaccent,math::::::::::::::::::::::: 143 widths,offonts:::::::::::::::::::::::::::::::: 20 writingexternal les::::::::::::::::::::::::::: 54 writingletters:::::::::::::::::::::::::::::::: 210 Xx-height:::::::::::::::::::::::::::::::::::::: 119 XeTEX:::::::::::::::::::::::::::::::::::::::::: 5 xindyprogram:::::::::::::::::::::::::::::::: 206