/
The enumerate package David Carlisle  This le is maint The enumerate package David Carlisle  This le is maint

The enumerate package David Carlisle This le is maint - PDF document

test
test . @test
Follow
428 views
Uploaded On 2015-06-10

The enumerate package David Carlisle This le is maint - PPT Presentation

Bug reports can be opened category tools at httplatexprojectorgbugshtml Abstract This package gives the enumerate environment an optional argument which determines the style in which the counter is printed An occurrence of one of the tokens A a I i ID: 83832

Bug reports can

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "The enumerate package David Carlisle Th..." 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

TheenumeratepackageDavidCarlisle2015/07/23 This leismaintainedbytheLATEXProjectteam.Bugreportscanbeopened(categorytools)athttps://latex-project.org/bugs.html. AbstractThispackagegivestheenumerateenvironmentanoptionalargumentwhichdeterminesthestyleinwhichthecounterisprinted.AnoccurrenceofoneofthetokensAaIior1producesthevalueofthecounterprintedwith(respectively)\Alph\alph\Roman\romanor\arabic.TheselettersmaybesurroundedbyanystringsinvolvinganyotherTEXexpressions,howeverthetokensAaIi1mustbeinsidea{}groupiftheyarenottobetakenasspecial.1ExamplesEXi.oneoneoneoneoneoneoneoneoneoneoneoneEXii.twoexamplea)oneoftwooneoftwooneoftwoexampleb)twooftwoA-1oneA-2two\begin{enumerate}[EXi.]\itemoneoneoneoneoneoneoneoneoneoneone\label{LA}\itemtwo\begin{enumerate}[{example}a)]\itemoneoftwooneoftwooneoftwo\label{LB}\itemtwooftwo\end{enumerate}\end{enumerate}\begin{enumerate}[{A}-1]\itemone\label{LC}\itemtwo\end{enumerate}\labeland\refmaybeusedaswiththestandardenumerateenvironment.\refonlyproducesthecountervalue,notthewholelabel.\refprintsthevalue This lehasversionnumberv3.00,lastrevised2015/07/23.1 inthesamestyleas\item,asdeterminedbythepresenceofoneofthetokensAaIi1intheoptionalargument.Intheaboveexample\ref{LA},\ref{LB}and\ref{LC}produce`i',`iia'and`1'respectively.2Macros1h*packagei\@enlabInternaltokenregisterusedtobuildupthelabelcommandfromtheoptionalargument.2\newtoks\@enLab\@enQmarkThisjustexpandstoa`?'.\refwillproducethis,ifnocounterisprinted.3\def\@enQmark{?}Thenextfourmacrosbuildupthecommandthatwillprinttheitemlabel.Theyeachgobbleonetokenorgroupfromtheoptionalargument,andaddcorre-spondingtokenstotheregister\@enLab.Theyeachendwithacallto\@enloop,whichstartstheprocessingofthenexttoken.\@enLabelAddthecountertothelabel.#2willbeoneofthe`special'tokensAaIi1,andisthrownaway.#1willbeacommandlike\Roman.4\def\@enLabel#1#2{%5\edef\@enThe{\noexpand#1{\@enumctr}}%6\@enLab\expandafter{\the\@enLab\csnamethe\@enumctr\endcsname}%7\@enloop}\@enSpace\@enSp@ceAddaspacetothelabel.Thetrickybitistogobblethespacetoken,asyoucannotdothiswithamacroargument.8\def\@enSpace{\afterassignment\@enSp@ce\let\@tempa=}9\def\@enSp@ce{\@enLab\expandafter{\the\@enLab\space}\@enloop}\@enGroupAdda{}grouptothelabel.10\def\@enGroup#1{\@enLab\expandafter{\the\@enLab{#1}}\@enloop}\@enOtherAddanythingelsetothelabel11\def\@enOther#1{\@enLab\expandafter{\the\@enLab#1}\@enloop}\@enloop\@enloop@Thebodyofthemainloop.Eatingtokensthiswayinsteadofusing\@tforletsyouseespacesandallbraces.\@tforwouldtreataand{a}asspecial,butnot{{a}}.12\def\@enloop{\futurelet\@entemp\@enloop@}13\def\@enloop@{%14\ifxA\@entemp\def\@tempa{\@enLabel\Alph}\else15\ifxa\@entemp\def\@tempa{\@enLabel\alph}\else16\ifxi\@entemp\def\@tempa{\@enLabel\roman}\else17\ifxI\@entemp\def\@tempa{\@enLabel\Roman}\else18\ifx1\@entemp\def\@tempa{\@enLabel\arabic}\else19\ifx\@sptoken\@entemp\let\@tempa\@enSpace\else20\ifx\bgroup\@entemp\let\@tempa\@enGroup\else21\ifx\@enum@\@entemp\let\@tempa\@gobble\else22\let\@tempa\@enOther2 Hookforpossibleextensions23\@enhook24\fi\fi\fi\fi\fi\fi\fi\fiProcessthecurrenttoken,thenlookatthenext.25\@tempa}\@enhookHookforpossibleextensions.Somepackagesmaywanttoextendthenumberofspecialcharactersthatareassociatedwithcounterrepresentations.ThisfeaturewasrequestedtoenableRussianalphabeticcounting,buthereIgiveanexampleofafootnotesymbolcounter,triggeredby*.Toenableanewcountertypebasedonaletter,youjustneedtoaddanew\ifxclausebyanalogywiththecodeabove.Soforexampletomake*triggerfootnotesymbolcounting.apackageshoulddothefollowing.Initialisethehook,incasethepackageisloadedbeforeenumerate.\providecommand\@enhook{}Addtothehookanew\ifxclausethatassociates*withthe\fnsymbolcountercommand.\g@addto@macro\@enhook{%\ifx*\@entemp\def\@tempa{\@enLabel\fnsymbol}%\fi}Thiscodesequenceshouldworkwhetheritisloadedbeforeorafterthisenumeratepackage.Anynumberofnewcountertypesmaybeaddedinthisway.Atthispointwejustneedinitialisethehook,takingcarenottooverwriteanyde nitionsanotherpackagemayalreadyhaveadded.26\providecommand\@enhook{}\enumerateThenewenumerateenvironment.Thisisthe rsthalfoftheoriginalenumer-ateenvironment.Ifthereisanoptionalargument,call\@@enum@tode nethelabelcommands,otherwisecall\@enum@whichisthesecondhalfoftheoriginalde nition.27\def\enumerate{%28\ifnum\@enumdepth�3\@toodeep\else29\advance\@enumdepth\@ne30\edef\@enumctr{enum\romannumeral\the\@enumdepth}\fi31\@ifnextchar[{\@@enum@}{\@enum@}}\@@enum@Handletheoptionalargument..32\def\@@enum@[#1]{%Initialisetheloopwhichwillbreakaparttheoptionalargument.Thecommandtoprintthelabelisbuiltupin\@enlab.\@enThewillbeusedtode ne\theenumn.33\@enLab{}\let\@enThe\@enQmarkThe\@enum@belowisneverexpanded,itisusedtodetecttheendofthetokenlist.34\@enloop#1\@enum@3 Issueawarningifwedidnot ndoneofthe`special'tokens.35\ifx\@enThe\@enQmark\@warning{Thecounterwillnotbeprinted.%36^^J\space\@spaces\@spaces\@spacesThelabelis:\the\@enLab}\fiDe ne\labelenumnand\theenumn.37\expandafter\edef\csnamelabel\@enumctr\endcsname{\the\@enLab}%38\expandafter\let\csnamethe\@enumctr\endcsname\@enTheSetthecounterto7sothatwegetthewidthof`vii'ifromannumberingisinforcethenset\leftmarginn.tothewidthofthelabelplus\labelsep.39\csnamec@\@enumctr\endcsname740\expandafter\settowidth41\csnameleftmargin\romannumeral\@enumdepth\endcsname42{\the\@enLab\hspace{\labelsep}}%Finallycall\@enum@whichisthesecondhalfoftheoriginalde nition.43\@enum@}\@enum@Allthelistparametershavenowbeende ned,socall\list.Thisistakenstraightfromtheoriginalde nitionof\enumerate.44\def\@enum@{\list{\csnamelabel\@enumctr\endcsname}%45{\usecounter{\@enumctr}\def\makelabel##1{\hss\llap{##1}}}}46h=packagei4