; TeX output 1997.05.06:1041soDtGGcmr17Section7tnamereferencesinLdKGXQ cmr12AT[-E;gX!", cmsy10ͺSebastianRahrtz37 1996/07/22:ōINff cmbx12ContentsI"V cmbx101XIn9troQduction1I2XHistory(}1I3XUsageTandfron9tend롒3!čI1aLIntros3ductionIK`y cmr10Cross-referencingtoincludethe': cmti10namezofthesection,ratherthanjustthenum- IbGerorpage.+eThisworksbyrede ningsomeoftheinsideL5ffٓRcmr7A͉TU>'ExXmacros, WsoitisIvulnerableUUtofuturechanges.I2aLHistoryISebastian'Rahtz,forLouBurnard,March15th1994SPQR CERNJuly'1994LastImoGd.rSept.3th$MG,Sept.r19thSPQR$YApril11th1995SPQR(addedsectionIformatting%hoGok)April14th1995SPQR%z(compatibilitywithhypGerref)June22I1995UUSPQR(removedUUtypGeoutfromSectionformat)Ls1S! cmsy9h"ow cmss9pack9age#g i Ls2SߤN cmtt9\ProvidesPackage{nameref}[\filedate\spaceCross-referencingbynameofsection]Ls3S\RequirePackage{ifthen}XW*eMrede ne%'ExXcommand,whichuses\newlabel.qSigh!I41S\def\@writetocindents{%I42]\begingroupI43]\@for\@tempa:=-1,0,1,2,3\do{%I44f\immediate\write\@auxout{%I45p2\string\newlabel{tocindent\@tempa}{%I46yw^\csnamer@tocindent\@tempa\endcsname}{}{}}%I47]}%I48]\endgroup}IAddtotheunderlyingsectionheadingmacrossothattheynotethesectionname IforUUusebylabGel.XIfasectionheadingorthelikehasa\labelinit,*'weneedtoextractit,*'orIsubsequentUUproGcessingbreaks.qThisisdonebythelabGel-writingroutine.XFirstthenumbGeredsections.Whileweareaboutit,KKputinausefulsectionIformattingUUmacro.I49S\let\old@sect\@sect I50S\def\@sect#1#2#3#4#5#6[#7]#8{%I51XdD\def\@currentlabelname{#7}%I52XdD\old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{\Sectionformat{#8}{#2}}%I53S}IandUUnowtheunnumbGeredonesI54S\let\old@ssect\@ssect2 ?soI55S\def\@ssect#1#2#3#4#5{% I56XdD\def\@currentlabelname{#5}%I57XdD\old@ssect{#1}{#2}{#3}{#4}{\Sectionformat{#5}{#1}}%I58S}XPartsUUandchaptersaretreateddi erently*.qsigh.I59S\let\old@part\@partI60S\def\@part[#1]#2{%I61]\def\@currentlabelname{#1}%I62]\old@part[{#1}]{#2}%I63S}I64S\let\old@chapter\@chapterI65S\def\@chapter[#1]#2{%I66]\def\@currentlabelname{#1}%I67]\old@chapter[{#1}]{#2}%I68S}I69S\let\old@schapter\@schapterI70S\def\@schapter#1{%I71]\def\@currentlabelname{#1}%I72]\old@schapter{#1}%I73S}IW*eUUdefaultthelabGelandhypertextreferencetobeempty*.I74S\def\@currentlabelname{}I75S\def\@currentHref{}ISinceRthesecondpartofthepreservedreferencenowhasfourparts(numbGer,Spage, InameUUandhypGertextreference),weneedextrautilitymacros:I76S\long\def\@firstoffour#1#2#3#4{#1}I77S\long\def\@secondoffour#1#2#3#4{#2}I78S\long\def\@thirdoffour#1#2#3#4{#3}I79S\long\def\@fourthoffour#1#2#3#4{#4}IW*ejhavetorede ne\refand\pagereftoknowabGoutextrareferenceelements. IMakeUUthemrobust.I80S\def\T@ref#1{\expandafter\@setref\csnamer@#1\endcsname\@firstoffour{#1}}I81S\def\T@pageref#1{\expandafter\@setref\csnamer@#1\endcsnameI82}\\@secondoffour{#1}}I83S\def\ref{\protect\T@ref}I84S\def\pageref{\protect\T@pageref}!čI3aLUsageffandfrontendIAccessUUthe(third)namepartwith\nameref;I85S\def\T@nameref#1{\expandafter\@setref\csnamer@#1\endcsnameI86XdD\@thirdoffour{#1}}I87S\def\nameref{\protect\T@nameref}IAnUUextendedformwhichgivestitleandpagenumbGer.I88S\def\Nameref#1{`\nameref{#1}'onpage~\pageref{#1}}XTheUUdefaultfor\SectionformatI89S\def\Sectionformat#1#2{#1}3ՠsoIanUUexamplealternativeforBNCbGookUUforLouBurnard:I90S\def\LouSectionformat#1#2{% I91ap\ifnum#2=1I92kJ\if@twosideI93t\ifthenelse{\isodd{\thepage}}%I94~0{\raggedright}%I95~0{\raggedleft}%I96kJ\elseI97p2\raggedleftI98kJ\fiI99kJ#1\\[2pt]\rule{\columnwidth}{1.5pt}E100ap\elseE101f#1E102ap\fiE103S}E104Sh 5" cmmi9=pack9age#g i4 ;%