; TeX output 1996.06.26:0347C^DtGGcmr17Pqage7tlayoutinLdKGXQ cmr12AT[-E;gX!N9cPietvXanOostrum2K cmsy8Dept.ofComputerScience UtrecrhtUniversity7June26,1996/_t : cmbx9Abstract.8Co cmr9This/articledescribAesho9wtocustomizethepagelayoutofyourLaT:eXdoAcuments,i.ehow +Ito'c9hangepagemargingsandsizes,,%headersandfoAoters,andthepropAerplacemen9tof gures+IandTtables(collectiv9elycalled oats)onthepage.8COriginallythisw9asthedoAcumentationoftheow cmss9fancyheadingspack|rage.]Itdidcontainalso+Iother=info,e.g.adv|ranceduseofmarks.Ithasno9wbAeenupgradedtoincludemore,e.g.+Ithe|handlingof oats.RThefancyheadingsdoAcumen9tationhasbeenupgradedtoconformto+Iv9ersionp2ofthispack|rage-=Aacmr61*./YF:orreasonsofcompatibilitywithcertainopAeratingsystems,the+InameTofthepac9k|ragehasbAeenchangedtofancyhdr.8CAlthough0thispapAerusesL5A TuAEXc.25" cmmi9")#commands,'mostofthetec9hniquescanbeusedwith+IolderTL5A TuAEXv9ersionswithappropriatechanges.%!G!Nff cmbx12Contents5S!HK`y cmr1018LIntroGduction........................................2N8!H28LPageUUheadersandfoGotersM.................................2!H38LWhatUUis"m#R cmss10fancyhdre.....................................4!H48LSimpleUUuseofrfancyhdr/..................................5!H58LAUUsimpleexample׍.....................................5!H68LAnUUexampleoftwo-sidedUUprintingx............................6!H78LRede ningx#'ExX'smarks#...............................8!H108LDictionaryUUstyleheaders .................................10!H118LF*ancyUUlayouts<.......................................12!H128LTwoUUbGookexamples8T...................................12!H138LSpGecialUUpagelayoutUUfor oatpages...........................14!H148LThoseUUblankpagesz....................................14!H158LNUUofrMstylepagenumbGers...............................15!H168LChapterUUorsectionrelatedpagenumbGers........................16Gff @ -:q% cmsy6L|{Ycmr8AconsiderablepartofthisarticlewÎaswrittenbyGeorgeGratzer(UniversityofManitoba)in#fcmti8NoticesMeAmer. Math.4Soc. Thanks,XGeorge! > "5-:1LܿthisXvÎersionisduetob'ExXdoGcumentisbuiltfromvqariouselementsasshownin gure1.rThebGody GcontainsUUthemaintextofthedoGcumenttogetherwiththesocalled oats(tablesand gures).GThepagesareconstructedbyL5ffA͉TU>'ExX'soutputroutine,whichisquitecomplicatedandshouldthere-GforenotbGemodi ed.o6Someofthepackqagesdescribedinthispapercontainssmallmodi cationsGtotheoutputroutinetoaccomplishthingsthatcannotbGedoneinanotherway*.5lYoushoulduseGtheseUUpackqagestogetthedesiredresultratherthan ddlingwiththeoutputroutineyourself.GThereUUaanumbGerUUofthingsthatyoumustbGeawareof:N8J+1.+IThe^marginsontheleftarenotcalled\leftmargin,Pbut\evensidemargin(oneven-+InumbGeredpages)and\oddsidemargin(onodd-numberedpages).l*Inone-sideddocuments+I\oddsidemarginA1isusedforeither.k\leftmarginisalsoavqalidL5ffA͉TU>'ExXparameterbutithas+IaUUdi erentuse(namelytheindentationoflists).J+2.+IMost[oftheparametersshouldnotbGechangedinthemiddleofadocument.Somechanges+Imightworkatapagebreak.Ifyouwanttochangetheheightofasinglepage,youcanuse+ItheUU\enlargethispagecommand.GThe marginnotesareacontainssmallpiecesofinformationcreatedbythe\marginparcommand.GOnqtwosideddoGcumentsthemarginnotesappGearontheleftandrightalternatively*.6ThemarginGnotesXarenoton xedplaceswithrespGecttothepaperbutatapproximatelythesameheightasGtheparagraphinwhichtheyappGear.BUDuetothealgorithmusedtodecidetheplacementofmarginGnotes,='ExXarede nedbythe\pagestyleand\pagenumberingGcommands.\pagestylede nesthegeneralcontentsoftheheadersandfoGoters(e.g.wheretheGpagenumbGerwillbeprinted),while\pagenumberingde nestheformatofthepagenumbGer.GL5ffA͉TU>'ExXUUhasfourstandardpagestyles:Q2!C濍|UOY,̍,*̎̉,VQ}f`Q}fjQ}ftQ}f~Q}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}f Q}fQ}fQ}f(Q}f2Q}f<Q}fFQ}fPQ}fZQ}fdQ}fnQ}fxQ}fVQ}f`Q}fjQ}ftQ}f~Q}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}fQ}f Q}fQ}fQ}f(Q}f2Q}f<Q}fFQ}fPQ}fZQ}fdQ}fnQ}fxQ}fU}̎5}̎U̎5̎}zQffzQYfwQffwQYfy̎y̎y\̎y\̎hy̎ y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎hy̎ y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎y̎,O}ՙ̍\wHeader̎̉ՙOՙCC̍a^gBoGdyC̎̉ՙOՙ̍^ FJoP)Margin 5NotesC̎̉Q< lcircle10iqhZcmr58Q32fdeO line10Q32fde-+Q1i3q)h7*fe+Q?*,fe+Q6hQiqfh1VQ32fd άmQ32fd -Q2fd pQ2fd -kQiqih3jQsiuqf110\Qs2fdάoQs2fd-\Qd2fd MQd2fd -kQdifqi9i feQ6i feQ?Qiq5111gQkimqe2gi} fegQ}?gif fegQc6Qkimq4i feQ6i} feQ}?Qkimqh5 feQ6} feQ}?ҜQkimq6i feҜQ6ifeҜQ?.ަhm$Cscmtt81}one@inch+\hoffset|T2Yone@inch+\voffset m3}\oddsidemargin@=18pt|T4Y\topmargin@=0ptm5}\headheight@=12pt|T6Y\headsep@=25ptm7}\textheight@=646pt|T8Y\textwidth@=424ptm9}\marginparsep@=11pt'ExX'soutputroutine.GAsN thecommandnamescontainthecharacter'@',7theyshouldbGede nedinapackqage le,7orGotherwiseUUbGesandwichedbetweenUUthecommands\makeatletterand\makeatother.N8GThe \pagenumberingcommandde nesthelayout ofthepagenumbGer.-It hasaparameterfromGtheUUfollowinglist:'dHarabicC7arabicUUnumeralsHromanC7lowerUUcaseromannumeralsHRomanC7uppGerUUcaseromannumeralsHalphC7lowerUUcaseletterHAlphC7uppGerUUcaseletterGThe\pagenumbering{xxx}de nesthecommand\thepagetobGetheexpansionofthepagenum-GbGerDinthegivennotationxxx.Thepagestylecommandthenwouldinclude\thepageintheGappropriategplace.[Additionallythe\pagenumberingcommandresetsthepagenumbGergto1.TheG\pagestyleUeand\pagenumberingapplytothepagethatisbGeingconstructed,UisotheyshouldbeGusedUUataloGcationwhereitiscleartowhatpagetheyapply(seesection17).%_G3*^Whatffis%kAHff cmssbx10fancyhdr5SGThefancyhdr쥲macropackqageallowsyoutocustomizeinL5ffA͉TU>'ExXyourpageheadersandfoGotersinGanUUeasyway*.qYouUUcande ne:N8!H !", cmsy10+Ithree-partUUheadersandfoGoters!H+IdecorativeUUlinesinheadersandfoGoters!H+IheadersUUandfoGoterswiderthanthewidthofthetext!H+Imulti-lineUUheadersandfoGoters!H+IseparateUUheadersandfoGotersforevenandoddpages!H+Idi erentUUheadersandfoGotersforchapterpages!H+Idi erentUUheadersandfoGoteronpageswith oatsGOfUUcourse,youalsohavecompletecontroloverfonts,uppGercaseandlowercasedisplays,etc.Q4PCG4*^Simpleffuseoffancyhdr5SGT*o/usethispackqageinaL5ffA͉TU>'ExX2 b> cmmi10"-ҲdoGcument,eplacethe lefancyhdr.styinadirectory/folder GwherenTU>'ExXcan ndit(normallyintheinputdirectory/folder),=andincludeinthepreambleofGyourUUdoGcumentafterN8G\documentclass{...}GtheUUcommands^2|s:G\usepackage{fancyhdr} G\pagestyle{fancy}GW*eUUcanvisualizethepagelayoutUUwecancreatewithfancyhdrxasfollows:=,G9ffV㎍Vff9LeftHeaderz)CenteredHeaderRightHeaderffHApageUUbGodyffHLeftF*oGoter}}CenteredFooter}}RightFooterHVffffffGTheLeftHeaderandLeftF*oGoterareleftjusti ed;3theCenteredHeaderandCenteredF*oGoterareGcentered;UUtheRightHeaderandRightF*oGoterarerightjusti ed.N8GW*eUUde neeachofthesix\ elds"andthetwodecorativelinesseparately*.%_G5*^Affsimpleexample5SGK.:}GrantiswritingarepGorttoDeanA.Smith,?on\Theperformanceofnewgraduates"withtheGfollowingUUpagelayout: "5-:3LܿNotethatvÎersion1offancyheadingsusedthe\setlengthcommandtochangethe\...rulewidthparameters.Q5^CG\rfoot{\thepage} G\renewcommand{\headrulewidth}{0.4pt}G\renewcommand{\footrulewidth}{0.4pt}N8G(The\thepagemacrodisplaysthecurrentpagenumbGer.\bfseriesistheL5ffA͉TU>'ExX2")֭'swayofGselectingUUbGoldface.)N8GThispCisnow ne,exceptthatthe rstpagedoGesnotneedalltheseheadersandfooters.%lT*oeliminateGallUUbutthecenteredpagenumbGer,issuethecommandN8G\thispagestyle{plain}GafterUUthe\begin{document}andthe\maketitlecommands.GAlternatively*,UUissueN8G\thispagestyle{empty}GifUUyoudonotwantanyheadersorfoGoters.GInĉfactthestandardL5ffA͉TU>'ExXclasseshaveĉthecommand\maketitlede nedinsuchawaythata G\thispagestyle{plain}isautomaticallyissued.Soifyou'': cmti10donwantthefancylayoutonapageGcontainingx\maketitleUUyoumustissuea\thispagestyle{fancy}afterthe\maketitle.%_G6*^Anffexampleoftwo-sidedffprinting5SGSomeUdoGcumentclasses,suchasbook.cls,printtwo-sidedbydefault:4theevenpagesandtheoGddGpagesUUhavedi erentlayouts;otherdoGcumentclassesusethetwosideoptiontoprinttwo-sided.GNowKZletusprinttherepGorttwo-sided.ntLettheabGovepagelayoutbGeusedfortheodd(right-side)Gpages,UUandthefollowingfortheeven(left-side)pages:=-GffTǍTffTheTpQerformanceofnewgraduatesffHApageUUbGodyffH 4fF*rom:qK.UUGrantY$To:DeanUUA.SmithHTffffff8QGwhereUU\4"isthepagenumbGer.GHereUUarethecommands:N8G\fancyhead{}?%clearallfieldsG\fancyhead[RO,LE]{\bfseries?Theperformanceofnewgraduates}G\fancyfoot[LE,RO]{\thepage}G\fancyfoot[LO,CE]{From:?K.Grant}G\fancyfoot[CO,RE]{To:?DeanA.Smith}G\renewcommand{\headrulewidth}{0.4pt}G\renewcommand{\footrulewidth}{0.4pt}GW*eXusethemoregeneralcommands\fancyheadand\fancyfoot.ThesehaveXanadditionalGparameterwJbGetweensquarebracketsthatspGeci esforwhichpagesand/orpartsoftheheader/foGoterGtheypapply*.The rst\fancyheadcommandomitsthisparameter,vandthusappliestoallheaderQ6h8C}&ϦpffSȤfd fffdE䡄 ffEvenUUpage  ff  fffdO ffOddUUpage ffffSȡ fffdL ffLeftUU eld8 ff fffdC: ffCenterUU eld ff fffdRj ffRightUU eld ㍟ ffffSȡ fffdHG ffHeader ff fffdF@ ffF*oGoter ffffSȎC>CiFigureUU2:qSelectorstG elds.gInXgeneralthisisonlyusefultogetridofthedefaultsorapreviousde nition,asisdone Ghere.͚ThesselectorsthatcanbGeusedbetweensthesquarebracketssaregivenin gure2.͚SelectorsGcanbGecombinedso\fancyhead[LE,RO]{text}willde nethe eldforboththeleftheaderonGevenmgpagesandtherightheaderonoGddpages.Ifyoudon'tgiveanEmaorOthede nitionappliesGto+bGoth.cSimilarforLRC.Sotheuseof\lheadintheprevioussectionisjustanabbreviationforG\fancyhead[L].UUTheselectorsmaybGegivenasuppGercaseorlowercaseletters.N8GThere;isalsoamoregeneralcommand\fancyhfthatyoucanusetocombinethespGeci cationsGfor[headersandfoGoters.ThisallowsadditionalselectorsH(header)andF(foGoter).InfactG\fancyheadUUand\fancyfootarejust\fancyhfwithHandFprespGeci ed.GAgain,UUyoumayuse\thispagestyle{plain}forasimplepagelayoutforpage1.$ӿG7*^Rede ning(߆Tff cmtt12plainffstyle5SGSomeoaL5ffA͉TU>'ExXcommands,_like\chapter,usethe\thispagestylecommandtoautomaticallyswitchGtotheplainpagestyle,'ExXusesaGmarkerBjmechanismtoremembGerthechapterandsection(sectionandsubsection)informationforGaUUpage;thisisdiscussedindetailintheL5ffA͉TU>'ExXComp}'anion,Section4.3.1.N8GThere,aretwo,waysyoucanuseandchangethehigher-andlower-levelsectioninginformationGavqailabletoyou.pThemacros: \leftmark(higher-level)and\rightmark(lower-level)containGtheUUinformationproGcessedbyL5ffA͉TU>'ExX,andyoucanusethemdirectlyasshowninSection8.GThe\leftmarkcontainstheLeftargumentoftheL}'astv{\markbothonthepage,7the\rightmarkGcontainstheRightargumentofthe Rst\markbothortheonlyargumentofthe Rst\markrightGonUUthepage.qIfnomarksarepresentonapagetheyare\inherited"fromthepreviouspage.GY*ouIcanin uencehowchapter,'section,andIsubsectioninformation(onlytwoofthem!)isdisplayedGbyCrede ningthe\chaptermark,|\sectionmark,>and\subsectionmarkcommands^4|s.yY*oumustGputUUtherede nitionafterthe rstcallofr\pagestyle{fancy}asthissetsupthedefaults.Gˉff J= "5-:4LܿThereXaresimilarcommandsforparagraphandsubparagraphbuttheyareseldomused.Q8 ٠C㎍rGCoAde: G,ߤN cmtt9\renewcommand{\chaptermark}[1]{%\markboth{\chaptername\\thechapter.\#1}{}}G\renewcommand{\chaptermark}[1]{%\markboth{\MakeUppercase{%\chaptername}\\thechapter.%\#1}{}}G\renewcommand{\chaptermark}[1]{%\markboth{\MakeUppercase{%\chaptername\\thechapter.%\#1}}{}}G\renewcommand{\chaptermark}[1]{%\markboth{#1}{}}G\renewcommand{\chaptermark}[1]{%\markboth{\thechapter.\#1}{}}G\renewcommand{\chaptermark}[1]{%\markboth{\thechapter.%\\chaptername.\#1}{}}\QPrin9ts: \QChapterT2.Doitno9w\QCHAPTERT2.Doitno9w\QCHAPTERT2.DOITNO9W\QDoTitno9w\Q2.TDoitno9w\Q2.TChapter.Doitno9wǍџFigureUU3:qMarkervqariants7GLetUUusillustratethiswithchapterinfo.qItismadeupofthreeparts:o!H+ItheUUnumbGer(say*,2),displayedbythemacro\thechapterᜍ!H+ItheUUname(inEnglish,Chapter),displayedUUbythemacro\chaptername!H+ItheUUtitle,containedintheargumentofr\chaptermark.GFigure%3showssomevqariantsfor\Chapter2.Doitnow"(thelastexampleisappropriatein Gsome6non-Englishlanguages).gThe%signsattheendofthelinesaretoprevent6unwantedspace.GNormallyUUyouwouldcontinuethelinesandremovethese%signs^5|s.N8GF*orUUthelower-levelUUsectioninginformation,dothesamewith\markright.GSoUUif\Section2.2.Firststeps"isthecurrentsection,then=G\renewcommand{\sectionmark}[1]{\markright{\thesection.\?#1}}GwillUUgive\2.2.Firststeps"N8GRede ning3the\chaptermarkand\sectionmarkcommandsmaynoteliminatealluppGercaseness. GE.g.Qthebibliographywillhaveatitle&ofn-- cmcsc10bibliographyFintheheader, asthe\MakeUppercaseisGexplicitly&giveninthede nitionof{C\thebibliography.< Similarforindexetc.Ifyoudon'twanttoGrede nethesecommands,!youcanusethe\nouppercasecommandthatfancyhdr8vmakesavqailableGinytheheaderandfoGoter elds.޵Notethatthismayscrewotherthings,¸likeuppGercaseromanGnumeralsvinyourheaders,~soitshouldbGeusedwithcare.n*EssentiallythiscommandtypGesetsitsG9ȉff J= "5-:5Lܿthe\MakeUppercasecommandisusedinL#A TAEMXFd22cmmi8"%Otogenerateupp'ExXmarkingmechanismworks newithchapters(whichalwaysGstart/onanewpage)andsections(whicharereasonablylong).LItdoGesnotworkquiteaswellwithGshortUUsectionsandsubsections.qThisisaproblemwithL5ffA͉TU>'ExX,notwithfancyhdr.N8GAs4Ranexamplelet'stakeapagelayoutwheretheleftmarksaregeneratedbythesectionsandtheGrightmarks/bythesubsections(asisdefaultinthearticleclass)..VT*akeapagewithsomeshortGsections,UUe.g.GSectionUU1.GsubsectionUU1.1GsubsectionUU1.2GSectionUU2.GAsAitheleftmarkcontainsthelast4AmarkofthepageitwillbGe\Section2.",EeandtherightmarkwillGbGeU\subsection1.1"asitwillbethe rstHղmarkofthepage.sSothepageheaderinfowillcombineGsection(_2withsubsection1.1whichisn'tverynice.bThebGestyoucandointhesecasesisuseonlyGthe3B\rightmarksandrede ne\sectionmarkaccordingly*. A3 L5ffA͉TU>'ExXcommand\firstleftmarkGwouldUUalsobGeaniceaddition(seetheextramarkspackqageinsection18).GAnotherLproblemwiththemarksinthestandardL5ffA͉TU>'ExXclassesisthatthehigherlevelsectioningGcommands-(e.g.O\chapter)call\markbothwithanemptyrightargument.OThismeansthatonGthe rstpageofachapter(orasectioninarticlestyle)the\rightmarkwillbGeempty*.)IfthisisGavproblemyoumustmanuallyinsertextra\markrightcommandsorrede nethe\chaptermarkG(\sectionmark)UUcommandstoissuea\markbothcommandwithtwoUUdecentparameters.GAs)a nalremarkyoushouldalsonotethatthe*formsofthe\chapteretc.commandsdonotGcall"~themarkcommands.`SoifyouwantyourprefacetosettheheaderinfobutnotbGenumbGeredGnorUUbGeputinthetableofcontents,UUyoumustissuethe\markbothcommandyourself,e.g.N8G\chapter*{Preface\markboth{Preface}{}}GEnteringthe\markbothcommandinsidethe\chapter*insuresthatthemarkwillnotbGesepa- Grated yfromthetitlebyapagebreak.X~Ofcoursewith\chapter*thiswouldn'tbGeaproblemifyouGputN-themarkcommandafterthechaptertitle,Oasthe\chapter*commandstartsatanewpage.GHoweverUUwitha\section*itcouldbGedangeroustosay:N8G\section*{Preface}G\markboth{Preface}{}GasUUapagebreakmayoGccurbetweenUUthetwoUUcommands.%_G102wDictionaryffstyleheaders5SGDictionariesCandconcordancesusuallyhaveCaheadercontainingthe rstwordde nedonthepageGorbGoththe rstandthelastwords.RThiscaneasilybeaccomplishedwithfancyhdràandL5ffA͉TU>'ExX'sGmarkômechanism.AG%CorrectedbyPietvanOostrumonFeb5,1993,Oct5,1994G\def\@outputdblcol{\if@firstcolumn\global\@firstcolumnfalseG%Rememberthemarksfromthefirstcolumn$\global\setbox\@leftcolumn\copy\@outputbox$\splitmaxdepth=\maxdimen\cbaddness=10000$\setbox\@outputbox\vsplit\@outputboxto\maxdimen$\xdef\@firstcoltopmark{\topmark}%$\xdef\@firstcolfirstmark{\splitfirstmark}%$\ifx\@firstcolfirstmark\empty\global\let\@setmarks\relax\else.j\gdef\@setmarks{\let\firstmark\@firstcolfirstmark7\let\topmark\@firstcoltopmark}%$\fiG%Endofchanges\else\global\@firstcolumntrue$\setbox\@outputbox\vbox{\hboxto\textwidth{\hboxto\columnwidth.j{\box\@leftcolumn\hss}\hfil\vrulewidth\columnseprule\hfil3$a\hboxto\columnwidth{\box\@outputbox\hss}}}\@combinedblfloatsG%Overridecurrentfirstandtopwiththoseoffirstcolumnifnecessary3$a\@setmarksG%Endofchange3$a\@outputpage\begingroup\@dblfloatplacement\@startdblcolumn3$a\@whilesw\if@fcolmade\fi{\@outputpage\@startdblcolumn}\endgroup$\fi}ƍU)FigureUU4:qFixmarksintwoGcolumnUUstyleG\renewcommand{\chaptermark}[1]{} G\renewcommand{\sectionmark}[1]{}N8GNow'ExX'smarksarestrangebGeasts,whichcannotbecomparedoutoftheboxwiththeplainTU>'ExX\ifGcommands.qF*ortunatelyUUtheifthenpackqageworkswell:G\newcommand{\mymarks}{A\ifthenelse{\equal{\leftmark}{\rightmark}}';{\rightmark}?%ifequal';{\rightmark--\leftmark}}?%ifnotequalG\fancyhead[LE,RO]{\mymarks}G\fancyhead[LO,RE]{\thepage}GDictionaries;areoftendonewithtwo;columns.VUnfortunatelythereisabuginL5ffA͉TU>'ExX'stwoGcolumnGoptionwhichcausessomemarkstobGelost.>Ifyouusethepackqagein gure4,thiswillbGesolved^6|s^7.GX-ff J= "5-:6LܿThisXisasimpli cationoftheactualco "5-:7LܿTheXmulticolpacÎkageusesasimilartechnique.\P11 _CG112wFfancyfflayouts5SGY*ouucanmakeamulti-line eldwiththe\\command.cItisalsopGossibletoputextraspaceina G eldJwiththe\vspacecommand.nONotethatifyoudothisyouwillprobablyhavetoincreasetheGheightof/theheader(\headheight)and/orofthefoGoter(\footskip),HotherwiseyoumaygetGerrorOmessages\Overfull\vbox...hasOoGccurredwhile\outputisactive"^8|s.oSeeSection4.1oftheGL5ffA͉TU>'ExXUUComp}'anionfordetail.N8GF*orinstance,"thefollowingcoGdewillplacethesectiontitleandthesubsectiontitleofanarticleinGtwoUUlinesintheuppGerrighthandcorner:N8G\documentclass{article}G\usepackage{fancyhdr}G\pagestyle{fancy}G\addtolength{\headheight}{\baselineskip}G\renewcommand{\sectionmark}[1]{\markboth{#1}{}}G\renewcommand{\subsectionmark}[1]{\markright{#1}}G\rhead{\leftmark\\\rightmark}GY*ou canalsocustomizethedecorativelines.YYoucanmakethedecorativelineintheheaderquiteGthickUUwithG\renewcommand{\headrulewidth}{0.6pt}GorUUyoucanmakethedecorativelineinthefoGoterdisappearwithN8G\renewcommand{\footrulewidth}{0pt}GThedecorativelines,ˉthemselves,arede nedinthetwomacros\headruleand\footrule.wF*or Ginstance,ifyouwantadottedlineratherthanasolidlineintheheader,rede nethecommandG\headrule:G\renewcommand{\headrule}{\vbox?to0pt{\hbox';to\headwidth{\dotfill}\vss}}GThere(isoneadditionalparameterthatyoucanset:-n\footruleskip.AItde nesthedistanceGbGetweenthedecorativelineinthefooterandthetopofthefootertextline.rBydefaultitissetGtow30%ofthenormallinedistance.yY*oumaywanttoadjustitifyouuseunusallylargeorsmallGfontsUUinthefoGoter.qChangeitwith\renewcommand.%_G122wTwoffbs3ookexamples5SGTheUUfollowingde nitionsgiveanapproximationofthestyleusedinL.LampGort'sL5ffA͉TU>'ExXbook.N8GLampGort'sUUheaderoverhangsUUtheoutsidemargin.qThisisdoneasfollows.GThewidthofheadersandfoGotersis\headwidth,vwhichbydefaultequalsthewidthofthetext: G\textwidth.Y*ou,canmakethewidthwider(ornarrower)byrede ningP+\headwidthwiththeG\setlengthand\addtolengthcommands.T*ooverhangtheoutsidemarginwherethemarginalGnotesare printed,_+addbGoth\marginparsepand\marginparwidthto\headwidthwiththeGcommands:Gffff J= "5-:8LܿIfXyÎouuse11ptor12ptyouwillprobablyalsohavetodothis,b\fancyhead{}?%getridofheaders!>\renewcommand{\headrulewidth}{0pt}?%andthelineG}GNoticeЪthatthe\chaptermarkand\sectionmarkcommandshaveЪbGeenrede nedtoeliminatetheGchapterUUnumbGersandtheuppercaseness.N8GF*orUUthesecondexample,wetaketheAAMS-L5ffA͉TU>'ExXbGook.GChapterUUpageshaveUUnoheadersorfoGoters.qSowedeclareG\thispagestyle{empty}GforUUeverychapterpage,andwedonotneedtorede neplain.GChapter2andsectiontitlesappGearintheform: 2.DO}ITNOW,2sowehavetorede ne G\chaptermarkUUand\sectionmarkasfollows(seeSection9):G\renewcommand{\chaptermark}[1]%!>{\markboth{\MakeUppercase{\thechapter.\?#1}}{}}G\renewcommand{\sectionmark}[1]%!>{\markright{\MakeUppercase{\thesection.\?#1}}}GIn~aneven-header,thepagenumbGerisprintedastheLeftHeaderandthechapterinfoastheGRightHeader;in]anoGdd-header,thesectioninfoisprintedastheLeftHeaderandthepagenumbGerGasUUtheRightHeader.qTheCenteredHeadersareempty*.qTherearenofoGoters.N8GThereUUisadecorativelineintheheader.qItis0.5ptwide,soweneedthecommands:G\renewcommand{\headrulewidth}{0.5pt}G\renewcommand{\footrulewidth}{0pt}GThe fontusedintheheadersis9ptbGoldHelvetica.YThePSNFSSsystembySebastianRahtzusesGtheUUshort(KarlBerry)namephvforHelvetica,sothisfontisselectedwiththecommands:GUff J= "5-:9LܿInXvÎersion2ofw.s6cmss8fancyhdritisusuallysafetodoitb'ExXComp}'anion.)qLetusde neashorthandforthis:G\newcommand{\helv}{% !>\fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont}GNowUUwearereadyforthepagelayout:G\documentclass{book}G\usepackage{fancyhdr}G\pagestyle{fancy}G\renewcommand{\chaptermark}[1]%!>{\markboth{\MakeUppercase{\thechapter.\?#1}}{}}G\renewcommand{\sectionmark}[1]%!>{\markright{\MakeUppercase{\thesection.\?#1}}}G\renewcommand{\headrulewidth}{0.5pt}G\renewcommand{\footrulewidth}{0pt}G\newcommand{\helv}{%!>\fontfamily{phv}\fontseries{b}\fontsize{9}{11}\selectfont}G\fancyhf{}G\fancyhead[LE,RO]{\helv?\thepage}G\fancyhead[LO]{\helv?\rightmark}G\fancyhead[RE]{\helv?\leftmark}$ɍG132wSps3ecialffpagelayoutfffor oatpages5SGSome#HpGeoplewant#Htohave#Haspeciallayout#Hfor oatpages(pagesonlycontaining oats).aAstheseGpagesJaregeneratedautonomicallybyL5ffA͉TU>'ExX,LQtheuserdoGesn'thaveanycontroloverthem.nThereGis!no\thispagestylefor oatpagesandanychangeofthepagestylewillatleastalsoa ectGtheXpagebGeforethe oatpage.{Withfancyhdr,Yxhowever,youXcanspGecifyineachoftheheader-orGfoGoterUU eldsN8G\iffloatpage{vqalueUUfor oatpage}{valueforotherpages}GY*ouUUcanevenusethistogetridofthedecorativelineon oatpagesonlybyde ning:G\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}GSometimesyoumaywanttochangethelayoutalsoforpagesthatcontaina oatonthetopofGtheUUpageora oatonthebGottomofthepage.N8GfancyhdrxgivesUUyouthecommands\iftopfloatand\ifbotfloatsimilarto\iffloatpage.GNote:AMarks in oatswillnotbGevisibleinL5ffA͉TU>'ExX'soutputroutine,KsoitisnotusefultoputmarksGin oats.>Sothereiscurrentlynowaytoleta oat(e.g.a gurecaption)in uencethepageheaderGorUUfoGoter.$ɍG142wThoseffblankpages5SGInithebookclasswhentheopenanyoptionisnotgivenorinthereportclasswhentheopenrightGoptionisgiven, chaptersstartatoGdd-numberedpages, halfofthetimecausingablankpagetobeGinserted. SomepGeoplepreferthispagetobecompletelyempty*,i.e.withoutheadersandfooters.GThiscannotbGedonewith\thispagestyleasthiscommandwouldhavetobGeissuedontheGpr}'evious'vpage.qThereUUis,however,UUnomagicnecessarytogetthisdone:\P14bCG\clearpage{\pagestyle{empty}\cleardoublepage}N8GAsMbthe\pagestyle{empty}isenclosedinagroupitonlya ectsthepagethatmaybGegenerated Gby1the\cleardoublepage.\Y*oucanofcourseputtheabGoveinaprivqatecommand.\IfyouwantGtohavethisdoneautomaticallyateachchapterstartorwhenyouwantsomeothertextontheGpageUUthenyoumustrede nethe\cleardoublepagecommand.N8G\makeatletterG\def\cleardoublepage{\clearpage\if@twoside?\ifodd\c@page\elseA\hbox{}A\vspace*{\fill}A\begin{center}';This?pageintentionallycontainsonlythissentence.A\end{center}A\vspace{\fill}A\thispagestyle{empty}A\newpageA\if@twocolumn\hbox{}\newpage\fi\fi\fi}G\makeatother%_G152wNffofMstylepagenumbs3ers5SGSomedoGcumentwriterspreferthepagestobenumberedasnofmwheremisthenumberofpagesGinthedoGcument.EThereisapackqagenofm.styavqailable,wbutsomeversionsofitaredefective,wandGmostdon'tworkwithfancyhdrbGecausetheytakeoverthecompletepagelayout.\F*orL5ffA͉TU>'ExX2"GthereUUisapackqagelastpageavqailablewhichyoucanusewithfancyhdrxasfollows:G\usepackage{lastpage}G...G\cfoot{\thepage\?of\pageref{LastPage}}GIf[youarestillusingL5ffA͉TU>'ExX2.09andyouarenotabletoswitchtoL5ffA͉TU>'ExX2"* tyoucanusetheL5ffA͉TU>'ExX2.09GcompatibleUUlastpage209.sty.qwhichisde nedasfollows:G\let\origenddocument=\enddocumentG\def\enddocument{\clearpage\if@fileswA{\addtocounter{page}{-1}?\immediate\write\@mainaux';{\string\newlabel{LastPage}{{}{\thepage}}}}\origenddocument}GTheuvqalueoftheLastPagelabGelcanbeusedtomakedi erentheadersorfoGotersonthelastpageGofadoGcument.FDE.g.ifyouwantthefoGoterofeveryoGddpage,exceptifitisthelastone,tocontainGtheUUtext\pleaseturnover",UUthiscanbGedoneasfollows^10x:G\usepackage{lastpage}G\usepackage{ifthen}G...G\rfoot{\ifthenelse{\isodd{\value{page}}?\and\not';\value{page}=\pageref{LastPage}{please?turnover}{}}GJff J=w-:10LܿThisXrequiresareasonablyrecenÎtversionoftheifthenpackage.\P15ًCG162wChapterfforsectionrelatedpagenumbs3ers5SGInCtechnicaldoGcumentationveryoftenpagenumbGersareusedoftheform2-10wherethe rst GnumbGer@ isthechapternumbGerandthesecondisthepagenumbGerrelativetothechapter.YSometimesGsectionjisusedratherthanchapter.ThepackqagechappgcanbGeusedtogetthisformat.IfyouGwantJtochangethelayoute.g.=useadotratherthanadash,Horasectionratherthanachapter,GyouUUshouldmakeaprivqatecopyandeditit.N8GThis@packqagerede nes\thepageas\arabic{chapter}-\arabic{page}.Unfortunate-Gly4thisgivesnumbGersratherthanlettersforappendices.!dAbetterde nitionwouldGbGe \thechapter-\arabic{page}butyoucangivethisde nitionyourselfaftertheG\usepackage{chappg}Z޲command. bWhatthepackqagealsodoGesisresetthepagenumbGerGtoUU1atthebGeginningofeachchapter.GThere)[isafundamentaldi erencebGetweenthepagenumbGeringofthestyle\mofnc"asdescribGedGin{~theprevioussectionandthecurrentone.AThem?ofnstyleisonlyusedinthepageheaderorGfoGoter,NbutMQnotinthetableofcontents,index,orMQreferenceslike\Se}'epageLxx".oThereforeMQitdoGesGnotIchangethecommand\thepage.֢ThepagenumbGeringstyle\2-10",howevershouldbGeusedGinUUallreferencestothepagenumbGer,UUthereforeitmustbedonebyrede ningx\thepage.%jG172wWhenfftochangetheheadersandfos3oters?5SGSometimesyouwanttochangetheheaderorfoGoterlayoutinthecourseofadoGcument.SomeGofthesechangescanbGeaccomplishedbyusingthemarkmechanismasmaybGeseeninsection9Gand 18.However,sometimeswewantamoredrasticchange,e.gtochangethepagenumbGeringGfrom romantoarabic(with\pagenumbering),vtochangeoneofthefancyhdrޖ eldsortochangeGtojZanotherpagestyle.SometimesyoumaybGesurprisedto ndthechangetooGccurtooearly*.InGgeneral theabGove mentionedchangestakee ectimmediately*,:i.e.onthepagethatiscurrentlyGbGeing'built. =Ifyouwantthechangetotakee ectatthenextpageyoumustmakesurethattheGcurrentpageis nished.VInmostcasesthiscanbGedonebyissuinga\clearpagecommandbGeforeGanyȻoftheabGovementionedchanges.IfthisisnotpGossibleyoucanusetheafterpagepackqageGwith:G\afterpage{\lhead{new?value}}^or\afterpage{\pagenumbering{roman}. Y*oucannotuseG\afterpageh3tochangethe\pagestyleasthecommandsissuedby\afterpageareloGcalinaGgroup, andthe\pagestylecommandmakesonlyloGcalchanges.*The\pagenumberingandtheGfancyhdrڜcommandsmakeglobalchangessotheywillwork,ֶaswillthe\thispagestylecommand.GItbshouldbGenotedthatalthoughthefancyhdrcommandslike\fancyheadtakee ectimmediately*,GthisdoGesnotmeanthatany\vqariables"usedinthesecommandsgetthevaluetheyhaveatGtheplacewherethesecommandsaregiven. "E.g.ifO;\fancyfoot[C]{\thepage}isgiventhepageGnumbGerԓthatwillbeinsertedinthefooterisnotthepagenumberԓofthepagewherethiscommandGisfgiven,butratherthepagenumbGeroftheactualpagewherethefooterisconstructed.QwOfcourseGforUUthepagenumbGerUUthisiswhatyouexpect,butitisalsotrueforothercommands.GSo+qifyouhaveabGook+qwhereeachchapteriswrittenbyadi erentauthorandyouwantthenameGofUUtheauthorinthelowerUUleft-handcorneryoucanusethefollowingcommands:G\newcommand{\TheAuthor}{}G\newcommand{\Author}[1]{\renewcommand{\TheAuthor}{#1}}G\lfoot{\TheAuthor}Gand%|starteachchapterwiththecommand\Author{Real?Name}.;Ifhowever,YtheauthornameGwouldAbGechangedbGeforeapageiscompletedthewrongauthorcouldcomeinthefooter.'ExX'soutputroutineproGcessescommandsahead,\P16䆠CGso;%itmayalreadyhaveproGcessedsomecommandsthatproducetextthatwillappearonthenext Gpage.qSeeUUthenextsectionforanexample.$䍍G182wHeadersffandfos3otersinducedbythetext5SGW*ėhaveseenhowwecanuseL5ffA͉TU>'ExX'smarkstogetinformationfromthedoGcumentcontentstoGthe9headersandfoGoters.CrThemarksmechanismistheonlyreliablemechanismthatyoucanuseGtogetchanginginformationtotheheadersorfoGoters.| ThisisbecauseL5ffA͉TU>'ExXmaybeprocessingGyourUUdoGcumentaheadbGeforedecidingtobreakthepage.N8GSometimesUUthetwoUUmarksthatL5ffA͉TU>'ExXo ersarenotenough.qAnexampleisthefollowing: X+IIfIasolutiontoanexercisegoGesacrossapagebreak,KthenIIwouldliketohave\(Con-+Itinued\onnextpage...)"_tat\thebGottomofthe rstpageand\(Continued...)"_tat\the+ItopUUinthemarginofthenextpage.GY*ouAcannotuseL5ffA͉TU>'ExX'smarkmechanismsforthisifyoualsowanttousechapterandsectionGinformation.N8GThe]coGdefrom gure5constitutesapackqagethatgivesyoutwoextramarksthatcanbGeusedinGthisUUsituation^11x.qHereisawayUUtousethispackqage:G\usepackage{extramarks}G...G\pagestyle{fancy}G\lhead{\firstxmark}G\rfoot{\lastxmark}G...G\extramarks{}{Continued?onnextpage\ldots}GSome?textthatmayormaynotcrossapageboundary...G\extramarks{Continued\ldots}{}GNotethatthe\extramarkscommandmustbGeclosetothetext,1i.enoemptylines(paragraphGbGoundaries)shouldintervene. OtherwisethepagemaybebrokenatthatboundaryandtheGextramarksUUwouldcomeonthewrongpage.N8GTherearetwonewmarksthatcanbGeusedinthepagelayoutwiththispackqage: IfcommandsGoftheform\extramarks{m1|s}{m2}˲aregiven \firstxmarkgivesyouthe rstm1 >vqalueandG\lastxmark|)givesyouthelastm2vqalueofthecurrentpage.RItalsogivesyouthe\firstleftmarkGandUU\lastrightmarkcommandsthatcomplementthestandardL5ffA͉TU>'ExXmarks.GT*ostressthepGointthatmarksarethecorrectwaytodothis,́letmegiveyoua\solution"thatGwillUUnotwork^12x:G\lhead{Continued}G\rfoot{Continued?onnextpage\ldots}GSome?textthatmayormaynotcrossapageboundary...G\lhead{}G\rfoot{}GY*oumaybGetemptedtothinkthatthe rst\lheadand\rfootwillbeine ectwhenTU>'ExXbreaksGthepageinthemiddleofthetext,Pandthelastoneswhenthepagebreaksafterthetext."ThisGA=ff J=w-:11LܿAftereIemadethispacÎkageIdiscoÎveredeapacÎkagesecret.stythatdow-:12LܿActuallyqthereisanotherwÎayqbutitrequirestÎwoqL#A TAEMXpasses:syÎoucanput\labelcommandsb'ExXGisnottrueasthewholeparagraph(includingthelastde nitions)willbGeprocessedbeforeTU>'ExX GconsidersLthepagebreak,ϵsoatthetimeofthepagebreakthelastde nitionsaree ective,whetherGthepagebreakoGccursinsidethetextoroutsideofit.^PuttingaparagraphboundarybetweentheGtext$andthelastde nitionswillnotworkeither,WbGecauseyoudon'twantthe rstde nitionstoGbGeine ectwhenTU>'ExXdecidestobreakthepageexactlyatthisboundary*.^ActuallythemarksGmechanismUUwasinventedtogetridofthesekindsofproblems.N8GInȹtheabGoveȹexamplethetext\Continued"ȹappearsinthepageheader.ItmaybenicertoGputitinthemargin.ThiscanbGeeasilyaccomplishedbypositioningitata xedplacerelativeGtojthepageheader.InplainTU>'ExXyouwoulduseaconcoGctionofw\hbox?to0pt,/\vboxto0pt,G\hskip,\vskip,\hss'ExX'spictureenvironment'ExXseemstoGostubborntodowhatyouGwant.V.ThissectiondescribGeshowyoucanin uenceL5ffA͉TU>'ExXsothatitwilldomostofthetimewhatGyou *want.ETheremight,;howeverbGesomepathologicalcaseswhereitisimpossibletoconvinceGL5ffA͉TU>'ExXtodothingsyourway*.Inthefollowingwewilluse guresasanexamplebuteverythingGappliesUUtoother oatsaswell.GTheUUmostencounteredproblemswith oatsare:!J+1.+IY*ouwanta oatatacertainpGositioninthetext, butL5ffA͉TU>'ExXmovesit, usuallytothenext+Ipage.Q􍍍J+2.+IF*romd6acertainpGoint,gL5ffA͉TU>'ExXmovesallyour oatstotheendofthedoGcumentortheendof+IaUUchapter.J+3.+IL5ffA͉TU>'ExXUUcomplainsabGout\T*oomany oats".!GIn&the rsttwo&casesyoumust rstcheckifyouhavegiventhecorrect\placement"parametertoGyou* oat,_e.g.E\begin{figure}[htp]spGeci esthatyour guremaybGeplacedeither:cpHere(i.e.GinzMthetextpGositionwherethecommandisgiven),ontheT*opofapage(whichmaybGethepageGwherev=youputthecommand),~woronaseparatePageof oats.Y*oucouldalsohavespGeci ed\b"GforBottomofthepage.RTheorderofthelettersisinsigni cant,youcannotforceL5ffA͉TU>'ExXtotryGBottomUU rstandthenT*opbyspGecifyingx[bt].N8GIfzlL5ffA͉TU>'ExXdoGesn'tputthe oatattheplacewhereyouexpectedit,òitisusuallycausedbytheGfollowing:\P20!xCǍ6rG\setlength{\unitlength}{18mm} G\newcommand{\blob}{\rule[-.2\unitlength]{2\unitlength}{.5\unitlength}}G\newcommand\rblob{\thepages\begin{picture}(0,0)$\put(1,-\value{section}){\blob}s\end{picture}}G\newcommand\lblob{%s\begin{picture}(0,0)$\put(-3,-\value{section}){\blob}s\end{picture}%s\thepage}G\pagestyle{fancy}G\cfoot{}G\newcounter{line}G\newcommand{\secname}[1]{\addtocounter{line}{1}%s\put(1,-\value{line}){\blob}s\put(-7.5,-\value{line}){\Large\arabic{line}}s\put(-7,-\value{line}){\Large#1}}G\newcommand{\overview}{\thepages\begin{picture}(0,0)$\secname{Introduction}$\secname{Thefirstyear}$\secname{Specialisation}G...etc...s\end{picture}}G\begin{document}G\fancyhead[R]{\overview}\mbox{}\newpage%ThisproducestheoverviewpageG\fancyhead[R]{}%FrontmattermayfollowhereG\clearpageG\fancyhead[RE]{\rightmark}G\fancyhead[RO]{\rblob}G\fancyhead[LE]{\lblob}G\fancyhead[LO]{{\leftmark}G...ǍfFigureUU7:qThumb-indexcoGde\P210ޠCJ+1.+IThe oatdidn't tonthepage.SInthiscaseithastomovetothenextpageorevenfurther. +IIfyoudidn'tspGecifyeither[t]or[b]inthepositionparameter,ЅL5ffA͉TU>'ExXmustsaveituntil+IitPhasenoughforapageof oats.Sodon'tspGecifyonly[h].IfyouwanttogiveL5ffA͉TU>'ExXa+IchanceUUtoputthe oatonapageof oats,youmustalsospGecify\p".J+2.+ITheplacementwouldviolatetheconstraintsimpGosedbyL5ffA͉TU>'ExX's oatplacementparameters.+IThiszBisoneofthemostoGccurringcausesanditcaneasilybecorrectedbychangingthe+Iparameters.qHereUUisalistofthem:I5<[gffb?fd^CountersUU{changewith\setcounterffb?topnumberp̲max.qnumbGerUUof oatsattopofpageS\]2 bottomnumberp̲max.qnumbGerUUof oatsatbottomofpageS\]1totalnumberp̲max.qnumbGerUUof oatsonapageS\]3ffb?fd`u[OtherUU{changewith\renewcommandffb?\topfractionp̲maxUUfractionofpagefor oatsattopOx0.7 \bottomfractionp̲maxUUfractionofpagefor oatsatbGottomOx0.3\textfractionp̲minUUfractionofpagefortextOx0.2\floatpagefractionp̲minUUfractionof oatpagethatshouldhaveUU oatsOx0.5ffb?펎GThereUUarealsosomeothersfordoublecolumn oatsintwo-columnUUdoGcuments.N8GThevqaluesintherighthandcolumnarethedefaultsforthestandardL5ffA͉TU>'ExXclasses.]Otherclasses Gcouldeusedi erentdefaults.Asyouseewiththedefaultvqaluesa oatwillnotbGeputintheGbGottomHofapageifitsheightismorethan30%ofthepageheight.SoifyouspGecify[hb]foraG oatwhichistallerithastomovetoa oatpage.KButifitislessthan50%ofthepageheightGitwillhavetowaituntilsomemore oatsaregivenbGeforea oatpagecanbe lledtosatisfyGtheCB\floatpagefractionparameter.kIfyouhavethiskindofbGehaviouryoucaneasilyadapttheGparameters,UUe.g.qwith:TUG\renewcommand{\textfraction}{0.05}G\renewcommand{\topfraction}{0.95}G\renewcommand{\bottomfraction}{0.95}G\renewcommand{\floatpagefraction}{0.35}G\setcounter{totalnumber}{5}GY*ouamaywanttobGecarefulnottomake\floatpagefractiontoGosmall,e#otherwiseyoumaygetGtoGoUUmanysmall oatpages.N8GY*oujcanforceL5ffA͉TU>'ExXtoignoremostoftheparametersforonespGeci c oatoccurrencebyincludingGanUUexclamationmark(!)qintheplacementparameters,e.g.G\begin{figure}[!htb]GFloats{whichcontaina\t"inthepGositionparametercouldbeplacedbeforetheplacewheretheyGares referenced(butonthesamepage).ThisisnormalbGehaviourforL5ffA͉TU>'ExXbutsomepeoplejustGdon'tUUlikeit.qThereareanumbGerofwaystopreventthis:J+1.+IOf'coursedeletingthe\t"willhelp,0butingeneralthisisundesirable,asyoumaywantthe+I oatUUtobGeplacedatthetopofthenextpage.J+2.+IuseUUtheflafterpackqagewhichcauses oatsnevertobGeplaced\backwards".J+3.+Iusethecommand\suppressfloats[t]^14x. pSThiscommandwillcause oatsforthetop +IpGositionKonvthisp}'age MtobGemovedtothenextpage.UThiscanalsobGedonewith[b]or+IwithoutUUparameterforall oatsonthispage.G;ff J=w-:14LܿThisXcommandandthe\!" placemenÎtparameterarenotde nedinL#A TAEMX2.09.\P225ؠCGIfinspiteofallyourattemptsL5ffA͉TU>'ExXstillmovesyour oatstotheendofthedoGcumentorthe Gend#ofachapter,Ŗyou#caninserta\clearpagecommand.0ThiswillstartanewpageandinsertGall<pGending oatsbeforecontinueing.&If<itisundesirabletohave<apagebreakyoucanusetheGafterpageUUpackqageandthefollowingcommand:G\afterpage{clearpage}GThis.Awillwaituntilthecurrentpageis nishedandthen ushalloutstanding oats.Insome GpathologicalUUcircumstancesafterpagemaygivestrangeresults,however.N8GFinally*,~Cifvyouwanta oatonlyattheplacewhereyoude neit,~CwithoutL5ffA͉TU>'ExXmovingitwhat-GsoGever,UUyoucanusethe oatpackqageandgivethecommand:G\restylefloat{figure}GinRthepreamble.pNowRyouwillbGeabletospecifyvG[H]Rasthepositionparameter,S?whichwillmean G\HEREandIonlyHERE".Thismaycauseanunwantedpagebreakhowever^15x.IfyouwanttoGavoidGtheunwantedGpagebreak,Ji.e.mSletL5ffA͉TU>'ExXmoveGthe oatonlyifitdoGesn't tonthepage,theGuseUUtheafterpagepackqagewith:G\afterpage{\clearpage?\begin{figure}[H]...\end{figure}}GComplaints@fromL5ffA͉TU>'ExXabGout\T*oomany oats"areusuallycausedbyoneoftheabGoveproblems: G oats[notbGeingabletobeplacedandL5ffA͉TU>'ExXcollectingtoomanyofthem.]ThesolutionsgivenGabGove,especiallyFthosewith\clearpageinthemwillusuallyhelp.EFInsomecasestherereallyGare toGomany oats,{asL5ffA͉TU>'ExXhasalimitednumbGerof\boxes"tostorethe oats.ThepackqageGmore oatsxcanbGeusedtoincreasethisnumbGer.H}IfyouneedstillmorethenyoumusteditaprivqateGcopyofthis le,3 buteventhentherewillbGesomelimitthatyoucannotpass.ThenyouronlyGresortUUwillbGetochangeyourdoGcument.%O+G222wMultipageffFloats5SGL5ffA͉TU>'ExX's[ oatscannotbGesplitacrosspages.Sometimes,however,you[wanttohaveatableorG gurethatdoGesn't tononepage.Theeasiestwayistosplittheseintomultipletableor gureGenvironments,UUbutthishasanumbGerUUofundesirablee ects:!H+IWhereUUdoyousplitit?qThisisingeneralmoredicultfortablesthanfor gures.򍍍!H+IHowUUdoyoukeepthemtogether?!H+IY*ouUUdon'twantUUmorethanoneentryinthelistof gures/tables.GAlthoughUUtheseproblemsarenotfullysolvqableinallcases,hereareacoupleofsuggestions: ;G/N cmbx1222.17GTablesÌGF*or-tableslongerthanapageyoucanusethelongtablepackqage. Thispackqagede nesa Glongtableenvironmentthatisakindofamalgamationoftableandtabular.aIthasapprox-Gimatelythesamesyntaxasthetabularenvironment,2.butitaddssomefeaturesof table,likeGcaptions.LongtableswillbGeautomaticallysplitwhentheydon't tonthepage.AndtheywillGbGei"enteredinthelistoftableswhenacaptionisgiven.-Theywillnot oat,nhowever,andi"cannotGbGe4Zusedinsidea oatenvironment.fThis4Zcouldmeanthatanothertableenvironment,:which4ZwasG1ff J=w-:15LܿThereXusedtob'ExXcoulddecidetopGostponeGit"untilithascollectedsomemore oats.L ThiscanbGedoneeitherbymakingthe gurebigenoughG(e.g.qbyUUaddingsome\vspace),orbytweakingthe\floatpagefractionparameter.N8GIf cmmi10K`y cmr10ٓRcmr7Zcmr5< lcircle10O line10f`