; TeX output 1997.01.23:0919so^*DtGGcmr17This7tpacqkageallowstheexpsortationofLdKGXQ cmr12AT[-E;gXRregisters,7tlikqecounters,rigidandrubbserlengths.!", cmsy10Jean-PierreDrucbSerte߆T cmtt12drucbert@onecert.fr&37 1996/09/20.!Kt : cmbx9Abstractэoo cmr9Thispac9k|rage-=Aacmr61ʕallowsyoutoexpAortorimportthev|raluesofvariousL5A TuAEX bregisterslik9ecountersandlengths(rigidorrubbAer). UThiscouldbeusefultobfabricate\compAosite"documen9tsortopasssomedatafromadocumen9ttobanotherTone.!čI!Nff cmbx121aLTheff"kAHff cmssbx10exppo\rtpackageIK`y cmr10This:packqageisdesignedtotransmitdataoftypGe !", cmsy10h#': cmti10c}'ounteri1Dorhlengthci*ڲfroma IL5ffٓRcmr7A͉TU>'ExXdoGcumenttoanother.%Y*oumustbGeawarethatthispackqagemustbGeusedIwith.extermec}'are.LThepassingofdataisdoneviaa le.Aw rstdoGcumentexp}'ortsItheUUdatabyinvokingthefollowingsequenceofcommands: $ߤN cmtt9\openexportL\closeexport\Export$b\ExportLength0߀H\PreciseExportLengthb% "5-:1LݿCopÎyright1̞EcXK cmsy8 *1996Xby LJean-PierreXDrucb'ExXcounter(i.e.oneofIthewellknowncounterschapter,section,...,equation,etc.),oracounteryouIhaveYdeclaredby\newcounter.TAlso,hlengthci(i2isthename(withoutCtheb}'ackslashc)IofaL5ffA͉TU>'ExXlengthlikeparskiporofalengthdeclaredby\newlength.EPInthe\im-IpGorting"document,=wewill ndacommand\Import{h le[iN}./The\ExportLengthIcommand;expGortsalengthexpressedinp}'oints ²(pt)whichsomefractionnaldigitsI(59isthemaximum),rwhile\PreciseExportLengthexpGortsthelengthexpressedIinasc}'aledpoints39units(sp,d 65536spmakeapGoint),d soitavoidspGossibleroundingIerrors.XIfGVyouwanttoexpGortallO߲thedimensions(lengths)describingthepagelayout, \ExportPageLayoutIjustusethe\ExportPageLayoutcommand.FInastandardway*,youshouldexpGortIonlythatintoagiven le,e whichshouldbGeimportedinthepreambleoftheIimpGortingkdocument.JThismethodallowstohavetwodoGcumentswithsimilarIpageUUlayouts.XThispackqageisveryusefulwhenassoGciatedwhichthe'm#R cmss10dvipastepackqage,}whichIallowsyoutopreparerectangularpagepiecesandto\paste"thesepagepiecesintoIyourpdoGcument.("V cmbx10W arning:OifasuchpastedpiecemoGdi esanimportedcounterIor&length,/youmusttakeaccountofthatalterationinthedoGcumentreceivingtheIpastedUUpiece.XThe#FdvipastepackqageisnotavqailablefromCT*AN#9archives,-Ibutdvipaste.texIis.G(Getuit(andtheaccompagning les),=copydvipaste.texintodvipaste.sty,Ithen\veditdvipaste.stytoreplace\lineby\@@line,'ExXdoGcument.6I)N cmbx121.1gFiguresandTablesuTIIn thecaseofa gureortablewhichis\pasted"thiswayintoadoGcumentwith$\xcaptionf$\xcaptiontIitsucaption,thisonewillnotbGepresentinthelistof guresortables.='AneasyIsolutionw0istousea\xcaptionf{hc}'aptionci'b}(or\xcaptiont{hc}'aptionci}foratable)Icommand.qTheseUUcommandswillincrementthe gureortablecounter.I1.2gInsertingseveralpagesuTISometimes,youowiilneedtoseparatelytypGesetseveralpagesofadoGcument.%2T*oac-Icomplish3that,:uyouprepareaseconddoGcumentcontainingonlythedesiredpages.IThisOseconddoGcumentwillneed,byexemple,somepackqagesnotusedinthemainIdoGcument{(oftenbecausetheyrequiretoomuch{resources).S~T*ogetcorrectlynum-IbGeredlnpages, gures,tables,notes,etc.,inthemaindoGcumentandinthesecondaryIdoGcument,=you7justhave7toexportthecorrespondingcountersfromthemaindoc-Iumentb}'efore`ktheinsertion,toimpGortthematthebeginningofthesecondaryIdoGcument,to[Oexportthemagain(vianother le)attheendofthesecondaryIdoGcument,zand@atleasttoimportthem(viathissecond le)after ͲtheinsertionIintoUUthemaindoGcument.4#DsobItwillcertainlybGenecessarytotransmitthepagecounter,cwhichisnamed b\page".DY*oumustthenadda\clearpagecommand*U cmssi10bGefore|stheexporta-btion.0ThisismandatoryonlyiftheexpGortedvaluemustbGeusedtonumberbthefpagewhichfollowstheexpGortation."DonotexpGortthepagecounterbto>6anauxiliarydoGcumentinwhichyouarecreatingpiecestobGe\pasted"bintoyourdoGcument(insuchanauxiliarydoGcument,ֈthe\pagecounter"bisUUinfactacounterofpiecestobGepasted.XThe ^insertionisonlylogical:youwillhavetodoitmanuallyintheprintedIpapGer@sheets,DDortousesoftware@toolsmanipulating.dvi les(e.g.jdvidvi,DDdvis-Ielect,|zandtdviconcat).ϹAtseriousproblemsubsists:hiftheyaresectionningcom-Imandsoand oatingelements(like guresandtables)withcaptionsinthesec-IondaryG2doGcument,Jwhattodotohaveacorrecttableofcontents,JacorrectlistofI guresSandtablesinthemaindoGcument?1ACsimilarproblemarisesforthebibli-Iography*.2You#justneedtoadd,WinthemaindoGcument,WattheinsertionpGoint,WaIcommand:\AddInputInAuxb\AddInputInAuxfhsecondary8cqdocumentrihZ.auxgIand8_sothe.aux leofthesecondarydoGcumentwillbeconsideredasanauxiliary I leo(of rstorsecondlevel)ofthemaindoGcument./ThismethoGdhasasmallIdrawback:Yif%youdeclarethemaindoGcumentasanexternaldoGcument(asde nedIby\thexr~packqage)ofthesecondarydoGcumentinordertobGeabletoreferenceIlabGels?ofthemaindocument(orofpartsofit)fromthesecondaryone,ϹyouwillIhaveUUtousetheoptionnalargumentinthecommand:b\externaldocument[hoptiannal8cqarg.riSf]fhmain#documentriMigb\externaldocument[hoptionnal8cqarg.riSf]fhpart#of-wmainH#hdocumentriwQgIelsethelabGelsinthemaindocument(orpartsofit)wouldbGeconsideredasde nedItwiceduringtheproGcessingofthesecondarydocument.Thishappensnotoften,IbutUUifyouhavethisproblem,thesolutionissimplebutnotevident.52dsoI2aLImplementationLs1S cmsy9h+ow cmss9pack9age#g iU3P\exportIFirst,UUwedeclarethe\exportwritechannel: ǍLs2S\newwrite\export L\openexportIThecommand\openexportannouncethebGeginningofasequenceofexportations IandUUopGensthe lewhichwillbeusedtocarrythedata:Ls3S\def\openexport#1{% Ls4S\typeout{^^JExportationsinto#1.xpt.^^J}%Ls5S\immediate\openout\export#1.xpt}Ub\closeexportIThecommand\closeexportterminatesasequenceofexpGortationsbyclosingthe I leUUandannouncing.qOpGeningandclosingare\immediate.Ls6S\def\closeexport{\immediate\closeout\export%Ls7ap\typeout{^^JEndofexportations.^^J}}U\ExportLengthIAndV=now,wtheexpGortingcommands.tT*oexportalengthinpoints,wweV=justuse I\theh<li length>andwriteitasanargumentofa\setlengthcommand.7MThiscom-Imand(SmaybGeusedforrigidandrubberlengths,1Sbecause\thegivestheshrinkingIandUUstretchingpartsofarubbGerlength.Ls8S\def\ExportLength#1{% Ls9S\typeout{Exportationoflength#1}%I10S\immediate\write\export{\string\setlength{\csname#1\endcsname}%I11ap{\the\csname#1\endcsname}}}UƲ\PreciseExportLengthIButforrigidlengths(forrubbGerones,youwouldlosetheskrinkingandstretching Iparts), youshouduse\PreciseExportLength,whichexpGortthelengthexpressedIinwscaledpGoints.اThetrickistouse\numberinplaceof\the,2andadding-spforIunits.I12S\def\PreciseExportLength#1{% I13S\typeout{Preciseexportationoflength#1}%I14S\immediate\write\export{\string\setlength{\csname#1\endcsname}%I15ap{\number\csname#1\endcsnamesp}}}U3P\ExportIExpGortingRacounterisrathertrivial,Musing\@arabictogetitsvqaluefromthe IinternalUUnameoftheL5ffA͉TU>'ExXcounter.I16S\def\Export#1{%I17S\typeout{Exportationofcounter#1}%I18S\immediate\write\export{\string\setcounter{#1}%I19ap{\@arabic\csnamec@#1\endcsname}}}U3P\ImportIImpGortingFthedataiseasy:openthe leforreading,Breadit:the\setcounter IandUU\setlengthcommandsareexecuted,thencloseit.I20S\def\Import#1{%I21S\typeout{^^JImportationsfrom#1.xpt^^J}%I22S\InputIfFileExists{#1.xpt}{\relax}{\relax}}U\xcaptionfINow,thentwocaptioncommands.kTheyincrementthe gureortablecounter, Ithencalltheinternalmacro\@xcaption.$W*eprovide\xcaptionifyouhaveIotherUUclassesof oats.I23S\def\xcaptionf{\refstepcounter{figure}\@dblarg{\@xcaption{figure}}}6<ՠso\xcaptiont ÍI24S\def\xcaptiont{\refstepcounter{table}\@dblarg{\@xcaption{table}}}H$\xcaptionI25S\def\xcaption#1{\refstepcounter{#1}\@dblarg{\@xcaption{#1}}}\@xcaptionI26S\long\def\@xcaption#1[#2]#3{\par\addcontentsline{\csname I27]ext@#1\endcsname}{#1}{\protect\numberline{\csnameI28]the#1\endcsname}{\ignorespaces#2}}%I29S% s,^^A\begingroupI30S% s,^^A\@parboxrestoreI31S% s,^^A\normalsizeI32S% s,^^A\@makecaption{\csnamefnum@#1\endcsname}{\ignorespaces#3}\parI33S% s,^^A\endgroupI34S}t\iprotected@writeIW*etneedthesetwotinternalmacrosfor\AddInputInAux.'TheyareslightymoGdi ed IcopiesUUofsimilarmacrosintheL5ffA͉TU>'ExXkernel. ÍI35S\def\iprotected@write#1#2#3{%I36p2\begingroupI37t\let\thepage\relaxI38t#2%I39t\let\protect\@unexpandable@protectI40t\edef\reserved@a{\immediate\write#1{#3}}%I41t\reserved@aI42p2\endgroupI43p2\if@nobreak\ifvmode\nobreak\fi\fiI44S}y\@inputx ÍI45S\def\@inputx#1{{\def\bibcite##1##2{\relax}\@input{#1}}} 6\AddInputInAuxIThisUUmacrowritean\@inputxofthegiven leintothe.aux le.I46S\def\AddInputInAux#1{% I47]\iprotected@write\@auxoutI48p2{%I49p2\let\label\@gobble\let\index\@gobble\let\glossary\@gobble}%I50p2{\string\@inputx{#1}%I51 }%I52ap}%t\ExportPageLayoutIThisFmacroisjustalistofexpGortationsofthelengthsde ningthepagelayout, IbGecauseUUitwouldbesoboringtotypeallthat! ÍI53S\def\ExportPageLayout{%I54S\PreciseExportLength{hsize}I55S\PreciseExportLength{vsize}I56S\PreciseExportLength{hoffset}I57S\PreciseExportLength{voffset}I58S\PreciseExportLength{linewidth}I59S\PreciseExportLength{columnwidth}I60S\PreciseExportLength{columnsep}I61S\PreciseExportLength{columnseprule}7IϠsoI62S\PreciseExportLength{parindent} I63S\PreciseExportLength{hoffset}I64S\PreciseExportLength{voffset}I65S\PreciseExportLength{oddsidemargin}I66S\PreciseExportLength{evensidemargin}I67S\PreciseExportLength{headheight}I68S\PreciseExportLength{headsep}I69S\PreciseExportLength{textheight}I70S\PreciseExportLength{textwidth}I71S\PreciseExportLength{paperheight}I72S\PreciseExportLength{paperwidth}I73S\PreciseExportLength{marginparsep}I74S\PreciseExportLength{marginparwidth}I75S\PreciseExportLength{marginparpush}I76S\PreciseExportLength{footskip}}I77S\endinput!čIIndexINumbGerswritteninitalicrefertothepagewherethecorrespondingentryisde- IscribGed,Dthe onesunderlinedtothecodelineofthede nition,DtheresttothecodeIlinesUUwheretheentryisused.ǍmmJSymCbKols I\@arabic}.΍}.}.}.}.}.}.}.}. 19I\@auxout}.΍}.}.}.}.}.}.}.}. 47I\@gobble}.΍}.}.}.}.}.}.}.}. 49I\@inputƈ}.΍}.}.}.}.}.}.}.}.}. 45I\@inputx}.΍}.}.}.}.}.}. T45 Tfe ?P,T50I\@makecaption- }.΍}.}.}.}. 32I\@unexpandable@protectg}.΍}.}.}.}.}.}.}.}.}.}.}. ]39I\@xcaption@0}.΍}. 23{25,T26Tfe ?|йAI\AddInputInAuxB}.΍}.}.ʚ/j cmti95,T46Tfe ?} BI\begingroup}.΍}.}.}.}. T29,T36I\bibcite}.΍}.}.}.}.}.}.}.}. 45|CI\closeexportYҍ}.΍}.}.}.}. j1,T6TfeI\closeoutl}.΍}.}.}.}.}.}.}.}. 6}VEI\endgroupl}.΍}.}.}.}.}. T33,T42I\Exportƈ}.΍}.}.}.}.}.}.}.}.ʚ1,T16Tfe ?ª\export 2 fe T,T5,6,10,14,18 Xª\ExportLength- }.΍}.}.}. j1,T8Tfeª\ExportPageLayout 2,T53Tfe ? ٍPGª\glossaryl}.΍}.}.}.}.}.}.}. 49}Iª\if@nobreak}.΍}.}.}.}.}.}. 43ª\ifvmode}.΍}.}.}.}.}.}.}.}. 43ª\immediate@0}.΍}.}.}.}.}.}. 5,T6,10,14,18,40ª\Importƈ}.΍}.}.}.}.}.}.}.}.}. 20 Οfe ?ª\indexP}.΍}.}.}.}.}.}.}.}.}.}. 49ª\InputIfFileExistsT}. 22ª\iprotected@write0350fe ?p,T47M,Lª\labelP}.΍}.}.}.}.}.}.}.}.}.}. 49W!Nª\newwritel}.΍}.}.}.}.}.}.}.}. 2ª\nobreak}.΍}.}.}.}.}.}.}.}. 43ª\numberƈ}.΍}.}.}.}.}.}.}.}.}. 15p*O