worksmathplayer

mathplayer  时间:2021-03-17  阅读:()
LATEXMLTheManualALATEXtoXML/HTML/MATHMLConverter;Version0.
8.
5BruceR.
MillerNovember17,2020iiContentsContentsiiiListofFiguresvii1Introduction12UsingLATEXML52.
1Conversion62.
2Postprocessing72.
3Splitting112.
4Sites112.
5IndividualFormula133Architecture153.
1latexmlarchitecture153.
2latexmlpostarchitecture184Customization194.
1LaTeXMLCustomization204.
1.
1Expansion204.
1.
2Digestion224.
1.
3Construction244.
1.
4DocumentModel274.
1.
5Rewriting284.
1.
6PackagesandOptions284.
1.
7Miscellaneous294.
2latexmlpostCustomization294.
2.
1XSLT304.
2.
2CSS305Mathematics335.
1MathDetails345.
1.
1InternalMathRepresentation345.
1.
2GrammaticalRoles36iiiivCONTENTS6Localization396.
1Numbering396.
2InputEncodings406.
3OutputEncodings406.
4Babel407Alignments417.
1TEXAlignments417.
2TabularHeaderHeuristics417.
3MathForks427.
4eqnarray437.
5AMSAlignments438Metadata458.
1RDFa459ToDo47ACommands51latexml51latexmlpost54latexmlmath62BBindings67CModules69LaTeXML69LaTeXML::Global70LaTeXML::Package71LaTeXML::MathParser97C.
1CommonModules99LaTeXML::Common::Config99LaTeXML::Common::Object113LaTeXML::Common::Color115LaTeXML::Common::Color::rgb116LaTeXML::Common::Color::hsb116LaTeXML::Common::Color::cmy116LaTeXML::Common::Color::cmyk116LaTeXML::Common::Color::gray116LaTeXML::Common::Color::Derived117LaTeXML::Common::Number117LaTeXML::Common::Float118LaTeXML::Common::Dimension118LaTeXML::Common::Glue119LaTeXML::Common::Font119LaTeXML::Common::Model120LaTeXML::Common::Model::DTD121CONTENTSvLaTeXML::Common::Model::RelaxNG121LaTeXML::Common::Error121C.
2CoreModules123LaTeXML::Core::State123LaTeXML::Core::Mouth126LaTeXML::Core::Gullet126LaTeXML::Core::Stomach129LaTeXML::Core::Document131LaTeXML::Core::Rewrite138LaTeXML::Core::Token138LaTeXML::Core::Tokens140LaTeXML::Core::Box140LaTeXML::Core::List141LaTeXML::Core::Comment141LaTeXML::Core::Whatsit141LaTeXML::Core::Alignment143LaTeXML::Core::KeyVals143LaTeXML::Core::MuDimension147LaTeXML::Core::MuGlue147LaTeXML::Core::Pair147LaTeXML::Core::PairList147LaTeXML::Core::Definition148LaTeXML::Core::Definition::CharDef149LaTeXML::Core::Definition::Conditional149LaTeXML::Core::Definition::Constructor149LaTeXML::Core::Definition::Expandable150LaTeXML::Core::Definition::Primitive150LaTeXML::Core::Definition::Register150LaTeXML::Core::Parameter151LaTeXML::Core::Parameters151C.
3UtilityModules152LaTeXML::Util::Pathname152LaTeXML::Util::WWW154LaTeXML::Util::Pack155C.
4PreprocessingModules156LaTeXML::Pre::BibTeX156C.
5PostprocessingModules157LaTeXML::Post157LaTeXML::Post::MathML157DSchema161D.
1ModuleLaTeXML161D.
2ModuleLaTeXML-common163D.
3ModuleLaTeXML-inline175D.
4ModuleLaTeXML-block179D.
5ModuleLaTeXML-misc186viCONTENTSD.
6ModuleLaTeXML-meta188D.
7ModuleLaTeXML-para192D.
8ModuleLaTeXML-math195D.
9ModuleLaTeXML-tabular202D.
10ModuleLaTeXML-picture204D.
11ModuleLaTeXML-structure210D.
12ModuleLaTeXML-bib226EErrorCodes235FCSSClasses239Index243ListofFigures3.
1FlowofdatathroughLATEXML'sdigestivetract.
16viiviiiLISTOFFIGURESChapter1IntroductionNote:SomeofthemoredetailedportionsofthismanualhavenotkeptuptodatewiththeevolutionofthecodeandstyleofLATEXML,butratherthandelayrelease,we'llimprovethedocumentationinalaterupdate.
Formany,LATEXisthepreferredformatfordocumentauthoring,particularlythoseinvolvingsignicantmathematicalcontentandwherequalitytypesettingisdesired.
Ontheotherhand,content-orientedXMLisanextremelyusefulrepresentationfordoc-uments,allowingthemtobeused,andreused,foravarietyofpurposes,notleast,presentationontheWeb.
Yet,thestyleandintentofLATEXmarkup,ascomparedtoXMLmarkup,nottomentionitsprogrammability,presentsdifcultiesinconvertingdocumentsfromtheformerformattothelatter.
Perhapsironically,thesedifcultiescanbeparticularlylargeformathematicalmaterial,wherethereisatendencyforthemarkuptofocusonappearanceratherthanmeaning.
ThechoiceofLATEXforauthoring,andXMLfordeliverywerenaturalanduncon-troversialchoicesfortheDigitalLibraryofMathematicalFunctions1.
Facedwiththeneedtoperformthisconversionandthelackofsuitabletoolstoperformit,theDLMFprojectproceededtodevelopthierowntool,LATEXML,forthispurpose.
DesignGoalsTheidealisticgoalsofLATEXMLare:FaithfulemulationofTEX'sbehaviour;Easilyextensible;Lossless,preservingbothsemanticandpresentationcues;UseanabstractLATEX-like,extensible,documenttype;1http://dlmf.
nist.
gov12CHAPTER1.
INTRODUCTIONInferthesemanticsofmathematicalcontent(GoodPresentationMATHML,eventuallyContentMATHMLandOpenMath).
Asthesegoalsarenotentirelypractical,evensomewhatcontradictory,theyareim-plicitlymodiedbyasmuchaspossible.
CompletelymimicingTEX's,andLATEX's,behaviourwouldseemtorequirethesneakiestmodicationstoTEX,itself;redeningLATEX'sinternalsdoesnotreallyguaranteecompatibility.
"Easeofuse"is,ofcourse,intheeyeofthebeholder;thismanualisanattempttomakeiteasier!
Moresignicantly,fewdocumentsarelikelytohavecompletelyunambiguousmathematicsmarkup;hu-manunderstandingofboththetopicandthesurroundingtextisneededtoproperlyinterpretanyparticularfragment.
Thus,whilewe'lltrytoprovidea"turn-key"so-lutionthatdoesthe'RightThing'automatically,weexpectthatapplicationsrequir-inghighsemanticcontentwillrequiredocument-specicdeclarationsandtuningtoachievethedesiredresult.
Towardsthisend,weprovideavarietyofmeanstocus-tomizetheprocessinganddeclaretheauthor'sintent.
Atthesametime,especiallyfornewdocuments,weencourageamorelogical,content-orientedmarkupstyle,overapurelypresentation-orientedstyle.
OverviewofthisManualChapter2describestheusageofLATEXML,alongwithcommonusecasesandtechniques.
Chapter3describesthesystemarchitectureinsomedetail.
Strategiesforcustomizationandimplementationofnewpackagesisde-scribedinChapter4.
Thespecialconsiderationsformathematics,includingdetailsofrepresentationandhowtoimprovetheconversion,arecoveredinChapter5.
Severalspecializedtopicsarecoveredintheremainingchapters.
AnoverviewofoutstandingissuesandplannedfutureimprovementsaregiveninChapter9.
Finally,theAppendicesgivedetaileddocumentationthesystemcomponents:Ap-pendixAdescribesthecommand-lineprogramsprovidedbythesystem;AppendixBliststheLATEXstylepackagesforwhichwe'veprovidedLATEXML-specicbindings.
AppendixCdescribesthevariousPerlmodules,ingroups,thatcomprisethesys-tem.
AppendixDdescribestheXMLschemausedbyLATEXML.
AppendixEgivesanoverviewofthewarninganderrormessagesthatLATEXMLmaygenerate.
AppendixFdescribesthestrategyandnamingconventionsusedforCSSstylingoftheresultingHTML.
UsingLATEXML,andprogrammingforit,canbesomewhatconfusingasoneisdeal-ingwithseverallanguagesnotnormallycombined,oftenwithinthesamele,—Perl,TEXandXML(alongwithXSLT,HTML,CSS),plustheoccasionalshellprogrammming.
Tohelpvisuallydistinguishdifferentcontextsinthismanualwewillput'program-ming'orientedmaterial(Perl,TEX)inatypewriterfont,likethis;XMLmaterialwillbeputinasans-seriffacelikethis.
Ifyouencounterdifculties,thereisasupportmailinglistatlatexml-project2.
BugsandenhancementrequestscanbereportedatGithub3.
Ifallelsefails,please2http://lists.
informatik.
uni-erlangen.
de/mailman/listinfo/latexml3https://github.
com/brucemiller/LaTeXML3consultthesourcecode,ortheauthor.
Danger!
Whenyouseethissign,bewarnedthatthematerialpresentedissomewhatadvancedandmaynotmakemuchsenseuntilyouhavedabbledquiteabitinLATEXML'sinternals.
Suchadvancedor'dangerous'materialwillbepresentedlikethisparagraphtomakeiteasiertoskipover.
4CHAPTER1.
INTRODUCTIONChapter2UsingLATEXMLThemaincommandsprovidedbytheLATEXMLsystemarelatexmlforconvertingTEXandBIBTEXsourcestoXML.
latexmlpostforvariouspostprocessingtasksincludingconversiontoHTML,pro-cessingimages,conversiontoMATHMLandsoon.
Theusageofthesecommandscanbeassimpleaslatexmlcdoc.
tex--dest=doc.
htmltoconvertasingledocumentintoHTML5document,OrifyouwanttoexaminetheXML,forsomereason(Iusuallydo)latexml--dest=doc.
xmldoc;latexmlpostdoc--dest=doc.
htmlOrcanbeascomplicatedas#Conversionlatexml--dest=main.
xmlmain.
texlatexml--dest=A.
xmlA.
.
.
#Scanlatexmlpost--prescan--db=my.
db--dest=/site/main.
htmlmainlatexmlpost--prescan--db=my.
db--dest=/site/A.
htmlA.
.
.
#Paginationlatexmlpost--noscan--db=my.
db--dest=/site/main.
htmlmainlatexmlpost--noscan--db=my.
db--dest=/site/A.
htmlA.
.
.
toconvertawholesetofdocuments,includingabibliography,intoacompleteinter-connectedsite.
See2.
4fordetails.
Howbesttousethecommandsdepends,ofcourse,onwhatyouaretryingtoachieve.
Inthenextsection,we'lldescribetheuseoflatexml,whichperformsthe56CHAPTER2.
USINGLATEXMLconversiontoXML.
Thefollowingsectionsconsiderasequenceofsuccessivelymorecomplicatedpostprocessingsituations,usinglatexmlpost,bywhichoneormoreTEXsourcescanbeconvertedintooneormorewebdocumentsoracompletesite.
Additionally,thereisaconveniencecommandlatexmlmathforconvertingin-dividualformulaintovariousformats.
2.
1BasicXMLConversionThecommandlatexml{options}--destination=doc.
xmldocconvertstheTEXdocumentdoc.
tex,orstandardinputif-isusedinplaceofthele-name,toXML.
Itloadsanyrequireddenitionbindings(seebelow),reads,tokenizes,expandsanddigeststhedocumentcreatinganXMLstructure.
Itthenperformssomedocumentrewriting,parsesthemathematicalcontentandwritestheresult,inthiscase,todoc.
xml;ifno--destinationissuppplied,itwritestheresulttostandardout-put.
Fordetailsontheprocessing,seeChapter3,andChapter5formoreinformationaboutmathparsing.
BIBTEXprocessingIfthesourcelehasanexplicitextensionof.
bib,orifthe--bibtexoptionisused,thesourcewillbetreatedasaBIBTEXdatabase.
See2.
2forhowBIBTEXlesareincludedinthenaloutput.
NotethatthetimingisdifferentthanwithBIBTEXandLATEX.
Normally,BIBTEXsimplyselectsandformatsasubsetofthebibliographicentriesaccord-ingtothe.
auxle;allTEXexpansionandprocessingiscarriedoutonlywhentheresultisincludedinthemainLATEXdocument.
Incontrast,latexmlprocessesandexpandstheentirebibliography,includinganyTEXmarkupwithinit,whenitisconvertedtoXML;theselectionofentriesisdoneduringpostprocessing.
Oneimpli-cationisthatlatexmldoesnotknowaboutpackagesincludedinthemaindocument;ifthebibliographyusesmacrosdenedinsuchpackages,thepackagesmustbeexplicitlyspeciedusingthe--preloadoption.
UsefulOptionsThenumberanddetailofprogressanddebuggingmessagesprintedduringprocessingcanbecontrolledusing--verboseor--quietTheycanberepeatedtogetevenmoreorfewerdetails.
Directoriestosearch(inadditiontotheworkingdirectory)forvariouslescanbespeciedusing--path={directory}Thisoptioncanberepeated.
Whenevermultiplesourcesarebeingused(includingmultiplebibliographies),theoption2.
2.
POSTPROCESSING7--documentid=idshouldbeusedtoprovideauniqueIDforthedocumentrootelement.
ThisIDisusedasthebaseforid'softhechild-elementswithinthedocument,sothattheyareunique,aswell.
Seethedocumentationforthecommandlatexmlforlesscommonoptions.
LoadingBindingsAlthoughLATEXMLisreasonablyadeptatprocessingTEXmacros,itgenerallybenetsfromhavingitsownimplementationofthemacros,primitives,environmentsandothercontrolsequencesappearinginadocumentbecausethesearewhatdenethemappingintoXML.
TheLATEXML-analogueofastyleorclasslewecallaLATEXML-bindingle,orbindingforshort;theseleshaveanadditionalextension.
ltxml.
Infact,sincestylelesoftenbypassstructurallyorsemanticallymeaningfulmacrosbydirectlyinvokingmacrosinternaltoLATEX,LATEXMLactuallyavoidsprocessingstyleleswhenabindingisunavailable.
Theoption--includestylescanbeusedtooverridethisbehaviourandallowLATEXMLto(attemptto)processrawstyleles.
[Amoreselective,per-le,optionmaybedevelopedinthefuture,ifthereissufcientdemand—pleaseprovideusecases.
]LATEXMLalwaysstartswiththeTeX.
poolbindingloaded,andifLATEX-speciccommandsarerecognized,LaTeX.
poolaswell.
Anyinputdirectiveswithinthesourceloadstheappropriatebinding.
Forexample,\documentclass{article}or\usepackage{graphicx}willloadthebindingsarticle.
cls.
ltxmlorgraphicx.
sty.
ltxml,respectively;theobsoletedirective\documentstyleisalsorecognized.
An\inputdirectivewillsearchforleswithboth.
texand.
styextensions;itwillpreferabindingleifoneisfound,butwillloadanddigesta.
texifnobindingisfound.
An\includedirective(andrelatedones)searchonlyfora.
texle,whichisprocessedanddigestedasusual.
Therearetwomechanismsforcustomization:adocument-specicbindingledoc.
latexmlwillbeloaded,ifpresent;theoption--preload=bindingwillloadthebindinglebinding.
ltxml.
The--preloadoptioncanberepeated;bothkindsofpreloadareloadedbeforedocumentprocessing,andareprocessedinorder.
SeeChapter4fordetailsaboutwhatcangointhesebindings;andAppendixBforalistofbindingscurrentlyincludedinthedistribution.
2.
2BasicPostprocessingInthesimplestsituation,youhaveasingleTEXsourcedocumentfromwhichyouwanttogenerateasingleoutputdocument.
Thecommandlatexmlpostoptions--destination=doc.
htmldoc8CHAPTER2.
USINGLATEXMLorsimilarlywith--destination=doc.
html4,--destination=doc.
xhtml,willcarryoutasetofappropriatetransformationsinsequence:scanningoflabelsandids;llingintheindexandbibliography(ifneeded);cross-referencing;conversionofmath;conversionofgraphicsandpictureenvironmentstowebformat(png);applyinganXSLTstylesheet.
Theoutputformataffectsthedefaultsforeachstep,andparticularly,theXSLTstylesheetthatisused,andisdeterminedbytheleextensionof--destination,orbytheoption--format=(html|html5|html4|xhtml|xml)whichoverridestheextensionusedinthedestination.
Therecognizedformatsare:htmlorhtml5mathisconvertedtoPresentationMATHML,some'vector'stylegraphicsareconvertedtoSVG,othergraphicsareconvertedtoimages;LaTeXML-html5.
xsltisused.
Theleextensionhtmlisgenerateshtml5html4bothmathandgraphicsareconvertedtopngimages;LaTeXML-html4.
xsltisused.
xhtmlmathisconvertedtoPresentationMATHML,othergraphicsareconvertedtoimages;LaTeXML-xhtml.
xsltisused.
xmlnomath,graphicsorXSLTconversioniscarriedout.
Ofcourse,alloftheseconversionscanbecontrolledoroverriddenbyexplicitoptionsdescribedbelow.
Formoredetailsaboutlesscommonoptions,seethecommanddoc-umentationlatexmlpost,aswellasAppendixC.
5.
ScanningThescanningstepcollectsinformationaboutalllabels,ids,indexingcom-mands,cross-referencesandsoon,tobeusedinthefollowingpostprocessingstages.
IndexingAnindexisbuiltfrom\indexmarkup,ifmakeidx's\printindexcommandhasbeenused,butthiscanbedisabledby--noindexTheindexentriescanbepermutedwiththeoption--permutedindexThus\index{terma!
termb}alsoshowsupas\index{termb!
terma}.
Thisleadstoamorecomplete,butpossiblyrathersilly,index,dependingonhowthetermshavebeenwritten.
2.
2.
POSTPROCESSING9BibliographyWhenadocumentcontainsarequestforbibliographies,typicallyduetothe\bibliography{.
.
}command,thepostprocessorwilllookforthenamedbibliographies.
Itrstlooksforpreconvertedbibliographieswiththeexten-tion.
bib.
xml,otherwiseitwilllookfor.
bibandconvertitinternally(thelatterisasomewhatexperimentalfeature).
Ifyouwanttooverridethatsearch,forexampleusingabibliographywithadiffer-entname,youcansupplythatlenameusingtheoption--bibliography=bibfile.
bib.
xmlNotethattheinternalbibliographylistwillthenbeignored.
Thebibliographywouldhavetypicallybeenproducedbyrunninglatexml--dest=bibfile.
bib.
xmlbibfile.
bibNotethattheXMLle,bible,isnotusedtodirectlyproduceanHTML-formattedbibli-ography,ratheritisusedtollinthe\bibliography{.
.
}withinaTEXdocument.
Cross-ReferencingInthisstage,thescannedinformationisusedtollinthetextandlinksofcross-referenceswithinthedocument.
Theoption--urlstyle=(server|negotiated|file)cancontroltheformatofurlswiththedocument.
serverformatsurlsappropriateforusefromawebserver.
Inparticular,trailingindex.
htmlareomitted.
(default)negotiatedformatsurlsappropriateforusebyaserverthatimplementscontentnego-tiation.
Fileextensionsforhtmlandxhtmlareomitted.
Thisenablesyoutosetupaserverthatservestheappropriateformatdependingonthebrowserbeingused.
leformatsurlsexplicitly,withfulllenameandextension.
Thisallowsthelestobebrowsedfromthelocallesystem.
MathConversionSpecicconversionsofthemathematicscanberequestedusingtheoptions--mathimages#convertsmathtopngimages,--presentationmathmlor--pmml#createsPresentationMATHML--contentmathmlor--cmml#createsContentMATHML--openmathor--om#createsOpenMath--keepXMath#preservesLATEXML'sXMath(Eachoftheseoptionscanalsobenegatedifneeded,eg.
--nomathimages)ItmustbepointedoutthattheContentMATHMLandOpenMathconversionsarecurrentlyratherexperimental.
Ifmorethanoneoftheseconversionsarerequested,parallelmathmarkupwillbegeneratedwiththerstformatbeingtheprimaryone,andtheadditionalonesaddedassecondaryformats.
Thesecondaryformatisincorporatedusingwhatevermeans10CHAPTER2.
USINGLATEXMLtheprimaryformatuses;eg.
MATHMLcombinesformatsusingm:semanticsandm:annotation-xml.
Giventhestateofcurrentbrowsers,youmaywishtouseapolyllsuchasMathJax1tosupportMathMLonmoreplatforms.
Seetheexamplein2.
2foronewaytodoit.
GraphicsprocessingConversionofgraphics(eg.
fromthegraphic(s|x)pack-ages'\includegraphics)canbeenabledordisabledusing--graphicsimagesor--nographicsimagesSimilarly,theconversionofpictureenvironmentscanbecontrolledwith--pictureimagesor--nopictureimagesAnexperimentalcapabilityforconvertingthelattertoSVGcanbecontrolledby--svgor--nosvgStylesheetsandJavascriptIfyouwishtorestylethegeneratedHTMLeitherbyaddingCSSorbycustomizingtheXSLT,changeitsfunctionalitybyaddingjavascript,orevengenerateanalternativeoutputformatwithXSLT,somecombinationofthefol-lowingoptionswillbeuseful.
--nodefaultresources#Omitsthedefaultresources(css.
.
)--css=stylesheet.
css#AddsanewCSSstylesheet--javascript=program.
js#AddsaJavascript--stylesheet=stylesheet.
xsl#UsesanalternativeXSLTstylesheet--xsltparameter=name:value#SetsanXSLTparameterAllbut--stylesheetcanberepeatedtoincludemultiplelesorsetmultipleparam-eters.
WhenalocalCSSorjavascriptleisincluded,itwillbecopiedtothedestinationdirectory,butotherwiseurlsareaccepted.
ThecoreCSSstylesheet,LaTeXML.
css,alongwithcertainstylesorclasses(article,report,book,amsart)whichaddstylesheetsautomatically,helpsmatchthestylingofLATEXtoHTML.
Youcanalsorequesttheinclusionofyourownstylesheetsfromthecommandlineusing--cssoption.
SomesampleCSSenhance-mentsareincludedwiththedistribution:LaTeXML-navbar-left.
cssPlacesanavigationbarontheleft.
LaTeXML-navbar-right.
cssPlacesanavigationbarontheleft.
LaTeXML-blue.
cssColorsvariousfeaturesinasoftblue.
IncaseswhereyouwishtocompletelymanagetheCSStheoption--nodefaultcsscausesonlyexplicitlyrequested(command-line)csslestobeincluded.
JavascriptlesareincludedinthegeneratedHTMLbyusingthe--javascriptoption.
ThedistributionincludesasampleLaTeXML-maybeMathjax.
jswhichisusefulforsupportingMathML:itinvokesMathJax2torenderthemathematicsinbrowserswithoutnativesupportforMathML.
1http://mathjax.
org/2http://mathjax.
org2.
3.
SPLITTING11--javascript=LaTeXML-maybeMathJax.
jsTheoptioncanalsoreferencearemotescript;forexampletoinvokeMathJaxuncon-ditionallyfromthe'cloud':latexmlpost--format=html5\--javascript='https://cdnjs.
cloudflare.
com/ajax/libs/mathjax/2.
7.
2/MathJax.
jsconfig=MML_CH--destination=somewhere/doc.
htmldocSee4.
2.
2formoreinformationondevelopingyourownstylesheets.
TodevelopCSSandXSLTstylesheets,aknowledgeoftheLATEXMLdocumenttypeisalsoneces-sary;seeAppendixD.
IndividualXSLTstylesheetsmayhaveparametersthatcancustomizetheconversionfromLATEXML'sXMLtothetargetformat.
Anobscureexampleis--xsltparameter=SIMPLIFY_HTML:truewhichcausesa'simpler'HTMLtobegenerated.
Generally,LATEXML'sHTMLreliesonCSStorecreatetheappearanceofmanyfeaturesofLATEX,butthissometimesresultsinsomewhatconvolutedHTMLthatmaynotbeidealinsituationswhereCSSisnotavailable.
Thisparameter'dumbsdown'itemizationsandenumerationsbyignoringanycustomitemlabelsornumbers.
2.
3SplittingtheOutputForlargerdocuments,itisoftendesirabletobreaktheresultintoseveralinterlinkedpages.
Thissplit,carriedoutbeforescanning,isrequestedby--splitat=levelwherelevelisoneofchapter,section,subsection,orsubsubsection.
Forexample,sectionwouldsplitthedocumentintochapters(ifany)andsections,alongwithseparatebibliography,indexandanyappendices.
(Seealso--splitxpathinlatexml.
)TheremoveddocumentnodesarereplacedbyaTableofContents.
Theextralesarenamedusingeithertheidorlabeloftherootnodeofeachnewpagedocumentaccordingto--splitnaming=(id|idrelative|label|labelrelative)Therelativefomscreateshorternamesinsubdirectoriesforeachlevelofsplitting.
(Seealso--urlstyleand--documentidinlatexml.
)Additionally,theindexandbibliographycanbesplitintoseparatepagesaccordingtotheinitialletterofentriesbyusingtheoptions--splitindexand--splitbibliography2.
4SiteprocessingAmorecomplicatedsituationcombinesseveralTEXsourcesintoasingleinterlinkedsiteconsistingofmultiplepagesandacompositeindexandbibliography.
12CHAPTER2.
USINGLATEXMLConversionFirst,allTEXsourcesmustbeconvertedtoXML,usinglatexml.
Sinceeverytarget-ableelementinalllestobecombinedmusthaveauniqueidenti-er,itisusefultoprexeachidentierwithauniquevalueforeachle.
Thelatexmloption--documentid=idprovidesthis.
ScanningSecondly,allXMLlesmustbesplitandscannedusingthecommandlatexmlpost--prescan--dbfile=DB--dest=i.
htmliwhereDBnamesaleinwhichtostorethescanneddata.
Otherconversions,includingwritingtheoutputle,areskippedinthisprescanningstep.
PaginationFinally,allXMLlesarecross-referencedandconvertedintothenalfor-matusingthecommandlatexmlpost--noscan--dbfile=DB--dest=i.
htmliwhichskipstheunnecessaryscanningstep.
Forexample,considerasetofnominallystand-aloneLATEXdocuments:main(withtitlepage,\tableofcontents,etc),A(withachapter),Aa(withasec-tion),B(withachapter),.
.
.
andbib(witha\bibliography).
Assumethatthedocumentsuse\lxDocumentIDfrom\usepackage{latexml}todeclareidsmain,main.
A,\main.
A.
a,main.
B,.
.
.
bib,respectively.
And,ofcourse,you'llhavetoarrangeforappropriatecounterstobeinitializedappropriately,ifneeded.
Now,processingthedocumentswiththefollowingcommands#Conversionlatexml--dest=main.
xmlmain.
texlatexml--dest=A.
xmlAlatexml--dest=Aa.
xmlAalatexml--dest=B.
xmlB.
.
.
latexml--dest=bib.
xmlbib#Scanlatexmlpost--prescan--db=my.
db--dest=/site/main.
htmlmainlatexmlpost--prescan--db=my.
db--dest=/site/A.
htmlAlatexmlpost--prescan--db=my.
db--dest=/site/Aa.
htmlAalatexmlpost--prescan--db=my.
db--dest=/site/B.
htmlB.
.
.
latexmlpost--prescan--db=my.
db--dest=bib.
htmlbib#Paginationlatexmlpost--noscan--db=my.
db--dest=/site/main.
htmlmainlatexmlpost--noscan--db=my.
db--dest=/site/A.
htmlAlatexmlpost--noscan--db=my.
db--dest=/site/Aa.
htmlAalatexmlpost--noscan--db=my.
db--dest=/site/B.
htmlB.
.
.
latexmlpost--noscan--db=my.
db--dest=bib.
htmlbib2.
5.
INDIVIDUALFORMULA13Thiswillresultinasitebuiltat/site/,withthefollowingimpliedstructure:main.
htmlA.
htmlAa.
htmlB.
html.
.
.
bib.
html2.
5IndividualFormulaForcaseswhereyou'djustliketoconvertasingleformulato,say,MATHML,anddon'tmindtheoverhead,we'vecombinedthepre-andpost-processingintoasingle,handy,commandlatexmlmath.
Forexample,latexmlmath--pmml=-\\frac{b\\pm\\sqrt{b2-4ac}}{2a}willprinttheMATHMLtostandardoutput.
Toconverttheformulatoapngimage,sayquad.
png,usetheoption--mathimage=quad.
png.
NotethatthisinvolvesputtingTEXcodeonthecommandline.
You'vegotto'slashify'yourcodeinwhateverwayisnecessarysothatafteryourshellisnishedwithit,thestringthatispassedtolatexmlmathseesisnormalTEX.
Intheexampleabove,inmostunix-likeshells,weonlyneededtodouble-upthebackslashes.
14CHAPTER2.
USINGLATEXMLChapter3ArchitectureAshasbeensaid,LATEXMLconsistsoftwomainprograms:latexmlresponsibleforconvertingtheTEXsourceintoXML;andlatexmlpostresponsibleforconvertingtotargetformats.
SeeFigure3.
1forillustration.
Thecasualuserneedsonlyasupercialunderstandingofthearchitecture.
TheprogrammerwhowantstoextendorcustomizeLATEXMLwill,however,needafairlygoodunderstandingoftheprocessandthedistinctionsbetweentext,Tokens,Boxes,WhatsitsandXML,ontheonehand,andMacros,PrimitivesandConstructors,ontheother.
Inaway,theimplementerofaLATEXMLbindingforaLATEXpackagemayneedabetterunderstandingthanwhenimplementingforLATEXsincetheyhavetounderstandnotonlytheTEX-view,primarilyjustthemacrosandtheintendedappearance,butalsotheLATEXML-view,withXMLandrepresentationquestions,awwell.
Theintentionisthatallsemanticsoftheoriginaldocumentispreservedbylatexml,oreveninferredbyparsing;latexmlpostisforformattingandconver-sion.
Dependingonyourneeds,theLATEXMLdocumentresultingfromlatexmlmaybesufcient.
Alternatively,youmaywanttoenhancethedocumentbyapplyingthirdpartyprogramsbeforepostprocessing.
3.
1latexmlarchitectureLikeTEX,latexmlisdata-driven:thetextandexecutablecontrolsequences(ie.
macrosandprimitives)inthesourcele(andanypackagesloaded)directtheprocessing.
ForLATEXML,theuserexertscontrolovertheconversion,andcustomizesit,byprovidingalternativebindingsofthecontrolsequencesandpackages,bydeclar-ingpropertiesofthedesireddocumentstructure,andbydeningrewriterulestobeappliedtotheconstructeddocumenttree.
Thetop-levelclass,LaTeXML,managestheprocessing,providingseveralmeth-odsforconvertingaTEXdocumentorstringintoanXMLdocument,withvaryingdegreesofpostprocessingandwritingthedocumenttole.
Itbindsa(LaTeXML::Core::)Stateobject(to$STATE)tomaintainthecurrentstateofbindingsforcon-trolsequencedenitionsandemulatesTEX'sscopingrules.
Theprocessingisbroken1516CHAPTER3.
ARCHITECTUREFigure3.
1:FlowofdatathroughLATEXML'sdigestivetract.
intothefollowingstagesDigestiontheTEX-likedigestionphasewhichconvertstheinputintoboxes.
ConstructionconvertstheresultingboxesintoanXMLDOM.
RewritingappliesrewriterulestomodifytheDOM.
MathParsingparsesthetokenizedmathematics.
SerializationconvertstheXMLDOMtoastring,orwritestole.
DigestionDigestioniscarriedoutprimarilyinapullmode:The(LaTeXML::Core::)Stomachpullsexpanded(LaTeXML::Core::)Tokensfromthe(LaTeXML::Core::)Gullet,whichitselfpullsTokensfromthe(LaTeXML::Core::)Mouth.
TheMouthconvertscharactersfromtheplaintextinputintoTokensaccordingtothecurrentcatcodes(categorycodes)assignedtothem(as3.
1.
LATEXMLARCHITECTURE17boundintheState).
TheGulletisresponsibleforexpandingMacros,thatis,controlsequencescurrentlyboundto(LaTeXML::Core::Definition::)Expandablesandforparsingsequencesoftokensintocommoncoredatatypes((LaTeXML::Common::)Number,(LaTeXML::Common::)Dimension,etc.
).
See4.
1.
1forhowtodenemacrosandaffectexpansion.
TheStomachthendigeststhesetokensbyexecuting(LaTeXML::Core::Definition::)Primitivecontrolsequences,usuallyforsideeffect,butof-tenforconvertingmaterialinto(LaTeXML::Core::)Listsof(LaTeXML::Core::)Boxesand(LaTeXML::Core::)Whatsits(AMacroshouldneverdi-gest).
Normally,textualtokensareconvertedtoBoxesinthecurrentfont.
Themain(intentional)deviationofLATEXML'sdigestionfromthatofTEXistheintro-ductionofanewtypeofdenition,a(LaTeXML::Core::Definition::)Constructor,responsibleforconstructingXMLfragments.
AcontrolsequenceboundtoConstructorisdigestedbyreadingandprocessingitsargumentsandwrappingtheseupinaWhatsit.
Before-andafter-daemons,essentiallyanonymousprimitives,associatedwiththeConstructorareexecutedbeforeandafterdigestingtheConstructorarguments'markup,whichcanaffectthecontextofthatdigestion,aswellasaugmentingtheWhatsitwithadditionalproperties.
See4.
1.
2forhowtodeneprimitivesandaffectdigestion.
ConstructionGiventheListofBoxesandWhatsits,weproceedtoconstructinganXMLdocument.
Thisconsistsofcreatingan(LaTeXML::Core::)Documentobject,containingalibxml2document,XML::LibXML::Document,andhavingitabsorbthedigestedmaterial.
AbsorbingaBoxconvertsittotextcontent,withpro-visionmadetotrackandsetthecurrentfont.
AWhatsitisabsorbedbyinvokingtheassociatedConstructortoinsertanappropriateXMLfragment,includingelementsandattributes,andrecursivelyprocessingtheirargumentsasnecessarySee4.
1.
3forhowtodeneconstructors.
A(LaTeXML::Common::)Modelismaintainedthrougoutthedigestionphasewhichaccumulatesanydocumentmodeldeclarations,inparticularthedocumenttype(RelaxNGispreferred,butDTDisalsosupported).
AsLATEXmarkupismorelikeSGMLthanXML,additionaldeclarationsmaybeused(seeTagin(LaTeXML::)Package)toindicatewhichelementsmaybeautomaticallyopenedorclosedwhenneededtobuildadocumenttreethatmatchesthedocumenttype.
Asanexample,awillautomaticallbeclosedwhenaisbegun.
Additionally,extrabitsofcodecanbeexecutedwheneverparticularlyelementsareopennedorclosed(alsospeciedbyTag).
See4.
1.
4forhowtoaffecttheschema.
RewritingOncethebasicdocumentisconstructed,(LaTeXML::Core::)Rewriterulesareappliedwhichcanperformvariousfunctions.
Ligaturesandcombiningmathematicsdigitsandletters(incertainfonts)intocompositemathtokensarehandledthisway.
Additionally,declarationsofthetypeorgrammaticalroleofmathtokenscanbeappliedhereSee4.
1.
5forhowtodenerewriterules.
18CHAPTER3.
ARCHITECTUREMathParsingAfterrewriting,agrammarbasedparserisappliedtothemathematicalnodesinordertoinfer,atleast,thestructureoftheexpressions,ifnotthemeaning.
Mathematicsparsing,andhowtocontrolit,iscoveredindetailinChapter5.
SerializationHere,wesimpleconverttheDOMintostringform,andoutputit.
3.
2latexmlpostarchitectureLATEXML'spostprocessorisprimarilyforformatconversion.
Itoperatesbyapplyingasequenceofltersresponsiblefortransformingorsplittingdocuments,ortheirparts,fromoneformattoanother.
Exactlywhichpostprocessingltermodulesareapplieddependsonthecommand-lineoptionstolatexmlpost.
Postprocessingltermodulesaregenerallyappliedinthefollowingorder:Splitsplitsthedocumentintoseveral'page'documents,accordingto--splitor--splitxpathoptions.
ScanscansthedocumentforallID's,labelsandcross-references.
Thisdatamaybestoredinanexternaldatabase,dependingonthe--dboption.
MakeIndexllsintheindexelement(duetoa\printindex)withmaterialgener-atedbyindex.
MakeBibliographyllsinthebibliographyelement(from\bibliography)withmaterialextractedfromthelespeciedbythe--bibilographyoption,forall\cite'ditems.
CrossRefestablishesallcross-referencesbetweendocumentsandpartsthereof,llinginthereferenceswithappropriatetextforthehyperlink.
MathImages,MathML,OpenMathperformsvariousconversionsoftheinternalMathrepresentation.
PictureImages,Graphics,SVGperformsvariousgraphicsconversions.
XSLTappliesanXSLTtransformationtoeachdocument.
Writerwritesthedocumenttoaleintheappropriatelocation.
See4.
2forhowtocustomizethepostprocessing.
Chapter4CustomizationTheprocesssingoftheLATEXdocument,itsconversionintoXMLandultimatelytoXHTMLorotherformatscanbecustomizedinvariousways,atdifferentstagesofprocessingandindifferentlevelsofcomplexity.
Dependingonwhatyouaretryingtoachieve,someapproachesmaybeeasierthanothers:RecallLarryWall'sadage"There'smorethanonewaytodoit.
"Byfar,theeasiestwaytocustomizethestyleoftheoutputisbymodifyingtheCSS,see4.
2.
2,sothatistherecommendedwaywhenitapplies.
ThebasicconversionfromTEXmarkuptoXMLisdonebylatexml,andisob-viouslyaffectedbythemappingbetweentheTEXmarkupandtheXMLmarkup.
Thismappingisdenedbymacros,primitivesand,ofcourse,constructors;ThemappingthatisinforceatanytimeisdeterminedbytheLATEXML-specicimplementationsoftheTEXpackagesinvolved,whatwecall'bindings'.
Consequently,youcancustomizetheconversionbymodifyingthebindingsusedbylatexml.
Likewise,youextendlatexmlbycreatingbindingsforTEXstylesthathadn'tbeencovered.
OrbydeningyourownTEXstylelealongwithit'sLATEXMLbinding.
Inallthesecases,you'llneedthesameskills:understandingandusingtext,tokens,boxesandwhatsits,aswellasmacrosandmacroexpansion,primitivesanddigestion,andnallywhatsitsandconstructors.
UnderstandingTEXhelps;readingtheLATEXMLbindingsinthedistributionwillgiveanideaofhowweuseit.
ToteachLATEXMLaboutnewmacros,toimplementbindingsforapackagenotyetcovered,ortomodifythewayTEXcontrolsequencesareconvertedtoXML,youwillwanttolookat4.
1.
TomodifythewaythatXMLisconvertedtootherformatssuchasHTML,see4.
2.
AparticularlypowerfulstrategywhenyouhavecontroloverthesourcedocumentsistodevelopasemanticallyorientedLATEXstylele,saysmacros.
sty,andthenprovideaLATEXMLbindingassmacros.
sty.
ltxml.
IntheLATEXversion,youmaystylethetermsasyoulike;intheLATEXMLversion,youcouldcontroltheconversionsoastopreservethesemanticsintheXML.
IfLATEXML'sschemaisinsufcient,thenyouwouldneedtoextenditwithyourownrepresentation;althoughthatisbeyondthescopeofthecurrentmanual,seethediscussionbelowin4.
1.
4.
Insuchacase,youwouldalsoneedtoextendtheXSLTstylesheets,asdiscussedin4.
2.
1.
1920CHAPTER4.
CUSTOMIZATION4.
1LaTeXMLCustomizationThislayerofcustomizationdealswithmodifyingthewayaLATEXdocumentistrans-formedintoLATEXML'sXML,primarilythroughdeningthewaythatcontrolsequencesarehandled.
In2.
1theloadingofvariousbindingswasdescribed.
Thefacilitiesdescribedinthefollowingsubsectionsapplyinallsuchcases,whetherusedtocus-tomizetheprocessingofaparticulardocumentortoimplementanewLATEXpackage.
Wemakenoattempttobecomprehensivehere;pleaseconsultthedocumentationfor(LaTeXML::)GlobalandPackage,aswellasthebindinglesincludedwiththesystemformoreguidance.
ALATEXMLbindingisactuallyaPerlmodule,andassuch,afamiliaritywithPerlishelpful.
Abindinglewilllooksomethinglike:useLaTeXML::Package;usestrict;usewarnings;#Yourcodehere!
1;Thenal'1'isrequired;ittellsPerlthatthemodulehasloadedsuccessfully.
Inbe-tween,comesanyPerlcodeyouwish,alongwiththedenitionsanddeclarationsasdescribedhere.
Actually,familiaritywithPerlismorethanmerelyhelpful,asisfamiliaritywithTEXandXML!
Whenwritingabinding,youwillbeprogrammingwithallthreelan-guages.
Ofcourse,youneedtoknowtheTEXcorrespondingtothemacrosthatyouintendtoimplement,butsometimesitismostconvenienttoimplementthemcom-pletely,orinpart,inTEX,itself(eg.
usingDefMacro),rathertheninPerl.
Attheotherend,constructors(eg.
usingDefConstructor)areusuallydenedbypatternsofXML.
4.
1.
1Expansion&MacrosDefMacro($prototype,$replacement,%options)MacrosaredenedusingDefMacro,suchasthepointless:DefMacro('\mybold{}','\textbf{#1}');ThetwoargumentstoDefMacrowecalltheprototypeandthereplacement.
Intheprototype,the{}speciesasinglenormalTEXparameter.
Thereplacementishereastringwhichwillbetokenizedandthe#1willbereplacedbythetokensoftheargument.
Presumablytheentireresultwilleventuallybefurtherexpandedandorprocessed.
Whereas,TEXnormallyuses#1,andLATEXhasdevelopedacomplexschemewhereitisoftennecessarytopeekaheadtokenbytokentorecognizeoptionalarguments,wehaveattemptedtodevelopasuggestive,andeasiertouse,notationforparameters.
Thusaprototype\foo{}speciesasinglenormalargument,wheere\foo[]{}wouldtakeanoptionalargumentfollowedbyarequiredone.
Morecomplexargument4.
1.
LATEXMLCUSTOMIZATION21prototypescanbefoundinPackage.
AsinTEX,themacro'sargumentsareneitherexpandednordigesteduntiltheexpansionitselfisfurtherexpandedordigested.
Themacro'sreplacementcanalsobePerlcode,typicallyananonymoussub,whichgetsthecurrentGulletfollowedbythemacro'sargumentsasitsarguments.
ItmustreturnalistofToken'swhichwillbeusedastheexpansionofthemacro.
Thefollowingtwoexamplesshowalternativewaysofwritingtheabovemacro:DefMacro('\mybold{}',sub{my($gullet,$arg)=@_;(T_CS('\textbf'),T_BEGIN,$arg,T_END);});oralternativelyDefMacro('\mybold{}',sub{Invocation(T_CS('\textbf'),$_[1]);});Generally,thebodyofthemacroshouldnotinvolveside-effects,assignmentsorotherchangestostateotherthanreadingToken'sfromtheGullet;ofcourse,themacromayexpandintocontrolsequenceswhichdohaveside-effects.
Tokens,CatcodesandfriendsFunctionsthatareusefulfordealingwithTokensandwritingmacrosincludethefollowing:ConstantsforthecorrespondingTEXcatcodes:CC_ESCAPE,CC_BEGIN,CC_END,CC_MATH,CC_ALIGN,CC_EOL,CC_PARAM,CC_SUPER,CC_SUB,CC_IGNORE,CC_SPACE,CC_LETTER,CC_OTHER,CC_ACTIVE,CC_COMMENT,CC_INVALIDConstantsfortokenswiththeappropriatecontentandcatcode:T_BEGIN,T_END,T_MATH,T_ALIGN,T_PARAM,T_SUB,T_SUPER,T_SPACE,T_CRT_LETTER($char),T_OTHER($char),T_ACTIVE($char),createtokensoftheappropriatecatcodewiththegiventextcontent.
T_CS($cs)createsacontrolsequencetoken;thestring$csshouldtypicallybeginwiththeslash.
Token($string,$catcode)createsatokenwiththegivencontentandcat-code.
Tokens($token,.
.
.
)createsa(LaTeXML::Core::)Tokensobjectcon-tainingthelistofTokens.
Tokenize($string)convertsthestringtoaTokens,usingTEX'sstandardcatcodeassignments.
TokenizeInternal($string)likeTokenize,buttreating@asaletter.
22CHAPTER4.
CUSTOMIZATIONExplode($string)convertsthestringtoaTokenswherelettercharacteraregivencatcodeCC_OTHER.
Expand($tokensexpands$tokens(aTokens),returningaTokens;thereshouldbenoexpandabletokensintheresult.
Invocation($cstoken,$arg,.
.
.
)ReturnsaTokensrepresentingthese-quenceneededtoinvoke$cstokenonthegivenarguments(eachareTokens,orundefforanunsuppliedoptionalargument).
4.
1.
2Digestion&PrimitivesPrimitivesareprocessedduringthedigestionphaseintheStomach,aftermacroex-pansion(intheGullet),andbeforedocumentconstruction(intheDocument).
OurprimitivesgeneralizeTEX'snotionofprimitive;theyareusedtoimplementTEX'sprim-itives,invokeothersideeffectsandtoconvertTokensintoBoxes,inparticular,Unicodestringsinaparticularfont.
HereareafewprimitivesfromTeX.
pool:DefPrimitive('\begingroup',sub{$_[0]->begingroup;});DefPrimitive('\endgroup',sub{$_[0]->endgroup;});DefPrimitiveI('\batchmode',undef,undef);DefPrimitiveI('\OE',undef,"\x{0152}");DefPrimitiveI('\tiny',undef,undef,font=>{size=>5});OtherthanforimplementingTEX'sownprimitives,DefPrimitiveisneededlessoftenthanDefMacroorDefConstructor.
Themainthingtokeepinmindisthatprimitivesareprocessedaftermacroexpansion,bytheStomach.
Theyaremostusefulforside-effects,changingtheState.
DefPrimitive($prototype,$replacement,%options)Thereplace-mentiseitherastringwhichwillbeusedtocreateaBoxinthecurrentfont,orcanbecodetakingtheStomachandthecontrolsequenceargumentsasargument;likemacros,theseargumentsarenotexpandedordigestedbydefault,theymustbeex-plicitlydigestedifnecessary.
Thereplacementcodemusteitherreturnnothing(eg.
endingwithreturn;)orshouldreturnalist(ie.
aPerllist(.
.
.
))ofdigestedBoxesorWhatsits.
OptionstoDefPrimitiveare:mode=>('math'|'text')switchestomathortextmode,ifneeded;requireMath=>1,forbidMath=>1requires,orforbids,thisprimitivetoap-pearinmathmode;bounded=>1speciesthatalldigestion(ofargumentsanddaemons)willtakeplacewithinanimplicitTEXgroup,sothatanyside-effectsarelocalized,ratherthanaffectingtheglobalstate;4.
1.
LATEXMLCUSTOMIZATION23font=>{hash}switchesthefontusedforanycreatedtext;recognizedfontkeysarefamily,series,shape,size,color;Notethatifthefontchangeshouldonlyaffectthematerialdigestedwithinthiscommanditself,thenbounded=>1shouldbeused;otherwise,thefontchangewillremainineffectafterthecommandisprocessed.
beforeDigest=>CODE($stomach),afterDigest=>CODE($stomach)providescodetobedigestedbeforeandaf-terprocessingthemainpartoftheprimitive.
DefRegister(.
.
.
)Needsdescrition!
OtherUtilitiesforDigestionOtherfunctionsusefulfordealingwithdigestionandstateareimportantforwritingbefore&afterdaemonsinconstructors,aswellasinPrimitives;wegiveanoverviewhere:Digest($tokens)digests$tokens(a(LaTeXML::Core::)Tokens),re-turningalistofBoxesandWhatsits.
Let($token1,$token2)gives$token1thesamemeaningas$token2,like\let.
BindingsThefollowingfunctionsareusefulforaccessingandstoringinformationinthecurrentState.
Itmaintainsastack-likestructurethatmimicsTEX'sapproachtobinding;braces{and}openandclosestackframes.
(TheStomachmethodsbgroupandegroupcanbeusedwhenexplicitlyneeded.
)LookupValue($symbol),AssignValue($string,$value,$scope)main-tainarbitraryvaluesinthecurrentState,lookinguporassigningthecurrentvalueboundto$symbol(astring).
Forassignments,the$scopecanbe'local'(thedefault,if$scopeisomitted),whichchangesthebindinginthecurrentstackframe.
If$scopeis'global',itassignsthevaluegloballybyundoingallbindings.
The$scopecanalsobeanotherstring,whichindicatesanamedscope—butthatisamoreadvancedtopic.
PushValue($symbol,$value,.
.
.
),PopValue($symbol),UnshiftValue($symbol,$value,.
.
.
),ShiftValue($symbol)Thesemaintainthevalueof$symbolasalist,withtheoperatationshavingthesamesenseasinPerl;modicationsarealwaysglobal.
LookupCatcode($char),AssignCatcode($char,$catcode,$scope)maintainthecatcodesassociatedwithcharacters.
LookupMeaning($token),LookupDefinition($token)looksupthecurrentmeaningofthetoken,beinganyexecutabledenitionboundforit.
IfthereisnosuchdefniitionLookupMeaningreturnsthetokenitself,LookupDefinitionreturnsundef.
24CHAPTER4.
CUSTOMIZATIONCountersThefollowingfunctionsmaintainLATEX-likecounters,andgenerallyalsoassociateanIDwiththem.
Acounter'sprintform(ie.
\theequationforequations)oftenendsupontherefnumattributeofelements;theassociatedIDisusedforthexml:idattribute.
NewCounter($name,$within,options),createsaLATEX-stylecounters.
When$withinisused,thegivencounterwillberesetwheneverthecounter$withinisincremented.
ThisalsocausestheassociatedIDtobeprexedwith$within'sID.
Theoptionidprefix=>$stringcausestheIDtobeprexedwiththatstring.
Forexample,NewCounter('section','document',idprefix=>'S');NewCounter('equation','document',idprefix=>'E',idwithin=>'section');wouldcausethethirdequationinthesecondsectiontohaveID='S2.
E3'.
CounterValue($name)returnstheNumberrepresentingthecurrentvalue.
ResetCounter($name)resetsthecounterto0.
StepCounter($name)stepsthecounter(andresetsanyothers'within'it),andreturnstheexpansionof\the$name.
RefStepCounter($name)stepsthecounterandanyID'sassociatedwithit.
Itreturnsahashcontainingrefnum(expansionof\the$name)andid(expan-sionof\the$name@ID)RefStepID($name)stepstheIDassociatedwiththecounter,withoutactuallysteppingthecounter;thisisusefulforunnumberedunitsthatnormallywouldhavebotharefnumandID.
4.
1.
3Construction&ConstructorsConstructorsarewherethingsgetinteresting,butalsocomplex;theyareresponsiblefordeninghowtheXMLisbuilt.
Therearebasicconstructorscorrespondingtonormalcontrolsequences,aswellasenvironments.
Mathematicsgenerallycomesdowntoconstructors,aswell,butiscoveredinChapter5.
Hereareacoupleoftrivialexamplesofconstructors:DefConstructor('\emph{}',"#1",mode=>'text');DefConstructor('\item[]',"#1(#1)");DefEnvironment('{quote}','#body',beforeDigest=>sub{Let(block@cr');});DefConstructor('\footnote[]{}',"#2",mode=>'text',4.
1.
LATEXMLCUSTOMIZATION25properties=>sub{($_[1](refnum=>$_[1]):RefStepCounter('footnote'))});DefConstructor($prototype,$replacement,%options)The$replacementforaconstructordescribestheXMLtobegeneratedduringtheconstructionphase.
ItcaneitherbeastringrepresentingtheXMLpattern(describedbelow),orasubroutineCODE($document,$arg1,.
.
.
props)receivingtheargumentsandpropertiesfromtheWhatsit;itwouldinvokethemethodsofDocumenttoconstructthedesiredXML.
Atitssimplest,theXMLpatternisajustserializationofthedesiredXML.
Formoreexpressivity,XMLtrees,textcontent,attributesandattributevaluescanbeeffectively'interpolated'intotheXMLbeingconstructedbyuseofthefollowingexpressions:#1,#2,.
.
.
#%name%returnstheconstructionofthenumberedargumentornamedpropertyoftheWhatsit;&function(arg1,arg2,.
.
.
)invokesthePerlfunctiononthegivenargu-ments,arg1,.
.
.
,returningtheresult.
Theargumentsshouldbeexpressionsforvalues,ratherthanXMLsubtrees.
test(ifpattern)ortest(ifpattern)(elsepattern)returnstheresultofeithertheiforelsepatterndependingonwhethertheresultoftest(typicallyalsoanexpression)isnon-empty;%expressionreturnsahash(orratherassumestheresultisahashorKeyValsobject);thisisonlyallowedwithinanopeningXMLtag,whereallthekey-valuepairsareinsertedasattributes;ifthisappearsatthebeginningofthepattern,thereplacementisallowedtooatupthecurrenttreetowhereeveritmightbeallowed;Ineachcase,theresultofanexpressionisexpectedtobeeitheranXMLtree,astringorahash,dependingonthecontextitwasusedin.
Inparticular,valuesofattributesaretypicallygivenbyquotedstrings,butexpressionswithinthosestringsareinterpolatedintothecomputedattributevalue.
Thespecialcharacters@#%whichintroducetheseexpressionscanbeescapedbyprecedingwithabackslash,whentheliteralchar-acterisdesired.
Asubroutineusedasthe$replacement,allowsprogrammaticinsertionofXMLinto,ormodicationof,thedocumentbeingconstructed.
AlthoughonecoulduseLibXML'sDOMAPItomanipulatethedocumenttree,itisstronglyrecommendedtouseDocument'sAPIwhereeverpossibleasitmaintainsconsistencyandmanagesnamespaceprexes.
Thisisparticularlytrueforinsertionofnewcontent,settingat-tributesandndingexistingnodesinthetreeusingXPath.
Options:mode=>('math'|'text')switchestomathortextmode,ifneeded;requireMath=>1,forbidMath=>1requires,orforbids,thisconstructortoap-pearinmathmode;26CHAPTER4.
CUSTOMIZATIONbounded=>1speciesthatalldigestion(ofargumentsanddaemons)willtakeplacewithinanimplicitTEXgroup,sothatanyside-effectsarelocalized,ratherthanaffectingtheglobalstate;font=>{hash}switchesthefontusedforanycreatedtext;recognizedfontkeysarefamily,series,shape,size,color;properties=>{hash}|CODE($stomach,$arg1,.
.
).
providesasetofpropertiestostoreintheWhatsitforeventualuseintheconstructor$replacement.
Ifasubroutineisused,italsoshouldreturnahashofproper-ties;beforeDigest=>CODE($stomach),afterDigest=>CODE($stomach,$whatsit)providescodetobedigestedbeforeandafterdigestingtheargumentsoftheconstructor,typicallytoalterthecontextofthedigestion(before),ortoaugmentthepropertiesoftheWhatsit(after);beforeConstruct=>CODE($document,$whatsit),afterConstruct=>CODE($document,$whatit)providescodetoberunbe-foreandafterthemain$replacementiseffected;occassionalyitisconvenienttousethepatternformforthemain$replacement,butonestillwantstoexe-cuteabitofPerlcode,aswell;captureBody=>(1|$token)speciesthatanadditionalargument(likeanenvironmentbody)wiilbereaduntilthecurrentTEXgroupingends,oruntilthespecied$tokenisencountered.
Thisargumentisavailableto$replacementas$body;scope=>('global'|'local'|$name)specieswhetherthisdenitionismadeglobally,orinthecurrentstackframe(default),(orinanamedscope);reversion=>$string|CODE(.
.
.
),alias=>$cscanbeusedwhentheWhatsitneedstoberevertedintoTEXcode,andthedefaultofsimplyre-assemblingbasedontheprototypeisnotdesired.
Seethecodeforexamples.
Someadditionalfunctionsusefulwhenwritingconstructors:ToString($stuff)converts$stufftoastring,hopefullywithoutTEXmarkup,suitableforuseasdocumentcontentandattributevalues.
Notethatif$stuffcontainsWhatsitsgeneratedbyConstructors,itmaynotbepossibletoavoidTEXcode.
ConstrastToStringtothefollowingtwofunctions.
UnTeX($stuff)returnsastringcontainingtheTEXcodethatwouldgenerate$stuff(thismightnotbetheoriginalTEX).
ThefunctionRevert($stuff)returnsthesameinformationasaTokenslist.
Stringify($stuff)returnsastringmoreintendedfordebuggingpurposes;itrevealsmoreofthestructureandtypeinformationoftheobjectanditsparts.
4.
1.
LATEXMLCUSTOMIZATION27CleanLabel($arg),CleanIndexKey($arg),CleanBibKey($arg),CleanURL($arg)cleansuparguments(convertingtostring,handlinginvalidcharacters,etc)tomaketheargumentappropriateforuseasanattributerepre-sentingalabel,indexID,etc.
UTF($hex)returnstheUnicodecharacterforthegivencodepoint;thisisusefulforcharactersbelow0x100wherePerlbecomesconfusedabouttheencoding.
DefEnvironment($prototype,$replacement,%options)Environmentsarelargelyaspecialcaseofconstructors,buttheprototypestartswith{envname},ratherthan\cmd,thereplacementwillalsotypicallyinvolve#bodyrepresentingthecontentsoftheenvironment.
DefEnvironmenttakesthesameoptionsasDefConstructor,withthead-ditionofafterDigestBegin=>CODE($stomach,$whatsit)providescodetodigestafterthe\begin{env}isdigested;beforeDigestEnd=>CODE($stomach)providescodetodigestbeforethe\end{env}isdigested.
Forthosecaseswhereyoudonotwantanenvironmenttocorrespondtoacon-structor,youmaystill(asinLATEX),denethetwocontrolsequences\envnameand\endenvnameasyoulike.
4.
1.
4DocumentModelThefollowingdeclarationsaretypicallyonlyneededwhencustomizingtheschemausedbyLATEXML.
RelaxNGSchema($schema,namespaces)declaresthecreatedXMLdocu-mentshouldbettotheRelaxNGschemain$schema;Ale$schema.
rngshouldbendableinthecurrentsearchpaths.
(Notethatcurrently,LATEXMLisunabletodirectlyparsecompactnotation).
RegisterNamespace($prefix,$url)associatestheprexwiththegivennamespaceurl.
Thisallowsyoutouse$prefixasanamespaceprexwhenwritingConstructorpatternsorXPathexpressions.
Tag($tag,properties)speciespropertiesforthegivenXML$tag.
Rec-ognizedpropertiesinclude:autoOpen=>1indicatesthatthetagcanautomat-icallybeopenedifneededtocreateavaliddocument;autoClose=>1in-dicatesthatthetagcanautomaticallybeclosedifneededtocreateavaliddocument;afterOpen=>$codespeciescodetobeexecutedbeforeopeningthetag;thecodeispassedtheDocumentbeingconstructedaswellastheBox(orWhatsit)responsibleforitscreation;afterClose=>codesimilartoafterOpen,butexecutedafterclosingtheelement.
28CHAPTER4.
CUSTOMIZATION4.
1.
5RewritingThefollowingfunctionsareabittrickytouse(anddescribe),butcanbequiteusefulinsomecircumstances.
DefLigature($regexp,%options)appliesaregularexpressiontosubstitutetextnodesaftertheyareclosed;theonlyoptionisfontTest=>$codewhichrestrictstheligaturetotextnodeswherethecurrentfontpasses&$code($font).
DefMathLigature($code,%options)allowsreplacementofsequencesofmathnodes.
Itapplies$codetothecurrentDocumentandeachsequenceofmathnodesencounteredinthedocument;ifareplacementshouldoccur,$codeshouldre-turnalistoftheform($n,$string,attributes)inwhichcase,thetextcontentoftherstnodeisreplacedby$string,thegivenattributesareadded,andthefollowing$n-1nodesareremoved.
DefRewrite(%spec)denesdocumentrewriterules.
Thesespecicationsdescribewhatdocumentnodesmatch:label=>$labelrestrictstonodescontainedwithinanelementwhoselabelsincludes$label;scope=>$scopegeneralizeslabel;themostusefulformastringlike'section:1.
3.
2'whereitmatchesthesectionelementwhoserefnumis1.
3.
2;xpath=>$xpathselectsnodesmatchingthegivenXPath;match=>$texselectsnodesthatlooklikewhatprocessingtheTEXstring$texwouldproduce;regexp=>$regexpselectstextnodesthatmatchthegivenregularexpression.
Thefollowingspecicationsdescribewhattodowiththematchednodes:attributes=>{attr}addsthegivenattributestothematchingnodes;replace=>$texreplacesthematchingnodeswiththeresultofprocessingtheTEXstring$tex.
4.
1.
6PackagesandOptionsThefollowingdeclarationsareusefulfordeningLATEXMLbindings,includingoptionhandling.
AswhendeningLATEXpackages,thefollowing,ifneededatall,needtoappearintheordershown.
DeclareOption($option,$handler)speciesthehandlerfor$optionwhenitispassedtothecurrentpackageorclass.
If$optionisundef,itde-nesthedefaulthandler,foroptionsthatareotherwiseunrecognized.
$handlercanbeeitherastringtobeexpanded,orasubwhichisexecutedlikeaprimitive.
4.
2.
LATEXMLPOSTCUSTOMIZATION29PassOptions($name,$type,@options)speciesthatthegivenoptionsshouldbepassedtothepackage(if$typeissty)orclass(if$typeiscls)$name,ifitiseverloaded.
ProcessOptions(keys)processesanyoptionsthathavebeenpassedtothecurrentpackageorclass.
Ifinorder=>1isspecied,theoptionswillbepro-cessedintheorderpassedtothepackage(\ProcessOptions*);otherwisetheywillbeprocessedinthedeclaredorder(\ProcessOptions).
ExecuteOptions(@options)executesthehandlersforthespecicsetofop-tions@options.
RequirePackage($pkgname,keys)loadsthespeciedpackage.
Thekey-wordoptionshavethefollowingeffect:options=>$optionscanprovideanexplicitarrayofstringspecifyingtheoptionstopasstothepackage;withoptions=>1meansthattheoptionspassedtothecurrentlyloadingclassorpackageshouldbepassedtotherequestedpackage;type=>$extspeciesthetypeofthepackagele(defaultissty);raw=>1speciesthatreadingtherawstylele(eg.
pkg.
sty)ispermissibleifthereisnospecicLATEXMLbinding(eg.
pkg.
sty.
ltxml)after=>$afterspeciesastringor(LaTeXML::Core::)Tokenstobeexpandedafterthepackagehasnishedloading.
LoadClass($classname,keys)SimilartoRequirePackage,butloadsaclassle(type=>'cls').
AddToMacro($cstoken,$tokens)alittleusedutiltytoaddmaterialtotheexpansionof$cstoken,likean\edef;typicallyusedtoaddcodetoaclassorpackagehook.
4.
1.
7MiscellaneousOtherusefulstuff:RawTeX($texstring)expandsandprocessesthe$texstring;Thisistyp-icallyusefultoincludedenitionscopiedfromaTEXstylele,whentheyareapproriateforLATEXML,asis.
Single-quotingthe$texstringisuseful,sinceitisn'tinterpolatedbyPerl,andavoidshavingtodoublealltheslashes!
4.
2latexmlpostCustomizationThecurrentpostprocessingframeworkworksbypassingthedocumentthroughase-quenceofpostprocessingltermodules.
Eachmoduleisresponsibleforcarryingoutaspecictransformation,augmentationorconversiononthedocument.
Inprinciple,thisarchitecturehastheexibilitytoemploynewlterstoperformneworcustomizedconversions.
However,thedriver,latexmlpost,currentlyprovidesnoconvenientmeanstoinstanciateandincorporateoutsidelters,shortofdevelopingyourownspe-cializedversion.
30CHAPTER4.
CUSTOMIZATIONConsequently,wewillconsidercustompostprocessingltersoutsidethescopeofthismanual(butofcourse,youarewelcometoexplorethecode,orcontactuswithsuggestions).
ThetwoareaswherecustomizationismostpracticalisinalteringtheXSLTtrans-formsusedandextendingtheCSSstylesheets.
4.
2.
1XSLTLATEXMLprovidesstylesheetsfortransformingitsXMLformattoXHTMLandHTML.
Thesestylesheetsaremodularwithcomponentscorrespondingtotheschemamodules.
Probablythebeststrategyforcustomizingthetransforminvolvesmakingacopyofthestandardbasestylesheets,LaTeXML-xhtml.
xsl,LaTeXML-html.
xslandLaTeXML-html5.
xsl,foundatinstallationdir/LaTeXML/style/—they'reshort,consistingmainlyofanxsl:includeandsettingappropriateparametersandoutputmethod;thusmodifyingtheparametersandandaddingyourownrules,orin-cludingyourownmodulesshouldberelativelyeasy.
Naturally,thisrequiresafamiliaritywithLATEXML'sschema(seeD),aswellasXSLTandXHTML.
Seetheotherstylesheetmodulesinthesamedirectoryasthebasestylesheetforguidance.
Generallythestrategyistousevariousparameterstoswitchbetweencommonbehaviorsandtousetemplateswithmodesthatcanbeoverriddeninthelesscommoncases.
ConversiontoformatsotherthanXHTMLare,ofcourse,possible,aswell,butareneithersuppliednorcoveredhere.
HowcomplexthetransformationwillbedependsontheextentthattheLATEXMLschemacanbemappedtothedesiredone,andtowhatextentLATEXMLhaslostorhiddeninformationrepresentedintheoriginaldocument.
Again,familiaritywiththeschemaisneeded,andtheprovidedXHTMLstylesheetsmaysuggestanapproach.
NOTE:I'mtryingtomakestylesheetseasilycustomizable.
However,thisisgettingtricky.
Youcanimportstylesheetswhichallowsthetemplatestobeoverridden.
Youcancalltheoverriddenstylesheetusingapply-importsYoucannotcallapply-importstocallanoverriddennamedtemplate!
(al-thoughyouseeminglycanoverridethem)YoucanrefertoxsltmodulesusingURN's,providedyouhaveloadedtheLaTeXML.
catalog:4.
2.
2CSSCSSstylesheetscanbesuppliedtolatexmlposttobeincludedinthegenerateddoc-umentsinadditionto,orasareplacementfor,thestandardstylesheetLaTeXML.
css.
Seethedirectoryinstallationdir/LaTeXML/style/forsamples.
4.
2.
LATEXMLPOSTCUSTOMIZATION31TobesttakeadvantageofthiscapabilitysoastodesignCSSruleswiththecorrectspecicity,thefollowingpointsarehelpful:LATEXMLconvertstheTEXtoitsownschema,withstructuralelements(likeequation)gettingtheirowntag;othersaretransformedtosomethingmoregeneric,suchasnote.
Inthelattercase,aclassattributeisoftenusedtodis-tinguish.
Forexample,a\footnotegenerates.
.
.
whereasan\endnotegenerates.
.
.
TheprovidedXSLTstylesheetstransformLATEXML'sschematoXHTML,generat-ingacombinedclassattributeconsistingofanyclassattributesalreadypresentaswellastheLATEXMLtagname.
However,therearesomevariationsonthetheme.
Forexample,LATEX's\sectionyeildsaLATEXMLelementsection,withati-tleelementunderneath.
WhentransformedtoXHTML,theformerbecomesa,whilethelatterbecomes(forexample,theh-levelmayvarywiththedocumentstructure),ModebeginandendFormostelements,oncethemainhtmlelementhasbeenopenedandtheprimaryattributeshavebeenaddedbutbeforeanycontenthasbeenadded,atemplatewithmodebeginiscalled;thusitcanaddeitherattributesorcon-tent.
Justbeforeclosingthemainhtmlelement,atemplatewithmodeendiscalled.
ComputingclassandstyleTemplateswithmodeclassesandstyling.
32CHAPTER4.
CUSTOMIZATIONChapter5MathematicsThereareseveralissuesthathavetobedealtwithintreatingthemathematics.
Ontheonehand,theTEXmarkupgivesaprettygoodindicationofwhattheauthorwantsthemathtolooklike,andsowewouldseemtohaveagoodhandleontheconversiontopresentationforms.
Ontheotherhand,contentformatsaredesirableaswell;thereareafew,buttoofew,cluesaboutwhattheintentofthemathematicsis.
Andinfact,thegenerationofevenPresentationMathMLofhighqualityrequiresrecognizingthemathematicalstructure,ifnottheactualsemantics.
Themathematicsprocessingmustthereforepreservethepresentationalinformationprovidedbytheauthor,whileinferring,likelywithsomehelp,themathematicalcontent.
Fromaparsingpointofview,theTEX-likeprocessingservesasthelexer,tok-enizingtheinputwhichLATEXMLwillthenparse[perhapseventuallyatype-analysisphasewillbeadded].
Ofcourse,thereareafewtwists.
Forone,thetokens,repre-sentedbyXMTok,cancarryextraattributessuchasfontandstyle,butalsothename,meaningandgrammaticalrole,withdefaultsthatcanbeoverriddenbytheauthor—moreonthose,inamoment.
Anothertwististhat,althoughLATEX'smathmarkupisnotnearlyassemanticaswemightlike,thereisconsiderablesemanticsandstruc-tureinthemarkupthatwecanexploit.
Forexample,givena\frac,we'vealreadyestablishedthenumeratoranddenominatorwhichcanbeparsedindividually,butthefractionasawholecanbedirectlyrepresentedasanapplication,usingXMApp,ofafractionoperator;theresultingstructurecanbetreatedasatomicwithinitscontainingexpression.
Thisstructurepreservingcharactergreatlysimpliestheparsingtaskandhelpsreducemisinterpretation.
Theparser,invokedbythepostprocessor,worksonlywiththetop-levellistsoflexicaltokens,orwiththosesublistscontainedinanXMArg.
Thegrammarworksprimarilythroughthenameandgrammaticalrole.
Thenameisgivenbyanattribute,orthecontentifitisthesame.
Therole(thingslikeID,FUNCTION,OPERATOR,OPEN,.
.
.
)isalsogivenbyanattribute,or,ifnotpresent,thenameislookedupinadocument-specicdictionary(jobname.
dict),orinadefaultdictionary.
Additionalexceptionsthatneedfullerexplanationare:Constructorsmaywishtocreateadualobject(XMDual)whosechildrenare3334CHAPTER5.
MATHEMATICSthesemanticandpresentationalforms.
SpacingandsimilarmarkupgeneratesXMHintelements,whicharecurrentlyignoredduringparsing,butprobablyshouldn't.
5.
1MathDetailsLATEXMLprocessesmathematicalmaterialbyproceedingthroughseveralstages:Basicprocessingofmacros,primitivesandconstructorsresultinginanXMLdocument;themathisprimarilyrepresentedbyasequenceoftokens(XMTok)orstructureditems(XMApp,XMDual)andhints(XMHint,whichareignored).
Documenttreerewriting,whererulesareappliedtomodifythedocumenttree.
Usersuppliedrulescanbeusedheretoclarifytheintentofmarkupusedinthedocument.
MathParsing;agrammarbasedparserisapplied,depthrst,toeachlevelofthemath.
Inparticular,atthetoplevelofeachmathexpression,aswellaseachsubexpressionwithinstructureditems(thesewillhavebeencontainedinanXMArgorXMWrapelement).
Thisresultsinanexpressiontreethatwillhopefullybeanaccuraterepresentationoftheexpression'sstructure,butmaybeambigousinspecics(eg.
whatthemeaningofasuperscriptis).
Theparsingisdrivenalmostentirelybythegrammaticalroleassignedtoeachitem.
Notyetimplementedafollowingstagemustbedevelopedtoresolvethesemanticambiguitiesbyanalyzingandaugmentingtheexpressiontree.
Targetconversion:fromtheinternalXM*representationtoMATHMLorOpen-Math.
TheMathelementisatop-levelcontainerforanymathmodematerial,servingasthecontainerforvariousrepresentationsofthemathincludingimages(throughat-tributesmathimage,widthandheight),textual(throughattributestex,content-texandtext),MATHMLandtheinternalrepresentationitself.
Themodeattributespeci-eswhetherthemathshouldbeindisplayorinlinemode.
5.
1.
1InternalMathRepresentationTheXMathelementisthecontainerfortheinternalrepresentationThefollowingattributescanappearonallXM*elements:rolethegrammaticalrolethatthiselementplaysopen,closeparentheseordelimitersthatwereusedtowraptheexpressionrepre-sentedbythiselement.
argopen,argclose,separatorsdelimitersonanfunctionoroperator(therstele-mentofanXMApp)thatwereusedtodelimittheargumentsofthefunction.
Theseparatorsisastringofthepunctuationcharactersusedtoseparatearguments.
5.
1.
MATHDETAILS35xml:idauniqueidentiertoallowreference(XMRef)tothiselement.
MathTagsThefollowingtagsareusedfortheintermediatemathrepresentation:XMTokrepresentsamathtoken.
Itmaycontaintextforpresentation.
Additionalattributesare:namethenamethatrepresentsthemeaningofthetoken;thisoverridesthecontentforidentifyingthetoken.
omcdtheOpenMathcontentdictionarythatthenamebelongsto.
fontthefonttobeusedforpresentingthecontent.
stylesizestackscriptswhetherscriptsshouldbestackedabove/belowtheitem,insteadoftheusualscriptposition.
XMApprepresentsthegeneralizedapplicationofsomefunctionoroperatortoargu-ments.
Therstchildelementistheoperator,theremainigelementsarethearguments.
Additionalattributes:namethenamethatrepresentsthemeaningoftheconstructasawhole.
stackscriptsXMDualcombinesrepresentationsofthecontent(therstchild)andpresentation(thesecondchild),usefulwhenthetwostructuresarenoteasilyrelated.
XMHintrepresentsspacingorotherapparentpurelypresentationmaterial.
namenamestheeffectthatthehintwasintendedtoachieve.
styleXMWrapservestoasserttheexpectedtypeorroleofasubexpressionthatmayother-wisebedifculttointerpret—theparserismoreforgivingaboutthese.
namestyleXMArgservestowrapindividualargumentsorsubexpressions,createdbystructuredmarkup,suchas\frac.
Thesesubexpressionscanbeparsedindividually.
rulethegrammarrulethatthissubexpressionshouldmatch.
XMRefreferstoanothersubexpression,.
ThisisusedtoavoidduplicatingargumentswhenconstructinganXMDualtorepresentafunctionapplication,forexample.
Theargumentswillbeplacedinthecontentbranch(wrappedinanXMArg)whileXMRef'swillbeplacedinthepresentationbranch.
idreftheidentierofthereferencedmathsubexpression.
36CHAPTER5.
MATHEMATICS5.
1.
2GrammaticalRolesAsmentionedabove,thegrammartakeadvantageofthestructure(howeverminimal)ofthemarkup.
Thus,thegrammerisappliedinlayers,tosequencesoftokensoratomicsubexpressions(likeafractionsorarrays).
Itistheroleattributethatindicatesthesyntacticand/orpresentationalnatureofeachitem.
Ontheonehand,thisdrivestheparsing:thegrammarrulesarekeyedontherole(say,ADDOP),ratherthancontent(say+or-),ofthenodes[Insomecases,thecontentisusedtodistinguishspecialsynthesizedroles].
Theroleisalsousedtodrivetheconversiontopresentationmarkup,(say,asaninxoperator),especiallyPresentationMATHML.
Somevaluesofroleareusedonlyinthegrammar,someareonlyusedinpresentation;mostareusedbothways.
Thefollowinggrammaticalrolesarerecognizedbythemathparser.
Thesevaluescanbespeciedintheroleattributeduringtheinitialdocumentconstructionorbyrewriterules.
Althoughtheprecedenceofoperatorsislooselydescribedinthefollow-ing,sincethegrammarcontainsvariousspecialcaseproductions,norigidlyorderedprecedenceisgiven.
Alsonotethatinthecurrentdesign,anexpresssionhasonlyasin-glerole,althoughthatrolemaybeinvolvedingrammaticalruleswithdistinctsyntaxandsemantics(somerolesdirectlyreectthisambiguity).
ATOMageneralatomicsubexpression(atomicattheleveloftheexpression;itmayhaveinternalstructure);IDavariable-liketoken,whetherscalarorotherwise,butnotafunction;NUMBERanumber;ARRAYastructurewithinternalcomponentsandalignments;typicallyhasaparticularsyntacticrelationshiptoOPENandCLOSEtokens.
UNKNOWNanunknownexpression.
Thisisthedefaultfortokenelements.
SuchtokensaretreatedessentialasID,butgenerateawarningifitseemstobeusedasafunction.
OPEN,CLOSEopeningandclosingdelimiters,groupexpressionsorencloseargumentsamongotherstructures;MIDDLEamiddleoperatorusedtogroupitemsbetweenanOPEN,CLOSEpair;PUNCT,PERIODpunctuation;aperiod'ends'formula(notethatnumbers,includingoatingpoint,arerecognizedearlierinprocessing);VERTBARaverticalbar(singleordoubled)whichservesaconfusingvarietyofnota-tions:absolutevalues,"at",divides;RELOParelationaloperator,looselybinding;ARROWanarrowoperator(withlittlesemanticsignicance),butgenerallytreatedequivalentlytoRELOP;METARELOPanoperatorusedforrelationsbetweenrelations,withlowerprecedence;5.
1.
MATHDETAILS37MODIFIERanatomicexpressionfollowinganobjectthat'modies'itinsomeway,suchasarestriction(inthebra-ketnotationusedinquantummechanics;LBRACE,RBRACErecognizesuseof{and}oneithersideofstackedorarraycon-structionsrepresentingvariouskindsofcasesorchoices;SCRIPTOPENrecognizestheuseof{inopeningspecializedsetnotations.
Chapter6LocalizationInthischapter,afewissuesrelatingtovariousnationalorculturalstyles,languagesortextencodings,whichwe'llrefertocollectivelyas'localization',arebreiydiscussed.
6.
1NumberingGenerallywhentitlesandcaptionsareformattedorwhenequationsarenumberedandwhentheyarereferredtoinacrossreferenceortableofcontents,textconsistingofsomecombinationoftherawtitleorcaptiontext,areferencenumberandatypename(eg.
'Chapter')orsymbol(eg.
§)iscomposedandused.
Theexactcompositionsthatisusedateachlevelcandependonlanguage,culture,thesubjectmatteraswellasbothjournalandindividualstylepreferences.
LATEXhasevolvedtoaccommodatemanyofthesestylesandLATEXMLattemptstofollowthatlead,whilepreserveitsoptions(thedemandsofextensivelyhyper-linkedonlinematerialsometimesseemstodemandmoreoptionsandexibilitythantraditionalprintformatting).
Forexample,thevariousmacros\chaptername,\partname,\refname,etc.
arerespectedandused.
Likewise,thevariouscountersandformatterssuchas\theequationaresupported.
LATEX'smechanismforformattingcaptiontags(\fnum@figureand\fnum@table)isextendedtocovermorecases.
Ifyoudene\fnum@type,(wheretypeischapter,section,subsection,etc.
)itwillbeusedtoformatthereferencenumberand/ortypenameforinstancesofthattype.
Themacro\fnum@toc@typeisusedwhenformattingnumbersfortablesofcontents.
Alternatively,youcandeneamacro\format@title@typethatwillbeusedformatthewholetitleincludingreferencenumberandtypeasdesired;ittakesasin-gleargument,thetitletext.
Themacro\format@toctitle@typeisusedfortheformattinga(typically)shortformuseintablesofcontents.
3940CHAPTER6.
LOCALIZATION6.
2InputEncodingsLATEXMLsupportsthestandardLATEXmechanismforhandlingnon-ASCIIencodingsoftheinputTEXsources:usingtheinputencpackage.
TheLATEXMLbindingofinputencloadstheencodingdenition(generallywithextensiondef)directlyfromtheLATEXdistribution(whicharegenerallywell-enoughbehavedtobeeasilypro-cessed).
Theseencodingdenitionsmaketheupper128codepoints(of8bit)activeanddeneTEXmacrostohandlethem.
Usingthecommandlineoption--inputencoding=utf8tolatexmlallowsprocessingofsourcesencodedasutf8,withoutanyspecialpackagesloaded.
[futureworkwillmakeLATEXMLcompatiblewithxetex]6.
3OutputEncodingsAtsomelevel,asfarasTEXisconcerned,whatyoutypeendsuppointingintoafontthatcausessomeblobofinktobeprinted.
Thismechanismisusedtoprintauniquemathematicaloperator,say'subsetofandnotequals'.
ItisalsousedtoprintgreekwhenyouseemedtohavebeentypingASCII!
So,wemustaccomodatethatmechanism,aswell.
Atthestagewhencharacterto-kensaredigestedtocreateboxesinthecurrentfont,afontencodingtable(aFontMap)isconsultedtomapthetoken'stext(viewedasanindexintothetable)toUnicode.
ThedeclarationDeclareFontMapisusedtoassociateaFontMapwithanencodingname,orfont.
Notethatthismappingisonlyusedfortextoriginatingfromthesourcedocument;ThetextwithinConstructor'sXMLpatternisusedwithoutanysuchfontconversion.
6.
4BabelThebabelpackageforsupportingmultiplelanguagesbyredeningvariousinternalbitsoftexttoreplace,eg.
"Chapter"by"Kapital"andbydeningvariousshorthandmechanismstomakeiteasytotypetheextranon-latincharactersandglyphsusedbythoselanguages.
Eachsupportedlanguageordialecthasamodulewhichisloadedtoprovidetheneededdenitions.
Totheextent:thatLATEXML'sinputandoutputencodinghandlingissufcient;thatitsprocessingofrawTEXisgoodenough;andthatitproceedsthroughtheappropriateLATEXinternals,LATEXMLshouldbeabletosupportbabelandarbitrarylanguagesbyreadingintherawTEXimplementationofthelanguagemodulefromtheTEXdistribu-tionitself.
Atleast,thatisthestrategythatweuse.
Chapter7AlignmentsThereareseveralsituationswhereTEXstacksoralignsanumberofobjectsintoaoneortwodimensionalgrids.
Inmostcases,thesearebuiltuponlow-levelprimitives,like\halign,andsosharecharacteristics:using&toseparatealignmentcolumns;either\\or\crtoseparaterows.
Yet,therearemanydifferentmarkuppatternsandenvironmentsusedforquitedifferentpurposesfromtabulartexttomatharraystocomposingsymbolsandsoitisworthrecognizingtheintendedsemanticsineachcase,whilestillprocessingthemasTEXwould.
Inthischapter,wewilldescribesomeofthespecialcomplicationspresentedbyalignmentsandthestrategiesusedtoinferandrepresenttheappropriatesemanticstruc-tures,particularlyformath.
7.
1TEXAlignmentsNOTEThissectionneedstobewritten.
ManyutilitiesforsettingupandprocessingalignmentsaredenedinTeX.
poolwithsupportfromthemodule(LaTeXML::Core::)Alignment.
Typically,onebindsasetofcontrolsequencesspeciallyforthealignmentenvironmentorstructureencountered,particularlyfor&and\\.
Analignmentobjectiscreatedwhichrecordsinformationabouteachrowandcellthatwasprocessed,suchaswidth,alignment,span,etc.
ThenthealignmentisconvertedtoXMLbyspecifyingwhattagwrapstheentirealignment,eachrowandeachcell.
Thecontentofaligmentsisbeingexpandedbeforethecolumnandrowmarkersarerecognized;thisallowsmoreexibilityindeningmarkupsincerowandcolumnmarkerscanbehiddeninmacros,butitalsomeansthatsimplemeans,suchasdelimitedparameterlists,toparsethestructurewon'twork.
7.
2TabularHeaderHeuristicsTobewritten4142CHAPTER7.
ALIGNMENTS7.
3MathForksThereareseveralconstructsforaligningmathematicsinLATEX,andcommonpackages.
Hereweareconcernedwiththelargescalealignmentswhereoneormoreequationsaredisplayedinagrid,suchaseqnarray,instandardLATEX,andasuiteofconstructsoftheamsmathpackages.
Thearrangementsareworthpreservingastheyoftencon-veyimportantinformationtothereaderbythegrouping,orbydrawingattentiontosimilaritiesordifferencesintheformula.
Atthesametime,theindividualfragmentswithinthegridcellsoftenhavelittle'meaning'ontheirown:itissubsequencesofthesefragmentsthatrepresentthelogicalmathematicalobjectsorformula.
Thus,wewouldalsoliketorecognizethosesequencesandsynthesizecompleteformulaforuseincontent-orientedservices.
WethereforehavetodeviseanXMLstructuretorepresentthisduality,aswellasdevelopingstrategiesforinferringandrearrangingthemathe-maticsasitwasauthoredintothedesiredform.
TheneededstructuresharessomecharacteristicswithXMDual,whichneedstobedescribed,butneedstoresidedatthedocumentlevel,containingseveral,possiblynumbered,equationseachofwhichprovidetwoviews.
Additionalobjects,suchastextualinsertions(suchasamsmath's\intertext),mustalsobeaccomodated.
ThefollowingXMLisusedtorepresentthesestructures:logicalmathherecellmath.
.
.
or.
.
.
inter-text.
.
.
moretextorequationsTypically,thecontentsoftheMathBranchwillbeasequenceoftd,eachcontaininganMath,oroftr,eachcontainingsequenceofsuchtd.
Thisstructurecanthusrep-resentbotheqnarraywherealogicalequationconsistsofoneormorecompleterows,aswellasAMS'alignedwhereequationsconsistofpairsofcolumns.
TheXSLTtransformationthatconvertstoendformatsrecognizeswhichcaseandlaysoutappropriately.
Inmostcases,thematerialthatwillyieldaMathForkisgivenasasetofpartialmathexpressionsrepresentingrowsand/orcolumnns;thesemustbeconcatenated(andparsed)toformthecompositelogicalexpression.
AnyID'swithintheexpressions(andreferencestothem)mustbemodiedtoavoidduplicateids.
Moreover,ausefulapplicationassociatesthedisplayedtokensfromthealignedpresentationoftheMathBranchwiththepresumablysemantictokensinthelogcalcontentofthemainbranchoftheMathFork.
Thus,wedesirethattheIDsinthe7.
4.
EQNARRAY43twobranchestohaveaknownrelationship;inparticular,thoseinthebranchshouldhave.
fork1appended.
7.
4eqnarrayTheeqnarrayenvironmentseemsintendedtorepresentoneormoreequations,buteachequationcanbecontinuedwithadditionalright-hand-sides(byomittingthe1stcolumn),ortheRHSitselfcanbecontinuedonmultiplelinesbyomittingthe1sttwocolumnsonarow.
Withourgoalofconstructingwell-structuredmathematics,thisgivesusafunlittlepuzzletosortout.
However,beingessentiallytheonlystructureforaligningmathematicalstuffinstandardLATEX,eqnarraytendedtobestretchedintovariousotherusecases;aligningnumberedequationswithbitsoftextontheside,forexample.
Wethereforehavesomeworktodotoguesswhattheintentis.
ThestrategyusedforeqnarrayisprocessthematerialasanalignmentinmathmodeandconvertinitiallytothefollowingXMLstructure:columnmathhere.
.
.
.
.
.
Theresultsarethenstudiedtorecognizethepatternsofemptycolumnssothattherowscanberegroupedintologicalequations.
MathForkstructuresareusedtocontainthoselogicalequationswhilepreservingthelayoutintheMathBranch.
NOTEWeneedtodealbetterwiththecasesthathavemorerowsnumberedthatwewouldlike.
7.
5AMSAlignmentsTheAMSmathpackagesdeneanumberofusefulmathalignmentstructures.
Thesehavebeenwellthoughtoutanddesignedwithparticularlogicalstructuresinmind,aswellasthelayout.
Thustheseenvironmentsarelessoftenabusedthaniseqnarray.
Inthissection,welisttheenvironments,theirexpectedusecaseanddescribethestrat-egyusedforconvertingthem.
TobedoneDescribealternatesforequationandthingsinsideequations;De-scribesinglevsmultiplelogicalequations.
(andstartedvariants)ThislistoutlinestheintendeduseoftheAMSalignmentenvironmentsThefollow-ingconstructsareintendedastop-levelenvironments,usedlikeequation.
Severaloftheconstructsareusedinplaceofatop-levelequationandrepresentoneormorelogicalequations.
Thefollowingdescribestheintendedusage,asaguidetounderstandingtheimplementationcode(oritslimitations!
)44CHAPTER7.
ALIGNMENTSalign,flalign,alignat,xalignat:Eachrowmaybenumbered;hasevennumberofcolumns;Eachpairofcolumns,alignedrightthenleft,repre-sentsalogicalequation;Notethatthedocumentationsuggeststhatannotativetextcanbeaddedbyputting\text{}inacolumnfollowedbyanemptycol-umn.
gather:Eachrowisasinglecenteredcolumnrepresentinganequation.
multline:Thisenvironmentrepresentsasingleequationbrokentomultiplelines;thelinesarealignedleft,center(repeated)andnally,right.
alignmentnotyetimplementedThefollowingenvironmentsareusedwithinanequation(orsimilar)environmentandthusdonotgenerateMathForkstructures.
Moreover,exceptforaligned,theirse-manticintentislessclear.
Thepreservationofthealignmenthavenotyetbeenimple-mented;they;presumablywouldyeiledanXMDual.
splitgatheredaligned,alignedatNotethatthecaseofasingleequationcontainingasinglealignedistransformedintoandtreatedequivalentlytoatop-levelalign.
Chapter8Metadata8.
1RDFaLATEXMLhassupportforrepresentingandgeneratingRDFametadatainLATEXMLdoc-uments.
Thecoreattributesproperty,rel,rev,aboutresource,typeofandcontentareincluded.
ProvisionisalsomadeforaboutandresourcetobespeciedusingLATEX-stylelabels,orplainXMLid's.
ThedefaultsetofvocabulariesisspeciedinHTMLRoleVocabulary1,andtheassociatedsetofprexesarepredened.
ItisintendedthatthesupportwillbeextendedtoautomaticallygenerateRDFadatafromtheimpliedsemanticsofLATEXmarkup;theideawouldbenottoinadvertentlyoverrideanyexplicitlyprovidedmetadatasuppliedbyoneofthefollowingpackages.
ThehyperrefpackageThehyperrefandhyperxmppackagesprovideameanstospecifymetadatawhichwillbeembeddedinthegeneratedpdfle;LATEXMLconvertsthatdatatoRDFainitsgeneratedXML.
ThelxRDFapackageThereisalsoaLATEXML-specicpackage,lxRDFa,whichprovidesseveralcommandsforannotatingthegeneratedXML.
Themostpowerfulofwhichis\lxRDFawhichallowsyoutospecifyanysetorsubsetofRDFaattributesonthecurrentXMLelementandthustakeadvantageofthearbitraryshorthands,chainingandpartialtriplesthatRDFaallows.
Correspondingly,youaremustbewareofclashesorunintendedchangestothesetoftriplesgeneratedbyexplicitandhiddenRDFadata.
1http://www.
w3.
org/1999/xhtml/vocab/#XHTMLRoleVocabulary4546CHAPTER8.
METADATAChapter9ToDoLots.
.
.
!
ManyusefulLATEXpackageshavenotbeenimplemented,andthosethatarearen'tnecessarilycomplete.
Contributedbindingsare,ofcourse,welcome!
Low-levelTEXcapabilities,suchastextmodes(eg.
vertical,horizonatal),boxdetailslikewidthanddepth,aswellasfonts,aren'tmimickedfaithfully,althoughitisn'tclearhowmuchcanbedoneatthe'semantic'level.
arichermathgrammar,ormoreexibleparsingengine,betterinferencingofmathstructure,betterinferencingofmathmeaning.
.
.
andthusbetterContentMathMLandOpenMathsupport!
Couldbefaster.
Easiercustomizationofthedocumentschema,XSLTstylesheets.
.
.
.
um,.
.
.
documentation!
4748CHAPTER9.
TODOAcknowledgementsThankstotheDLMFprojectandit'sEditors—FrankOlver,DanLozier,RonBoisvert,andCharlesClark—forprovidingthemotivationandopportunitytopursuethis.
ThankstothearXMLivproject,inparticularMichaelKohlhaseandHeinrichStamerjohanns,forprovidingarichtestbedandtestingframeworktoexercisethesys-tem.
Additionally,thankstoIoanSucan,CatalinDavidandSilviuOpreafortestinghelpandforimplementingadditionalpackages.
ParticularthanksgotoDeyanGinevasanenthusiasticsupporteranddeveloper.
4950CHAPTER9.
TODOAppendixACommandDocumentationlatexmlTransformsaTeX/LaTeXleintoXML.
Synopsislatexml[options]texleOptions:--destination=filesetsdestinationfile(defaultstdout).
--output=file[obsoletesynonymfor--destination]--preload=modulerequestsloadingofanoptionalmodule;canberepeated--preamble=filesetsapreamblefilewhichwilleffectivelybeprependedtothemainfile.
--postamble=filesetsapostamblefilewhichwilleffectivelybeappendedtothemainfile.
--includestylesallowslatexmltoloadraw*.
styfile;bydefaultitavoidsthis.
--path=diraddstothepathssearchedforfiles,modules,etc;--documentid=idassignanidtothedocumentroot.
--quietsuppressmessages(canrepeat)--verbosemoreinformativeoutput(canrepeat)--strictmakeslatexmllessforgivingoferrors--bibtexprocessesasaBibTeXbibliography.
--xmlrequestsxmloutput(default).
--texrequestsTeXoutputafterexpansion.
--boxrequestsboxoutputafterexpansionanddigestion.
--noparsesuppressesparsingmath--nocommentsomitcommentsfromtheoutput--inputencoding=encspecifytheinputencoding.
--VERSIONshowversionnumber.
5152APPENDIXA.
COMMANDS--debug=packageenablesdebuggingoutputforthenamedpackage--helpshowsthishelpmessage.
Iftexleis'-',latexmlreadstheTeXsourcefromstandardinput.
Iftexlehasanexplicitextentionof.
bib,itisprocessedasaBibTeXbibliography.
Options&Arguments--destination=leSpeciesthedestinationle;bydefaulttheXMLiswrittentostdout.
--preload=moduleRequeststheloadingofanoptionalmoduleorpackage.
ThismaybeusefuliftheTeXcodedoesnotspeciclyrequirethemodule(eg.
throughinputorusepackage).
Forexample,use--preload=LaTeX.
pooltoforceLaTeXmode.
--preamble=le,--postamble=leSpeciesalewhosecontentswilleffectivelybeprependedorappendedtothemaindocumentle'scontent.
ThiscanbeusefulwhenprocessingTeXfrag-ments,inwhichcasethepreamblewouldcontaindocumentclassandbegindoc-umentcontrolsequences.
ThisoptionisnotusedwhenprocessingBibTeXles.
--includestylesThisoptionalallowsprocessingofstyleles(leswithextensionssty,cls,clo,cnf).
Bydefault,theselesareignoredunlessalatexmlimplementationofthemisfound(withanextensionofltxml).
Thesestylelesgenerallyfallintotwoclasses:Thosethatmerelyaffectdocu-mentstyleareignorableintheXML.
Othersdenenewmarkupanddocumentstructure,oftenusingdeeperLaTeXmacrostoachievetheirends.
Althoughtheomissionwillleadtoothererrors(missingmacrodenitions),itisunlikelythatprocessingtheTeXcodeinthestylelewillleadtoacorrectdocument.
--path=dirAdddirtothesearchpathsusedwhensearchingforles,modules,styleles,etc;somewhatlikeTEXINPUTS.
Thisoptioncanberepeated.
--documentid=idAssignsanIDtotherootelementoftheXMLdocument.
ThisIDisgenerallyinheritedastheprexofID'sonallotherelementswithinthedocument.
ThisisusefulwhenconstructingasiteofmultipledocumentssothatallnodeshaveuniqueIDs.
--quietReducestheverbosityofoutputduringprocessing,usedtwiceisprettysilent.
53--verboseIncreasestheverbosityofoutputduringprocessing,usedtwiceisprettychatty.
Canbeusefulforgettingmoredetailswhenerrorsoccur.
--strictSpeciesastrictprocessingmode.
Bydefault,undenedcontrolsequencesandinvaliddocumentconstructs(thatviolatetheDTD)givewarningmessages,butattempttocontinueprocessing.
Using--strictmakesthemgeneratefatalerrors.
--bibtexForceslatexmltotreattheleasaBibTeXbibliography.
NotethatthetimingisslightlydifferentthantheusualcasewithBibTeXandLaTeX.
Inthelattercase,BibTeXsimplyselectsandformatsasubsetofthebibliographicentries;theactualTeXexpansioniscarriedoutwhentheresultisincludedinaLaTeXdocument.
Incontrast,latexmlprocessesandexpandstheentirebibliography;theselectionofentriesisdoneduringpostprocessing.
Thisalsomeansthatanypackagesthatdenemacrosusedinthebibliographymustbespeciedusingthe--preloadoption.
--xmlRequestsXMLoutput;thisisthedefault.
--texRequestsTeXoutputfordebuggingpurposes;processingisonlycarriedoutthroughexpansionanddigestion.
ThismaynotbequitevalidTeX,sinceUni-codemaybeintroduced.
--boxRequestsBoxoutputfordebuggingpurposes;processingiscarriedoutthroughexpansionanddigestions,andtheresultisprinted.
--nocommentsNormallylatexmlpreservescommentsfromthesourcele,andaddsacommentevery25linesasanaidintrackingthesource.
Theoption--nocommentsdiscardssuchcomments.
--inputencoding=encodingSpecifytheinputencoding,eg.
--inputencoding=iso-8859-1.
Theen-codingmustbeoneknowntoPerl'sEncodepackage.
NotethatthisonlyenablesthetranslationoftheinputbytestoUTF-8usedinternallybyLaTeXML,butdoesnotaffectcatcodes.
ItisusuallybettertouseLaTeX'sinputencpackage.
Notethatthisdoesnotaffecttheoutputencoding,whichisalwaysUTF-8.
--VERSIONShowstheversionnumberoftheLaTeXMLpackage.
.
54APPENDIXA.
COMMANDS--debug=packageEnablesdebuggingoutputforthenamedpackage.
ThepackageisgivenwithouttheleadingLaTeXML::.
--helpShowsthishelpmessage.
Seealsolatexmlpost,latexmlmath,LaTeXMLlatexmlpostPostprocessesanxmllegeneratedbylatexmltoperformcommontasks,suchasconvertmathtoimagesandprocessinggraphicsinclusionsfortheweb.
Synopsislatexmlpost[options]xmlleOptions:--verboseshowsprogressduringprocessing.
--VERSIONshowversionnumber.
--helpshowshelpmessage.
--sourcedirectory=sourcedirsetsdirectoryoftheoriginalsourceTeXfile.
--validate,--novalidateEnables(thedefault)ordisablesvalidationofthesourcexml.
--format=html|html5|html4|xhtml|xmlrequeststheoutputformat.
(htmldefaultstohtml5)--destination=filesetsoutputfile(anddirectory).
--omitdoctypeomitstheDoctypedeclaration,--noomitdoctypedisablestheomission(thedefault)--numbersectionsenables(thedefault)theinclusionofsectionnumbersintitles,crossrefs.
--nonumbersectionsdisablestheabove--stylesheet=xslfilerequeststheXSLtransformusingthegivenxslfileasstylesheet.
--css=cssfileaddscssstylesheetto(x)html(5)(canberepeated)--nodefaultresourcesdisablesprocessingbuilt-inresources--javscript=jsfileaddsalinktoajavascriptfileintohtml4/html5/xhtml(canberepeated)--xsltparameter=name:valuepassesparameterstotheXSLT.
--splitrequestssplittingeachdocument--nosplitdisablestheabove(default)--splitatsetsleveltosplitthedocument--splitpath=xpathsetsxpathexpressiontousefor55splitting(defaultsplitsatsections,ifsplittingisenabled)--splitnaming=(id|idrelative|label|labelrelative)specifieshowtonamesplitfiles(idrelative).
--scanscansdocumentstoextractids,labels,etc.
sectiontitles,etc.
(default)--noscandisablestheabove--crossreffillsincrossreferences(default)--nocrossrefdisablestheabove--urlstyle=(server|negotiated|file)formattouseforurls(defaultserver).
--navigationtoc=(context|none)generatesatableofcontentsinnavigationbar--indexrequestscreatinganindex(default)--noindexdisablestheabove--splitindexSplitsindexintopagesperinitial.
--nosplitindexdisablestheabove(default)--permutedindexpermutesindexphrasesintheindex--nopermutedindexdisablestheabove(default)--bibliography=filesetsabibliographyfile--splitbibliographysplitsthebibliographyintopagesperinitial.
--nosplitbibliographydisablestheabove(default)--prescancarriesoutonlythesplit(ifenabled)andscan,storingcross-referencingdataindbfile(defaultiscompleteprocessing)--dbfile=dbfilesetsfiletostorecrossreferences--sitedirectory=dirsetsthebasedirectoryofthesite--mathimagesconvertsmathtoimages(defaultforhtml4format)--nomathimagesdisablestheabove--mathsvgconvertsmathtosvgimages--nomathsvgdisablestheabove--mathimagemagnification=magsetsmagnificationfactor--presentationmathmlconvertsmathtoPresentationMathML(defaultforxhtml&html5formats)--pmmlaliasfor--presentationmathml--nopresentationmathmldisablestheabove--linelength=nformatspresentationmathmltoalinelengthmaxofncharacters--contentmathmlconvertsmathtoContentMathML--nocontentmathmldisablestheabove(default)--cmmlaliasfor--contentmathml--openmathconvertsmathtoOpenMath--noopenmathdisablestheabove(default)--omaliasfor--openmath--keepXMathpreservestheintermediateXMathrepresentation(defaultistoremove)56APPENDIXA.
COMMANDS--mathtexaddsTeXannotationtoparallelmarkup--nomathtexdisablestheabove(default)--plane1useplane-1unicodeforsymbols(default,ifneeded)--noplane1donotuseplane-1unicode--graphicimagesconvertsgraphicstoimages(default)--nographicimagesdisablestheabove--graphicsmap=type.
typespecifiesagraphicsfilemapping--pictureimagesconvertspictureenvironmentstoimages(default)--nopictureimagesdisablestheabove--svgconvertspictureenvironmentstoSVG--nosvgdisablestheabove(default)Ifxmlleis'-',latexmlpostreadstheXMLfromstandardinput.
Options&ArgumentsGeneralOptions--verboseRequestsinformativeoutputasprocessingproceeds.
Canberepeatedtoincreasetheamountofinformation.
--VERSIONShowstheversionnumberoftheLaTeXMLpackage.
.
--helpShowsthishelpmessage.
SourceOptions--sourcedirectory=sourceSpeciesthedirectorywheretheoriginallatexsourceislocated.
Unlesslatexml-postisrunfromthatdirectory,oritcanbedeterminedfromthexmllename,itmaybenecessarytospecifythisoptioninordertondgraphicsandstyleles.
--validate,--novalidateEnables(ordisables)thevalidationofthesourceXMLdocument(thedefault).
FormatOptions--format=(html|html5|html4|xhtml|xml)Speciestheoutputformatforpostprocessing.
Bydefault,itwillbeguessedfromtheleextensionofthedestination(ifgiven),withhtmlimplyinghtml5,xhtmlimplyingxhtmlandthedefaultbeingxml,whichyouprobablydon'twant.
57Thehtml5formatconvertsthematerialtohtml5formwithmathematicsasMathML;html5supportsSVG.
html4formatconvertsthematerialtotheear-lierhtmlform,version4,andthemathematicstopngimages.
xhtmlformatconvertstoxhtmlandusespresentationMathML(afterattemptingtoparsethemathematics)forrepresentingthemath.
html5similarlyconvertsmathtopre-sentationMathML.
Inthesecases,anygraphicswillbeconvertedtoweb-friendlyformatsand/orcopiedtothedestinationdirectory.
Ifyousimplyspecifyhtml,itwilltreatthatashtml5.
Forthedefault,xml,theoutputisleftinLaTeXML'sinternalxml,butthemathisparsedandconvertedtopresentationMathML.
Forhtml,html5andxhtml,adefaultstylesheetisprovided,butseethe--stylesheetoption.
--destination=destinationSpeciesthedestinationleanddirectory.
Thedirectoryisneededformathim-ages,mathsvgandgraphicsprocessing.
--omitdoctype,--noomitdoctypeOmits(orincludes)thedocumenttypedeclaration.
ThedefaultistoincludeitifthedocumentmodelwasbasedonaDTD.
--numbersections,--nonumbersectionsIncludes(default),ordisablestheinclusionofsection,equation,etc,numbersintheformatteddocumentandcrossreferencelinks.
--stylesheet=xslleRequeststheXSLtransformationofthedocumentusingthegivenxslleasstylesheet.
Ifthestylesheetisomitted,a'standard'oneappropriatefortheformat(html4,html5orxhtml)willbeused.
--css=cssleAddscssleasacssstylesheettobeusedinthetransformedhtml/html5/xhtml.
Multiplestylesheetscanbeused;theyareincludedinthehtmlintheordergiven,followingthedefaultltx-LaTeXML.
css(unless--nodefaultcss).
Thestylesheetiscopiedtothedestinationdirectory,unlessitisanabsoluteurl.
Somestylesheetsincludedinthedistributionare--css=navbar-leftPutsanav-igationbarontheleft.
(defaultomitsnavbar)--css=navbar-rightPutsanavi-gationbarontheleft.
--css=theme-blueAbluecoloringthemeforheadings.
--css=amsartAstylesuitableforjournalarticles.
--javascript=jsleIncludesalinktothejavascriptlejsle,tobeusedinthetransformedhtm-l/html5/xhtml.
Multiplejavascriptlescanbeincluded;theyarelinkedinthehtmlintheordergiven.
Thejavascriptleiscopiedtothedestinationdirectory,unlessitisanabsoluteurl.
58APPENDIXA.
COMMANDS--icon=iconleCopiesiconletothedestinationdirectoryandsetsupthelinkageinthetrans-formedhtml/html5/xhtmltousethatasthe"favicon".
--nodefaultresourcesDisablesthecopyingandinclusionofresourcesaddedbythebindingles;ThisincludesCSS,javascriptorotherles.
Thisdoesnotaffectresourcesexplicitlyrequestedbythe--cssor--javascriptoptions.
--timestamp=timestampProvidesatimestamp(typicallyatimeanddate)tobeembeddedinthecom-mentsbythestockXSLTstylesheets.
Ifyoudon'tsupplyatimestamp,thecur-renttimeanddatewillbeused.
(Youcanuse--timestamp=0toomitthetimestamp).
--xsltparameter=name:valuePassesparameterstotheXSLTstylesheet.
Seethemanualorthestylesheetitselfforavailableparameters.
Site&CrossreferencingOptions--split,--nosplitEnablesordisables(default)thesplittingofdocumentsintomultiple'pages'.
Ifenabled,thethedocumentwillbesplitintosections,bibliography,indexandappendices(ifany)bydefault,unless--splitpathisspecied.
--splitat=unitSpecieswhatlevelofthedocumenttosplitat.
Shouldbeoneofchapter,section(thedefault),subsectionorsubsubsection.
Formorecon-trol,see--splitpath.
--splitpath=xpathSpeciesanXPathexpressiontoselectnodesthatwillgenerateseparatepages.
Thedefaultsplitpathis//ltx:section|//ltx:bibliography|//ltx:appendix|//ltx:indexSpecifying--splitpath="//ltx:section|//ltx:subsection|//ltx:bibliography|//ltx:appendix|//ltx:index"wouldsplitthedocumentatsubsectionsaswellassections.
--splitnaming=(id|idrelative|label|labelrelative)Specieshowtonamethelesforsubdocumentscreatedbysplitting.
Thevaluesidandlabelsimplyusetheidorlabelofthesubdocument'srootnodeforit's59lename.
idrelativeandlabelrelativeusetheportionoftheidorlabelthatfollowstheparentdocument'sidorlabel.
Furthermore,toimposestructureanduniqueness,ifasplitdocumenthaschildrenthatarealsosplit,thatdocument(andit'schildren)willbeinaseparatesubdirectorywiththenameindex.
--scan,--noscanEnables(default)ordisablesthescanningofdocumentsforids,labels,refer-ences,indexmarks,etc,foruseinllinginrefs,cites,indexandsoon.
ItmaybeusefultodisablewhengeneratingdocumentsnotbasedontheLaTeXMLdoctype.
--crossref,--nocrossrefEnables(default)ordisablesthellinginofreferences,hrefs,etcbasedonapreviousscan(eitherfrom--scan,or--dbfile)ItmaybeusefultodisablewhengeneratingdocumentsnotbasedontheLaTeXMLdoctype.
--urlstyle=(server|negotiated|file)ThisoptiondeterminesthewaythatURLswithinthedocumentsareformatted,dependingonthewaytheyareintendedtobeserved.
Thedefault,server,eliminatesunneccessarytrailingindex.
html.
Withnegotiated,thetrail-ingleextension(typicallyhtmlorxhtml)areeliminated.
Theschemefilepreservescomplete(butrelative)urlssothatthesitecanbebrowsedasleswithoutanyserver.
--navigationtoc=(context|none)Generatesatableofcontentsinthenavigationbar;defaultisnone.
The'con-text'styleofTOC,issomewhatverboseandrevealsmoredetailnearthecurrentpage;itismostsuitablefornavigationbarsplacedontheleftorright.
OtherstylesofTOCshouldbedevelopedandaddedhere,suchasashortform.
--index,--noindexEnables(default)ordisablesthegenerationofanindexfromindexmarksem-beddedwithinthedocument.
Enablingthishasnoeffectunlessthereisanindexelementinthedocument(generatedby\printindex).
--splitindex,--nosplitindexEnablesordisables(default)thesplittingofgeneratedindexesintoseparatepagesperinitialletter.
--bibliography=pathnameSpeciesabibliographygeneratedfromaBibTeXletobeusedtollinabibli-ographyelement.
Hand-writtenbibliographiesplacedinathebibliographyenvironmentdonotneedthis.
Theoptionhasnoeffectunlessthereisanbibli-ographyelementinthedocument(generatedby\bibliography).
60APPENDIXA.
COMMANDSNotethatthisoptionprovidesthebibliographytobeusedtollinthebibliogra-phyelement(generatedby\bibliography);latexmlpostdoesnot(currently)directlyprocessandformatsuchabibliography.
--splitbibliography,--nosplitbibliographyEnablesordisables(default)thesplittingofgeneratedbibliographiesintosepa-ratepagesperinitialletter.
--prescanBydefaultlatexmlpostprocessesasingledocumentintoone(ormore;see--split)destinationlesinasinglepass.
Whengeneratingacomplicatedsiteconsistingofseveraldocumentsitmaybeadvantageoustorstscanthroughthedocumentstoextractandstore(indbfile)cross-referencingdata(suchasids,titles,urls,andsoon).
Alaterpassthenhascompleteinformationallowingalldocumentstoreferenceeachother,andalsoconstructsanindexandbibliographythatreectstheentiredocumentset.
Thesameeffect(thoughlessefcient)canbeachievedbyrunninglatexmlposttwice,providedadbfileisspecied.
--dbfile=leSpeciesalenametouseforthecrossreferencingdatawhenusingtwo-passprocessing.
Thislemayresideintheintermediatedestinationdirectory.
--sitedirectory=dirSpeciesthebasedirectoryoftheoverallwebsite.
Pathnamesinthedatabasearestoredinaformrelativetothisdirectorytomakeitmoreportable.
MathOptionsTheseoptionsspecifyhowmathshouldbeconvertedintootherfor-mats.
Multipleformatscanberequested;howtheywillbecombineddependsontheformatandotheroptions.
--mathimages,--nomathimagesRequestsordisablestheconversionofmathtoimages(pngbydefault).
Conver-sionisthedefaultforhtml4format.
--mathsvg,--nomathsvgRequestsordisablestheconversionofmathtosvgimages.
--mathimagemagnification=factorSpeciesthemagnicationusedformathimages(bothpngandsvg),iftheyaremade.
Defaultis1.
75.
--presentationmathml,--nopresentationmathmlRequestsordisablesconversionofmathtoPresentationMathML.
Conversionisthedefaultforxhtmlandhtml5formats.
61--linelength=number(Experimental)Line-breaksthegeneratedPresentationMathMLsothatitisnolongerthannumber'characters'.
--plane1ConvertsthecontentofPresentationMathMLtokenelementstotheappropriateUnicodePlane-1codepointsaccordingtotheselectedfont,whenapplicable(thedefault).
--hackplane1ConvertsthecontentofPresentationMathMLtokenelementstotheappropri-ateUnicodePlane-1codepointsaccordingtotheselectedfont,butonlyforthemathvariantsdouble-struck,frakturandscript.
Thisgivessupportforcurrent(asofAugust2009)versionsofFirefoxandMathPlayer,providedasufcientsetoffontsisavailable(eg.
STIX).
--contentmathml,--nocontentmathmlRequestsordisablesconversionofmathtoContentMathML.
Conversionisdis-abledbydefault.
Notethatthisconversionisonlypartiallyimplemented.
--openmathRequestsordisablesconversionofmathtoOpenMath.
Conversionisdisabledbydefault.
Notethatthisconversionisonlypartiallyimplemented.
--keepXMathBydefault,whenanyoftheMathMLorOpenMathconversionsareused,theintermediatemathrepresentationwillberemoved;thisoptionpreservesit;itwillbeusedassecondaryparallelmarkup,whenitfollowstheoptionsforothermathrepresentations.
GraphicsOptions--graphicimages,--nographicimagesEnables(default)ordisablestheconversionofgraphicstoweb-appropriatefor-mat(png).
--graphicsmap=sourcetype.
desttypeSpeciesamappingofgraphicsletypes.
Typically,graphicselementsspecifyagraphicslethatwillbeconvertedtoamoreappropriateletargetformat;forexample,postscriptlesusedforgraphicswithLaTeXwillbeconvertedtopngformatforuseontheweb.
AswithLaTeX,whenagraphicsleisspeciedwithoutaletype,thesystemwillsearchforthemostappropriatetargettypele.
Whenthisoptionisused,itoverridesandreplacesthedefaultsandprovidesamappingofsourcetypetodesttype.
Theoptioncanberepeatedtoprovide62APPENDIXA.
COMMANDSseveralmappings,withtheearlierformatspreferred.
Ifthedesttypeisomitted,itspeciescopyinglesoftypesourcetype,unchanged.
Thedefaultsettingsisequivalenttohavingsuppliedtheoptions:--graphicsmap=svg--graphicsmap=png--graphicsmap=gif--graphicsmap=jpg--graphicsmap=jpeg--graphicsmap=eps.
png--graphicsmap=ps.
png--graphicsmap=ai.
png--graphicsmap=pdf.
pngTherstformatsarepreferredandusedunchanged,whilethelatteronesareconvertedtopng.
--pictureimages,--nopictureimagesEnables(default)ordisablestheconversionofpictureenvironmentsandpstricksmaterialintoimages.
--svg,--nosvgEnablesordisables(default)theconversionofpictureenvironmentsandpstricksmaterialtoSVG.
Seealsolatexml,latexmlmath,LaTeXMLlatexmlmathTransformsaTeX/LaTeXmathexpressionintovariousformats.
Synopsislatexmlmath[options]texmathOptions:--mathimage=fileconvertstoimageinfile--mathsvg=fileconvertstosvgimageinfile--magnification=magspecifiesmagnificationfactor--presentationmathml=fileconvertstoPresentationMathML--pmml=filealiasfor--presentationmathml--linelength=ndolinewrappingofpMML--contentmathml=fileconverttoContentMathML--cmml=filealiasfor--contentmathml--openmath=fileconverttoOpenMath--om=filealiasfor--openmath63--XMath=fileoutputLaTeXML'sinternalformat--noparsedisablesparsingofmath(notusefulforcMMLoropenmath)--preload=fileloadsastylefile.
--includestylesallowsprocessingraw*.
styfiles(normallyitavoidsthis)--path=diraddsasearchpathforstylefiles.
--quietreducesverbosity(canrepeat)--verboseincreasesverbosity(canrepeat)--strictbemorestrictabouterrors.
--documentid=idassignanidtothedocumentroot.
--debug=packageenablesdebuggingoutputforthenamedpackage--inputencoding=encspecifytheinputencoding.
--VERSIONshowversionnumberandexit.
--helpshowsthishelpmessage.
--endsoptionsIftexmathis'-',latexmlmathreadstheTeXfromstandardinput.
Ifanyoftheoutputlesare'-',theresultisprintedonstandardoutput.
InputnotesNotethat,unlessyouarereadingtexmathfromstandardinput,thetex-mathstringwillbeprocessedbywhatevershellyouareusingbeforelatexmlmathevenseesit.
Thismeansthatmanyso-calledmetacharacters,suchasbackslashandstar,mayconfusetheshellorbechanged.
Consequently,youwillneedtoquoteand/orslashifytheinputappropriately.
Mostparticularly,\willneedtobedoubledto\\forlatexmlmathtoseeitasacontrolsequence.
Using--toexplicitlyendtheoptionlistisusefulforcaseswhenthemathstartswithaminus(andwouldotherwisebeinterpretedasanoption,probablyanunrecog-nizedone).
Alternatively,wrappingthetexmathwith{}willhidetheminus.
Simpleexamples:latexmlmath\\frac{-b\\pm\\sqrt{b2-4ac}}{2a}echo"\\sqrt{b2-4ac}"|latexmlmath--pmml=quad.
mml-Options&ArgumentsConversionOptionsTheseoptionsspecifywhatformatsthemathshouldbecon-vertedto.
Ineachcase,thedestinationleisgiven.
Exceptformathimage,thelecanbegivenas'-',inwhichcasetheresultisprintedtostandardoutput.
Ifnoconversionoptionisspecied,thedefaultistooutputpresentationMathMLtostandardoutput.
--mathimage=leRequestsconversiontopngimages.
--mathsvg=leRequestsconversiontosvgimages.
64APPENDIXA.
COMMANDS--magnification=factorSpeciesthemagnicationusedformathimage.
Defaultis1.
75.
--presentationmathml=leRequestsconversiontoPresentationMathML.
--linelength=number(Experimental)Line-breaksthegeneratedPresentationMathMLsothatitisnolongerthannumber'characters'.
--plane1ConvertsthecontentofPresentationMathMLtokenelementstotheappropriateUnicodePlane-1codepointsaccordingtotheselectedfont,whenapplicable.
--hackplane1ConvertsthecontentofPresentationMathMLtokenelementstotheappropri-ateUnicodePlane-1codepointsaccordingtotheselectedfont,butonlyforthemathvariantsdouble-struck,frakturandscript.
Thisgivessupportforcurrent(asofAugust2009)versionsofFirefoxandMathPlayer,providedasufcientsetoffontsisavailable(eg.
STIX).
--contentmathml=leRequestsconversiontoContentMathML.
Notethatthisconversionisonlypar-tiallyimplemented.
--openmath=leRequestsconversiontoOpenMath.
Notethatthisconversionisonlypartiallyimplemented.
--XMath=leRequestsconvertiontoLaTeXML'sinternalformat.
OtherOptions--preload=moduleRequeststheloadingofanoptionalmoduleorpackage.
ThismaybeusefuliftheTeXcodedoesnotspeciclyrequirethemodule(eg.
throughinputorusepackage).
Forexample,use--preload=LaTeX.
pooltoforceLaTeXmode.
--includestylesThisoptionalallowsprocessingofstyleles(leswithextensionssty,cls,clo,cnf).
Bydefault,theselesareignoredunlessalatexmlimplementationofthemisfound(withanextensionofltxml).
65Thesestylelesgenerallyfallintotwoclasses:Thosethatmerelyaffectdocu-mentstyleareignorableintheXML.
Othersdenenewmarkupanddocumentstructure,oftenusingdeeperLaTeXmacrostoachievetheirends.
Althoughtheomissionwillleadtoothererrors(missingmacrodenitions),itisunlikelythatprocessingtheTeXcodeinthestylelewillleadtoacorrectdocument.
--path=dirAdddirtothesearchpathsusedwhensearchingforles,modules,styleles,etc;somewhatlikeTEXINPUTS.
Thisoptioncanberepeated.
--documentid=idAssignsanIDtotherootelementoftheXMLdocument.
ThisIDisgenerallyinheritedastheprexofID'sonallotherelementswithinthedocument.
ThisisusefulwhenconstructingasiteofmultipledocumentssothatallnodeshaveuniqueIDs.
--quietReducestheverbosityofoutputduringprocessing,usedtwiceisprettysilent.
--verboseIncreasestheverbosityofoutputduringprocessing,usedtwiceisprettychatty.
Canbeusefulforgettingmoredetailswhenerrorsoccur.
--strictSpeciesastrictprocessingmode.
Bydefault,undenedcontrolsequencesandinvaliddocumentconstructs(thatviolatetheDTD)givewarningmessages,butattempttocontinueprocessing.
Using--strictmakesthemgeneratefatalerrors.
--inputencoding=encodingSpecifytheinputencoding,eg.
--inputencoding=iso-8859-1.
Theen-codingmustbeoneknowntoPerl'sEncodepackage.
NotethatthisonlyenablesthetranslationoftheinputbytestoUTF-8usedinternallybyLaTeXML,butdoesnotaffectcatcodes.
ItisusuallybettertouseLaTeX'sinputencpackage.
Notethatthisdoesnotaffecttheoutputencoding,whichisalwaysUTF-8.
--VERSIONShowstheversionnumberoftheLaTeXMLpackage.
.
--debug=packageEnablesdebuggingoutputforthenamedpackage.
ThepackageisgivenwithouttheleadingLaTeXML::.
--helpShowsthishelpmessage.
66APPENDIXA.
COMMANDSBUGSThisprogramrunsmuchslowerthanwouldseemjustied.
ThisisaresultoftherelativelyslowinitializationincludingloadingTeXandLaTeXmacrosandtheschema.
Normally,thiscostwouldbeammortizedoverlargedocuments,whereas,inthiscase,we'reprocessingasinglemathexpression.
Seealsolatexml,latexmlpost,LaTeXMLAppendixBImplementedBindingsBindingsforthefollowingclassesandpackagesaresuppliedwiththedistribution:classes:IEEEtran,JHEP,JHEP2,JHEP3,OmniBus,PoS,a0poster,aa,aastex,ac-mart,aipproc,amsart,amsbook,amsproc,article,book,elsart,elsarticle,emu-lateapj,gen-j-l,gen-m-l,gen-p-l,ieeeconf,iopart,llncs,mn,mn2e,mnras,mod-erncv,quantumarticle,report,revtex,revtex4-1,revtex4,slides,subles,svjour,svjour3,svmultpackages:a0size,a4,a4wide,aasmacros,aasms,aaspp,aastex,accents,acronym,ae,aecompl,afterpage,aipproc,algc,algcompatible,algmatlab,algorithm,al-gorithm2e,algorithmic,algorithmicx,algpascal,algpseudocode,alltt,amsbsy,amscd,amsfonts,amsgen,amsmath,amsopn,amsppt,amsrefs,amssymb,am-stex,amstext,amsthm,amsxtra,apjfonts,appendix,array,attachle,auth-blk,avant,babel,balance,bbm,bbold,beton,bibunits,blindtext,bm,book-man,booktabs,braket,breakurl,calc,calrsfs,cancel,caption,cases,ccfonts,chancery,chapterbib,charter,chngcntr,circuitikz,cite,citesort,cleveref,cm-bright,color,colordvi,colortbl,comment,concmath,courier,crop,cropmark,csquotes,dcolumn,deluxetable,doublespace,dsfont,ellipsis,elsart,empheq,emulateapj,emulateapj5,endnotes,english,enumerate,enumitem,epigraph,epsf,epsg,epstopdf,esint,etex,etoolbox,eucal,eufrak,euler,eulervm,eu-rosym,euscript,expl3,exscale,fancyhdr,fancyheadings,x-cm,xltx2e,after,eqn,oat,oatg,oatt,oatpag,owchart,ushend,fontenc,fontspec,foot-misc,footnote,fourier,framed,fullpage,gensymb,geometry,german,glos-saries,graphics,graphicx,grfle,helvet,here,hhline,html,hyperref,hy-perxmp,icml,iuatex,ifpdf,ifthen,ifvtex,ifxetex,import,indentrst,in-putenc,iopams,jheppub,keyval,lastpage,latexml,latexsym,lineno,lipsum,listings,listingsutf8,lmodern,longtable,lscape,luximono,lxRDFa,makecell,makeidx,marvosym,mathbbol,mathdots,mathpazo,mathpple,mathptm,math-ptmx,mathrsfs,mathtools,microtype,mleftright,multicol,multido,multirow,nameref,natbib,neurips,newcent,newoat,newlfont,newtxmath,newtxtext,ngerman,nicefrac,nopageno,ntheorem,numprint,palatino,paralist,parskip,pdscape,pdfpages,pdfsync,pgf,pgfplots,physics,pifont,placeins,preview,6768APPENDIXB.
BINDINGSpsg,pslatex,pspicture,pst-grad,pst-node,pstricks,pxfonts,ragged2e,rel-size,remreset,revsymb,revtex,revtex4,rotate,rotating,rsfs,scalefnt,sect-sty,setspace,showkeys,sidecap,siunitx,slashed,soul,srcltx,stoats,stmaryrd,subcaption,subg,subgure,subles,suboat,supertabular,svg,t1enc,table-footnote,tabularx,tabulary,textcase,textcomp,texvc,theorem,thm-restate,thmtools,threeparttable,tikz-3dplot,tikz,times,titlesec,titling,tocbibind,todonotes,tracefnt,transparent,turing,twoopt,txfonts,type1cm,ulem,under-score,undertilde,units,upgreek,upref,url,utopia,varioref,varwidth,verbatim,vmargin,wasysym,wiki,wrapg,xargs,xcolor,xkeyval,xkvview,xparse,xs-pace,xunicode,yfontsAppendixCPerlModulesDocumentationLaTeXMLAconverterthattransformsTeXandLaTeXintoXML/HTML/MathMLSynopsisuseLaTeXML;my$converter=LaTeXML->get_converter($config);my$converter=LaTeXML->new($config);$converter->prepare_session($opts);$converter->initialize_session;#SHOULDBEINTERNAL$hashref=$converter->convert($tex);my($result,$log,$status)=map{$hashref->{$_}}qw(resultlogstatus);DescriptionLaTeXMLisaconverterthattransformsTeXandLaTeXintoXML/HTML/MathMLandotherformats.
ALaTeXMLobjectrepresentsaconverterinstanceandcanconvertlesonde-mand,untildismissed.
Methodsmy$converter=LaTeXML->new($config);CreatesanewconverterobjectforagivenLaTeXML::Common::Congobject,$cong.
my$converter=LaTeXML->getconverter($config);Eithercreates,orlooksupacachedconverterforthe$congcongurationob-ject.
6970APPENDIXC.
MODULES$converter->preparesession($opts);Top-levelpreparationroutinethatpreparesbothacorrectoptionsobjectandaninitializedLaTeXMLobject,usingthe"initializeoptions"and"initial-izesession"routines,whenneeded.
Containsoptimizationchecksthatskipinitializationsunlessnecessary.
Alsoaddssupportforpartialoptionspecicationsduringdaemonruntime,fallingbackontheoptiondefaultsgivenwhenconverterobjectwascreated.
my($result,$status,$log)=$converter->convert($tex);ConvertsaTeXinputstring$texintotheLaTeXML::Core::Documentobject$result.
Suppliesdetailedinformationoftheconversionlog($log),aswellasabriefconversionstatussummary($status).
INTERNALROUTINES$converter->initializesession($opts);Givenanoptionshashreference$opts,initializesasessionbycreatinganewLaTeXMLobjectwithinitializedstateandloadingadaemonizedpreamble(ifany).
Setsthe"ready"agtotrue,makingasubsequent"convert"callimmediatelypossible.
my$latexml=newlatexml($opts);CreatesanewLaTeXMLobjectandinitializesitsstate.
my$postdoc=$converter->convertpost($dom);Post-processesaLaTeXML::Core::Documentobject$domintoanalformat,basedonthepreferencesspeciedin$$self{opts}.
Typicallyusedonlyinternallybyconvert.
$converter->bindlog;BindsSTDERRtoa"log"eldinthe$converterobjectmy$log=$converter->flushlog;Flushesouttheaccumulatedconversionloginto$log,resetingSTDERRtoitsusualstream.
LaTeXML::GlobalGlobalexportsusedwithinLaTeXML,andinPackages.
SynopsisuseLaTeXML::Global;71DescriptionThismoduleexportsthevariousconstantsandconstructorsthatareusefulthroughoutLaTeXML,andinPackageimplementations.
Globalstate$STATE;ThisisboundtothecurrentlyactiveLaTeXML::Core::Statebyanin-stanceofLaTeXMLduringprocessing.
LaTeXML::PackageSupportforpackageimplementationsanddocumentcustomization.
SynopsisThispackagedenesandexportsmostoftheproceduresuserswillneedtocustomizeorextendLaTeXML.
TheLaTeXMLimplementationofsomepackagemightlooksome-thinglikethefollowing,butseetheinstalledLaTeXML/Packagedirectoryforreal-isticexamples.
packageLaTeXML::Package::pool;#toputnewsubs&variablesincommonpooluseLaTeXML::Package;#toloadthesedefinitionsusestrict;#goodstyleusewarnings;##Load"anotherpackage"RequirePackage('anotherpackage');##Asimplemacro,justlikeinTeXDefMacro('\thesection','\thechapter.
\roman{section}');##AconstructordefineshowacontrolsequencegeneratesXML:DefConstructor('\thanks{}',"#1");##Andasimpleenvironment.
.
.
DefEnvironment('{abstract}','#body');##Amathsymbol\RealtostandfortheReals:DefMath('\Real',"\x{211D}",role=>'ID');##Orasemanticfloor:DefMath('\floor{}','\left\lfloor#1\right\rfloor');##Moreesoteric.
.
.
#UseaRelaxNGschemaRelaxNGSchema("MySchema");#OruseaspecialDocTypeifyouhaveto:72APPENDIXC.
MODULES#DocType("rootelement",#"-//YourSite//YourDocType",'your.
dtd',#prefix=>"http://whatever/");##AllowsometagelementstobeautomaticallyclosedifneededTag('prefix:sometag',autoClose=>1);##Don'tforgetthis,soperlknowsthepackageloaded.
1;DescriptionThismoduleprovidesalargesetofutilitiesanddeclarationsthatareusefulforwriting'bindings':LaTeXML-specicimplementationsofasetofcontrolsequencessuchaswouldbedenedinaLaTeXstyleorclassle.
TheyarealsousefulforcontrollingandcustomizationofLaTeXML'sprocessing.
SeetheLaTeXML::Package/"Seealso"section,below,foradditionallower-levelmodulesimported&re-exported.
Toalimitedextent(andcurrentlyonlywhenexplicitlyenabled),LaTeXMLcanprocesstherawTeXcodefoundinstyleles.
However,topreservedocumentstructureandsemantics,aswellasforefciency,itisusuallynecessarytosup-plyaLaTeXML-specic'binding'forstyleandclassles.
Forexample,abindingmypackage.
sty.
ltxmlwouldencodeLaTeXML-specicimplementationsofallthecontrolsequencesinmypackage.
stysothat\usepackage{mypackage}wouldwork.
Similarlyformyclass.
cls.
ltxml.
Additionally,document-specicbindingscanbesupplied:beforeprocessingaTeXsourcele,egmydoc.
tex,La-TeXMLwillautomaticallyincludethedenitionsandsettingsinmydoc.
latexml.
These.
ltxmland.
latexmllesshouldbeplacedLaTeXML'ssearchpaths,wherewillndthem:eitherinthecurrentdirectoryorinadirectorygiventothe--pathoption,orpossiblyaddedtothevariableSEARCHPATHS).
SinceLaTeXMLmimicsTeX,afamiliaritywithTeX'sprocessingmodeliscrit-ical.
LaTeXMLmodels:catcodesandtokens(SeeLaTeXML::Core::Token,LaTeXML::Core::Tokens)whichareextractedfromtheplainsourcetextcharac-tersbytheLaTeXML::Core::Mouth;LaTeXML::Package/Macros,whichareexpandedwithintheLaTeXML::Core::Gullet;andLaTeXML::Package/Primitives,whicharedigestedwithintheLaTeXML::Core::StomachtoproduceLaTeXML::Core::Box,LaTeXML::Core::List.
AkeyadditionalfeatureistheLaTeXML::Package/Constructors:whendigestedtheygenerateaLaTeXML::Core::Whatsitwhich,uponabsorb-tionbyLaTeXML::Core::Document,insertstextorXMLfragmentsinthenaldocumenttree.
Notation:Manyofthefollowingformstakecodereferencesasargumentsorop-tions.
Thatis,eitherareferencetoadenedsub,eg.
\&somesub,orananonymousfunctionsubTodocumentthesecases,andtheargumentsthatarepassedineachcase,we'lluseanotationlikecode($stomach,.
.
.
).
ControlSequencesManyofthefollowingformsdenethebehaviourofcontrolsequences.
WhileinTeXyou'lltypicallyonlydenemacros,LaTeXMLiseffec-73tivelyredeningTeXitself,sowedeneLaTeXML::Package/MacrosaswellasLaTeXML::Package/Primitives,LaTeXML::Package/Registers,LaTeXML::Package/ConstructorsandLaTeXML::Package/Environments.
Thesedenethebehaviourofthesecontrolsequenceswhenprocessedduringthevari-ousphasesofLaTeX'simitationofTeX'sdigestivetract.
PrototypesLaTeXMLusesamoreconvienientmethodofspecifyingparame-terpatternsforcontrolsequences.
Therstargumenttoeachofthesedeningforms(DefMacro,DefPrimive,etc)isaprototypeconsistingofthecontrolsequencebe-ingdenedalongwiththespecicationofparametersrequiredbythecontrolsequence.
Eachparameterdescribeshowtoparsetokensfollowingthecontrolsequenceintoar-gumentsorhowtodelimitthem.
TosimplifycodingandcapturecommonidiomsinTeX/LaTeXprogramming,latexml'sparameterspecicationsaremoreexpressivethanTeX's\deforLaTeX's\newcommand.
ExamplesoftheprototypesforfamiliarTeXorLaTeXcontrolsequencesare:DefConstructor('\usepackage[DefPrimitive('\multiplyVariableSkipKeyword:byNumber',.
.
DefPrimitive('\newcommandOptionalMatch:*DefToken[Thegeneralsyntaxforparameterspecicationis{spec}readsaregularTeXargument.
speccanbeomitted(ie.
{}).
Otherwisespecisitselfaparameterspecicationandtheargumentisreparsedtoaccordingly.
({}isashorthandforPlain.
)[spec]readsanLaTeX-styleoptionalargument.
speccanbeomitted(ie.
{}).
Other-wise,ifspecisoftheformDefault:stuff,thenstuffwouldbethedefaultvalue.
Otherwisespecisitselfaparameterspecicationandtheargument,ifsupplied,isreparsedaccordingtothatspecication.
([]isashorthandforOptional.
)TypeReadsanargumentofthegiventype,whereeitherTypehasbeendeclared,orthereexistsaReadTypefunctionaccessiblefromLaTeXML::Package::Pool.
Seetheavailabletypes,below.
Type:value|Type:value1:value2.
.
.
TheseformsinvoketheparserforTypebutpassadditionalTokenstothereaderfunction.
Typicallythiswouldsupplydefaultsorparameterstoamatch.
OptionalTypeSimilartoType,butitisnotconsideredanerrorifthereaderreturnsundef.
74APPENDIXC.
MODULESSkipTypeSimilartoOptionalType,butthevaluereturnedfromthereaderisignored,anddoesnotoccupyapositionintheargumentslist.
ThepredenedargumentTypesareasfollows.
Plain,SemiverbatimReadsastandardTeXargumentbeingeitherthenexttoken,orifthenexttokenisan{,thebalancedtokenlist.
InthecaseofSemiverbatim,manycatcodesaredisabled,whichishandyforURL's,labelsandsimilar.
Token,XTokenReadasingleTeXToken.
ForXToken,ifthenexttokenisexpandable,itisrepeatedlyexpandeduntilanunexpandabletokenremains,whichisreturned.
Number,Dimension,Glue|MuGlueReadanObjectcorrespondingtoNumber,Dimension,GlueorMuGlue,usingTeX'srulesforparsingtheseobjects.
Until:match|XUntil:match>Readstokensuntilamatchtothetokensmatchisfound,returningthetokenspre-cedingthematch.
ThiscorrespondstoTeXdelimitedarguments.
ForXUntil,tokensareexpandedastheyarematchedandaccumulated(butabracereadsandaccumulatestillamatchingclosebrace,withoutexpanding).
UntilBraceReadstokensuntilthenextopenbrace{.
ThiscorrespondstothepeculiarTeXconstruct\def\foo#{.
.
.
.
Match:match(|match)*|Keyword:match(|match)*>Readstokensexpectingamatchtooneofthetokenlistsmatch,returningtheonethatmatches,orundef.
ForKeyword,caseandcatcodeofthematchesareignored.
Additionally,anyleadingspacesareskipped.
BalancedReadtokensuntilaclosing},butrespectingnested{}pairs.
BalancedParenReadaparenthesisdelimitedtokens,butdoesnotbalanceanynestedparenthe-ses.
Undigested,Digested,DigestUntil:matchThesetypesaltertheusualsequenceoftokenizationanddigestioninseparatestages(likeTeX).
AUndigestedparameterinhibitsdigestioncompletelyandremainsintokenform.
ADigestedparametergetsdigesteduntilthe(re-quired)opening{isbalanced;thisisusefulwhenthecontentwouldusuallyneedtohavebeenprotectedinordertocorrectlydealwithcatcodes.
DigestUntildigeststokensuntilatokenmatchingmatchisfound.
75VariableReadsatoken,expandingifnecessary,andexpectsacontrolsequencenamingawritableregister.
Ifsuchisfound,itreturnsanarrayofthecorrespondingdenitionobject,andanyargumentsrequiredbythatdenition.
SkipSpaces,Skip1SpaceSkipsone,oranynumberof,spacetokens,ifpresent,butcontributesnothingtotheargumentlist.
CommonOptionsscope=>'local'|'global'|scopeMostdeningcommandsacceptanoptiontocontrolhowthedenitionisstored,forglobalorlocaldenitions,orusinganamedscopeAnamedscopesavesasetofdenitionsandvaluesthatcanbeactivatedatalatertime.
Particularlyinterestingformsofscopearethosethatgetautomaticallyacti-vateduponchangesofcounterandlabel.
Forexample,denitionsthathavescope=>'section:1.
1'willbeactivatedwhenthesectionnumberis"1.
1",andwillbedeactivatedwhenthatsectionends.
locked=>booleanThisoptioncontrolswhetherthisdenitionislockedfromfurtherchangesintheTeXsources;thiskeepslocal'customizations'byanauthorfromoverridingimportantLaTeXMLdenitionsandbreakingtheconversion.
MacrosDefMacro(prototype,expansion,%options);Denesthemacroexpansionforprototype;amacrocontrolsequencethatisexpandedduringmacroexpansiontimeintheLaTeXML::Core::Gullet.
Theexpansionshouldbeoneoftokens|string|code($gullet,@args)>:astringwillbetokenizeduponrstusage.
Anymacroargumentswillbesubstitutedforparameterindicators(eg#1)inthetokensortokenizedstringandtheresultisusedastheexpansionofthecontrolsequence.
Ifcodeisused,itiscalledatexpansiontimeandshouldreturnalistoftokensasitsresult.
DefMacrooptionsarescope=>scope,locked=>booleanSeeLaTeXML::Package/"CommonOptions".
mathactive=>booleanspeciesadenitionthatwillonlybeexpandedinmathmode;thecontrolsequencemustbeasinglecharacter.
76APPENDIXC.
MODULESExamples:DefMacro('\thefootnote','\arabic{footnote}');DefMacro('\today',sub{ExplodeText(today());});DefMacroI(cs,paramlist,expansion,%options);InternalformofDefMacrowherethecontrolsequenceandparameterlisthavealreadybeenseparated;usefulfordenitionsfromwithincode.
Also,slightlymoreefcientformacroswithnoarguments(useundefforparamlist),andusefulforobscurecaseslikedening\begin{something*}asaMacro.
ConditionalsDefConditional(prototype,test,%options);Denesaconditionalforprototype;acontrolsequencethatisprocesseddur-ingmacroexpansiontime(intheLaTeXML::Core::Gullet).
Acondi-tionalcorrespondstoaTeX\if.
Ifthetestisundef,a\newiftypeofcondi-tionalisdened,whichiscontrolledwithcontrolsequenceslike\footrueand\foofalse.
Otherwisethetestshouldbecode($gullet,@args)(withthecontrolsequence'sarguments)thatiscalledatexpandtimetodeterminethecondition.
Dependingonwhethertheresultofthatevaluationreturnsatrueorfalsevalue(intheusualPerlsense),theresultoftheexpansioniseithertherstorelsecodefollowing,intheusualTeXsense.
DefConditionaloptionsarescope=>scope,locked=>booleanSeeLaTeXML::Package/"CommonOptions".
skipper=>code($gullet)Thisoptionisonlyusedtodene\ifcase.
Example:DefConditional('\ifmmode',sub{LookupValue('IN_MATH');});DefConditionalI(cs,paramlist,test,%options);InternalformofDefConditionalwherethecontrolsequenceandparam-eterlisthavealreadybeenparsed;usefulfordenitionsfromwithincode.
Also,slightlymoreefcientforconditinalwithnoarguments(useundefforparamlist).
IfCondition($ifcs,@args)IfConditionallowsyoutotestaconditionalfromwithinperl.
Thussomethinglikeif(IfCondition('\ifmmode')){domath}else{dotext}mightbeequivalenttoTeX's\ifmmodedomath\elsedotext\fi.
77PrimitivesDefPrimitive(prototype,replacement,%options);Denesaprimitivecontrolsequence;aprimitiveisprocessedduringdigestion(intheLaTeXML::Core::Stomach),aftermacroexpansionbutbeforeConstructiontime.
PrimitivecontrolsequencesgenerateBoxesorLists,gen-erallycontainingbasicUnicodecontent,ratherthanstructuredXML.
Primitivecontrolsequencesarealsoexecutedforsideeffectduringdigestion,effectingchangestotheLaTeXML::Core::State.
ThereplacementcanbeastringusedasthetextcontentofaBoxtobecreated(usingthecurrentfont).
Alternativelyreplacementcanbecode($stomach,@args)(withthecontrolsequence'sarguments)whichisinvokedatdigestiontime,prob-ablyforside-effect,butreturningBoxesorListsornothing.
replacementmayalsobeundef,whichcontributesnothingtothedocument,butdoesrecordtheTeXcodethatcreatedit.
DefPrimitiveoptionsarescope=>scope,locked=>booleanSeeLaTeXML::Package/"CommonOptions".
mode=>('text'|'displaymath'|'inlinemath')Changestothismodeduringdigestion.
font=>{%fontspec}Speciesthefonttouse(seeLaTeXML::Package/"Fonts").
Ifthefontchangeistoonlyapplytomaterialgeneratedwithinthiscommand,youwouldalsouse>;otherwise,thefontwillremainineffectafterwardsasforafontswitchingcommand.
bounded=>booleanIftrue,TeXgrouping(ie.
{})isenforcedaroundthisinvocation.
requireMath=>boolean,forbidMath=>booleanspecieswhetherthegivenconstructorcanonlyappear,orcannotappear,inmathmode.
beforeDigest=>code($stomach)suppliesahooktoexecuteduringdigestionjustbeforethemainpartoftheprimitiveisexecuted(andbeforeanyargumentshavebeenread).
Thecodeshouldeitherreturnnothing(return;)oralistofdigesteditems(Box's,List,Whatsit).
ItcanthuschangetheStateand/oraddtothedigestedoutput.
afterDigest=>code($stomach)suppliesahooktoexecuteduringdigestionjustafterthemainpartoftheprimitiveieexecuted.
itshouldeitherreturnnothing(return;)ordigesteditems.
ItcanthuschangetheStateand/oraddtothedigestedoutput.
78APPENDIXC.
MODULESisPrefix=>booleanindicateswhetherthisisaprextypeofcommand;ThisisonlyusedforthespecialTeXassignmentprexes,like\global.
Example:DefPrimitive('\begingroup',sub{$_[0]->begingroup;});DefPrimitiveI(cs,paramlist,code($stomach,@args),%options);InternalformofDefPrimitivewherethecontrolsequenceandparameterlisthavealreadybeenseparated;usefulfordenitionsfromwithincode.
RegistersDefRegister(prototype,value,%options);Denesaregisterwithvalueastheinitialvalue(aNumber,Dimension,Glue,MuGlueorTokens---Ihaven'thandledBox'syet).
Usually,theprototypeisjustthecontrolsequence,butregistersarealsohandledbyprototypeslike\count{Number}.
DefRegisterarrangesthattheregistervaluecanbeac-cessedwhenanumeric,dimension,.
.
.
valueisbeingread,andalsodenesthecontrolsequenceforassignment.
Optionsarereadonly=>booleanspeciesifitisnotallowedtochangethisvalue.
getter=>code(@args),setter=>code($value,@args)BydefaultvalueisstoredintheState'sValuetableunderanamecon-catenatingthecontrolsequenceandargumentvalues.
Theseoptionsallowothermeansoffetchingandstoringthevalue.
Example:DefRegister('\pretolerance',Number(100));DefRegisterI(cs,paramlist,value,%options);InternalformofDefRegisterwherethecontrolsequenceandparameterlisthavealreadybeenparsed;usefulfordenitionsfromwithincode.
79ConstructorsDefConstructor(prototype,$replacement,%options);TheConstructoriswhereLaTeXMLreallystartsgettinginteresting;invokingthecontrolsequencewillgenerateanarbitraryXMLfragmentinthedocumenttree.
Morespecically:duringdigestion,theargumentswillbereadanddi-gested,creatingaLaTeXML::Core::Whatsittorepresenttheobject.
DuringabsorbtionbytheLaTeXML::Core::Document,theWhatsitwillgeneratetheXMLfragmentaccordingtoreplacement.
Thereplacementcanbecode($document,@args,%properties)whichiscalleddur-ingdocumentabsorbtiontocreatetheappropriateXML(SeethemethodsofLaTeXML::Core::Document).
Moreconveniently,replacementcanbeanpattern:simplyabitofXMLasastringwithcertainsubstitutionstobemade.
Thesubstitutionsareofthefollow-ingforms:#1,#2.
.
.
#nameThesearereplacedbythecorrespondingargument(for#1)orproperty(for#name)storedwiththeWhatsit.
Eachareturnedintoastringwhenitap-pearsasinanattributeposition,orrecursivelyprocessedwhenitappearsascontent.
&function(@args)Anotherformofsubstitutedvalueisprexedwith&whichinvokesafunc-tion.
Forexample,&func(#1)wouldinvokethefunctionfuncontherstargumenttothecontrolsequence;whatitreturnswillbeinsertedintothedocument.
test(pattern)ortest(ifpattern)(elsepattern)Patternscanbeconditionallizedusingthisform.
Thetestisanyoftheaboveexpressions(eg.
#1),consideredtrueiftheresultisnon-empty.
Thus#1()wouldaddtheemptyelementfooiftherstargumentweregiven.
Iftheconstuctorbeginswith,theXMLfragmentisallowedtooatuptoaparentnodethatisallowedtocontainit,accordingtotheDocumentType.
TheWhatsitpropertyfontisdenedbydefault.
AdditionalpropertiesbodyandtraileraredenedwhencaptureBodyistrue,orforenviron-ments.
Byusing$whatsit->setProperty(key=>$value);withinafterDigest,orbyusingthepropertiesoption,otherpropertiescanbeadded.
DefConstructoroptionsarescope=>scope,80APPENDIXC.
MODULESlocked=>booleanSeeLaTeXML::Package/"CommonOptions".
mode=>mode,font=>{%fontspec},bounded=>boolean,requireMath=>boolean,forbidMath=>booleanTheseoptionsarethesameasforLaTeXML::Package/Primitivesreversion=>texstring|code($whatsit,#1,#2,.
.
.
)speciesthereversionoftheinvocationbackintoTeXtokens(ifthedefaultreversionisnotappropriate).
Thetextstringstringcaninclude#1,#2.
.
.
Thecodeiscalledwiththe$whatsitanddigestedargumentsandmustreturnalistofToken's.
alias=>controlsequenceprovidesacontrolsequencetobeusedinthereversioninsteadoftheonedenedintheprototype.
Thisisaconvenientalternativeforrever-sionwhena'public'commandconditionallyexpandsintoaninternalone,butthereversionshouldbeforthepubliccommand.
sizer=>string|code($whatsit)specieshowtocompute(approximate)thedisplayedsizeoftheobject,ifthatsizeiseverneeded(typicallyneededforgraphicsgeneration).
Ifastringisgiven,itshouldcontainonlyasequenceof#1or#nametoaccessargumentsandpropertiesoftheWhatsit:thesizeiscomputedfromtheseitemslayedoutside-by-side.
Ifcodeisgiven,itshouldreturnthethreeDimensions(width,heightanddepth).
Ifneitherisgiven,andthereversionspecicationisofsuitibleformat,itwillbeusedforthesizer.
properties=>{%properties}|code($stomach,#1,#2.
.
.
)suppliesadditionalpropertiestobesetonthegeneratedWhatsit.
Intherstform,thevaluescanbeofanytype,butifavalueisacodereferences,ittakesthesameargs($stomach,#1,#2,.
.
.
)andshouldreturnthevalue;itisexecutedbeforecreatingtheWhatsit.
Inthesecondform,thecodeshouldreturnahashofproperties.
beforeDigest=>code($stomach)suppliesahooktoexecuteduringdigestionjustbeforetheWhatsitiscre-ated.
Thecodeshouldeitherreturnnothing(return;)oralistofdigesteditems(Box's,List,Whatsit).
ItcanthuschangetheStateand/oraddtothedigestedoutput.
afterDigest=>code($stomach,$whatsit)suppliesahooktoexecuteduringdigestionjustaftertheWhatsitiscreated(andsotheWhatsitalreadyhasitsargumentsandproperties).
Itshouldeitherreturnnothing(return;)ordigesteditems.
ItcanthuschangetheState,modifytheWhatsit,and/oraddtothedigestedoutput.
81beforeConstruct=>code($document,$whatsit)suppliesahooktoexecutebeforeconstructingtheXML(generatedbyre-placement).
afterConstruct=>code($document,$whatsit)SuppliescodetoexecuteafterconstructingtheXML.
captureBody=>boolean|Tokeniftrue,arbitraryfollowingmaterialwillbeaccumulatedintoa'body'untilthecurrentgroupinglevelisreverted,ortilltheTokenisencounterediftheoptionisaToken.
ThisbodyisavailableasthebodypropertyoftheWhatsit.
Thisisusedbyenvironmentsandmath.
nargs=>nargsThisgivesanumberofargsforcaseswhereitcan'tbeinfereddirectlyfromtheprototype(eg.
whenmoreargsareexplicitlyreadbyhooks).
DefConstructorI(cs,paramlist,replacement,%options);InternalformofDefConstructorwherethecontrolsequenceandparameterlisthavealreadybeenseparated;usefulfordenitionsfromwithincode.
DefMath(prototype,tex,%options);Acommonshorthandconstructor;itdenesacontrolsequencethatcreatesamathematicalobject,suchasasymbol,functionoroperatorapplication.
Theop-tionsgivencaneffectivelycreatesemanticmacrosthatcontributetotheeventualparsingofmathematicalcontent.
Inparticular,itgeneratesanXMDualusingthereplacementtexforthepresentation.
ThecontentinformationisdrawnfromthenameandoptionsDefMathacceptstheoptions:scope=>scope,locked=>booleanSeeLaTeXML::Package/"CommonOptions".
font=>{%fontspec},reversion=>reversion,alias=>cs,sizer=>sizer,properties=>properties,beforeDigest=>code($stomach),afterDigest=>code($stomach,$whatsit),TheseoptionsarethesameasforLaTeXML::Package/Constructorsname=>namegivesanameattributefortheobject82APPENDIXC.
MODULESomcd=>cdnamegivestheOpenMathcontentdictionarythatnameisfrom.
role=>grammaticalroleaddsagrammaticalroleattributetotheobject;thisspeciesthegrammati-calrolethattheobjectplaysinsurroundingexpressions.
Thisdirelyneedsdocumentation!
mathstyle=>('display'|'text'|'script'|'scriptscript')Controlswhetherthethisobjectwillbepresentedinaspecicmathstyle,oraccordingtothecurrentsettingofmathstyle.
scriptpos=>('mid'|'post')Controlsthepositioningofanysubandsuper-scriptsrelativetothisobject;whethertheybestackedoverorunderit,orwhethertheywillappearintheusualposition.
TeX.
pooldenesafunctiondoScriptpos()whichisusefulforoperatorslike\suminthatitsetstomidpositionwhenindisplaystyle,otherwisepost.
stretchy=>booleanWhetherornottheobjectisstretchywhendisplayed.
operatorrole=>grammaticalrole,operatorscriptpos=>boolean,operatorstretchy=>booleanThesethreearesimilartorole,scriptposandstretchy,butareusedinunusualcases.
Theseapplytothegivenattributestotheoperatortokeninthecontentbranch.
nogroup=>booleanNormally,thesecommandsaredigestedwithanimplicitgroupingaroundthem,localizingchangestofonts,etc;noggroup=>1inhibitsthis.
Example:DefMath('\infty',"\x{221E}",role=>'ID',meaning=>'infinity');DefMathI(cs,paramlist,tex,%options);InternalformofDefMathwherethecontrolsequenceandparameterlisthavealreadybeenseparated;usefulfordenitionsfromwithincode.
EnvironmentsDefEnvironment(prototype,replacement,%options);DenesanEnvironmentthatgeneratesaspecicXMLfragment.
replacementisofthesameformasforDefConstructor,butwillgenerallyincludereference83tothe#bodyproperty.
Uponencounteringa\begin{env}:themodeisswitched,ifneeded,elseanewgroupisopened;thentheenvironmentnameisnoted;thebeforeDigesthookisrun.
ThentheWhatsitrepresentingthebegincommand(butultimatelythewholeenvironment)iscreatedandtheafterDi-gestBeginhookisrun.
Next,thebodywillbedigestedandcollecteduntilthebalancing\end{env}.
Then,anyafterDigesthookisrun,theenviron-mentisended,nallythemodeisendedorthegroupisclosed.
Thebodyand\end{env}whatsitareaddedtothe\begin{env}'swhatsitasbodyandtrailer,respectively.
DefEnvironmenttakesthefollowingoptions:scope=>scope,locked=>booleanSeeLaTeXML::Package/"CommonOptions".
mode=>mode,font=>{%fontspec}requireMath=>boolean,forbidMath=>boolean,TheseoptionsarethesameasforLaTeXML::Package/Primitivesreversion=>reversion,alias=>cs,sizer=>sizer,properties=>properties,nargs=>nargsTheseoptionsarethesameasforLaTeXML::Package/DefConstructorbeforeDigest=>code($stomach)ThishookissimilartothatforDefConstructor,butitappliestothe\begin{environment}controlsequence.
afterDigestBegin=>code($stomach,$whatsit)ThishookissimilartoDefConstructor'safterDigestbutitap-pliestothe\begin{environment}controlsequence.
TheWhatsitistheoneforthebeginningcontrolsequence,butrepresentstheenvironmentasawhole.
NotethatalthoughtheargumentsandpropertiesarepresentintheWhatsit,thebodyoftheenvironmentisnotyetavailable!
beforeDigestEnd=>code($stomach)ThishookissimilartoDefConstructor'sbeforeDigestbutitap-pliestothe\end{environment}controlsequence.
afterDigest=>code($stomach,$whatsit)ThishookissimlartoDefConstructor'safterDigestbutitappliestothe\end{environment}controlsequence.
Note,howeverthattheWhatsitisonlyfortheendingcontrolsequence,nottheWhatsitfortheenvironmentasawhole.
84APPENDIXC.
MODULESafterDigestBody=>code($stomach,$whatsit)Thisoptionsuppliesahooktobeexecutedduringdigestionaftertheendingcontrolsequencehasbeendigested(andallthe4otherdigestionhookhaveexecuted)andafterthebodyoftheenvironmenthasbeenobtained.
TheWhatsitisthe(useful)onerepresentingthewholeenvironment,anditnowdoeshavethebodyandtraileravailable,storedasaproperties.
Example:DefConstructor('\emph{}',"#1'text');DefEnvironmentI(name,paramlist,replacement,%options);InternalformofDefEnvironmentwherethecontrolsequenceandparameterlisthavealreadybeenseparated;usefulfordenitionsfromwithincode.
InputingContentandDenitionsFindFile(name,%options);FindanappropriatelewiththegivennameinthecurrentdirectoriesinSEARCHPATHS.
Ifaleendingwith.
ltxmlisfound,itwillbepreferred.
Notethatifthenamestartswitharecognizedprotocol(currentlyoneof(literal|http|https|ftp))followedbyacolon,thenameisreturned,asis,andnosearchforlesiscarriedout.
Theoptionsare:type=>typespeciestheletype.
Ifnotset,itwillsearchforbothname.
texandname.
noltxml=>1inhibitssearchingforaLaTeXMLbinding(name.
type.
ltxml)touseinsteadoftheleitself.
notex=>1inhibitssearchingforrawtexversionofthele.
Thatis,itwillonlysearchfortheLaTeXMLbinding.
InputContent(request,%options);InputContentisusedforcaseswhenthele(ordata)isplainTeXmaterialthatisexpectedtocontributecontenttothedocument(asopposedtopuredeni-tions).
AMouthisopenedontothele,andsubsequentreadingand/ordigestionwillpullTokensfromthatMouthuntilitisexhausted,orclosed.
InsomecircumstancesitmaybeusefultoprovideastringcontainingtheTeXmaterialexplicitly,ratherthanreferencingale.
Inthiscase,theliteralpseudo-protocalmaybeused:85InputContent('literal:\textit{Hey}');Ifalenamed$request.
latexmlexists,itwillbereadinasifitwerealatexmlbindingle,beforeprocessing.
Thiscanbeusedforadhoccustomizationoftheconversionofspecicles,withoutmodifyingthesource,orcreatingmoreelaboratebindings.
TheonlyoptiontoInputContentis:noerror=>booleanInhibitssignallinganerrorifnoappropriateleisfound.
Input(request);InputisanalogoustoLaTeX's\input,andisusedincaseswhereitisn'tcompletelyclearwhethercontentordenitionsisexpected.
Oncealeisfound,theapproachspeciedbyInputContentorInputDefinitionsisused,dependingonwhichtypeofleisfound.
InputDefinitions(request,%options);InputDefinitionsisusedforloadingdenitions,ie.
variousmacros,set-tings,etc,ratherthandocumentcontent;itcanbeusedtoloadLaTeXML'sbindingles,orforreadinginrawTeXdenitionsorstyleles.
Itreadsandprocessesthematerialcompletelybeforereturning,eveninthecaseofTeXdef-initions.
ThisprocedureoptionallysupportstheconventionsusedforstandardLaTeXpackagesandclasses(seeRequirePackageandLoadClass).
OptionsforInputDefinitionsare:type=>typetheletypetosearchfor.
noltxml=>booleaninhibitssearchingforaLaTeXMLbinding;onlyrawTeXleswillbesoughtandloaded.
notex=>booleaninhibitssearchingforrawTeXles,onlyaLaTeXMLbindingwillbesoughtandloaded.
noerror=>booleaninhibitsreportinganerrorifnoappropriateleisfound.
ThefollowingoptionsareprimarilyusefulwhenInputDefinitionsissup-portingstandardLaTeXpackageandclassloading.
withoptions=>booleanindicateswhethertopassinanyoptionsfromthecallingclassorpackage.
handleoptions=>booleanindicateswhetheroptionsprocessingshouldbehandled.
86APPENDIXC.
MODULESoptions=>[.
.
.
]speciesalistofoptions(inthe'packageoptions'sense)tobepassed(possiblyinadditiontoanyprovidedbythecallingclassorpackage).
after=>tokens|code($gullet)providestokensorcodetobeprocessedbyaname.
type-h@@kmacro.
asclass=>booleanshyoptionthatindicatesthatthisdenitionsleshouldbetreatedasifitweredeningaclass;typicallyshowsupinlatexcompatibilitymode,orAMSTeX.
AhandymethodtousemostoftheTeXdistribution'srawTeXdenitionsforapackage,butoverrideonlyafewwithLaTeXMLbindingsisbydeningabindingle,saytikz.
sty.
ltxml,tocontainInputDefinitions('tikz',type=>'sty',noltxml=>1);whichwouldndandreadintizk.
sty,andthenfollowitbyacoupleofstrategicLaTeXMLdenitions,DefMacro,etc.
ClassandPackagesRequirePackage(package,%options);Findsandloadsapackageimplementation(usuallypackage.
sty.
ltxml,unlessnoltxmlisspecied)fortherequestedpackage.
Itreturnsthepathnameoftheloadedpackage.
Theoptionsare:type=>typespeciestheletype(defaultsty.
options=>[.
.
.
]speciesalistofpackageoptions.
noltxml=>booleaninhibitssearchingfortheLaTeXMLbindingforthele(ie.
name.
type.
ltxmlnotex=>1inhibitssearchingforrawtexversionofthele.
Thatis,itwillonlysearchfortheLaTeXMLbinding.
LoadClass(class,%options);Findsandloadsaclassdenition(usuallyclass.
cls.
ltxml).
Itreturnsthepathnameoftheloadedclass.
Theonlyoptionisoptions=>[.
.
.
]speciesalistofclassoptions.
87LoadPool(pool,%options);Loadsapoolle(usuallypool.
pool.
ltxml),oneofthetop-leveldenitionles,suchasTeX,LaTeXorAMSTeX.
Itreturnsthepathnameoftheloadedle.
DeclareOption(option,tokens|string|code($stomach));Declaresanoptionforthecurrentpackageorclass.
The2ndargumentcanbeastring(whichwillbetokenizedandexpanded)ortokens(whichwillbemacroexpanded),toprovidethevaluefortheoption,oritcanbeacodereferencewhichistreatedasaprimitiveforside-effect.
Ifapackageorclasswantstoaccomodateoptions,itshouldstartwithoneormoreDeclareOptions,followedbyProcessOptions().
PassOptions(name,ext,@options);Causesthegiven@options(strings)tobepassedtothepackage(ifextissty)orclass(ifextiscls)namedbyname.
ProcessOptions(%options);ProcessestheoptionsthathavebeenpassedtothecurrentpackageorclassinafashionsimilartoLaTeX.
Theonlyoption(toProcessOptionsisinorder=>booleanindicatingwhehterthe(package)optionsareprocessedintheordertheywereused,likeProcessOptions*.
ExecuteOptions(@options);Processtheoptionsgivenexplicitlyin@options.
AtBeginDocument(@stuff);Arrangesfor@stufftobecarriedoutafterthepreamble,atthebeginningofthedocument.
@stuffshouldtypicallybemacro-levelstuff,butcarriedoutforsideeffect;itshouldbetokens,tokenslists,strings(whichwillbetokenized),orcode($gullet)whichwouldyeildtokenstobeexpanded.
Thisoperationisusefulforstylelesloadedwith--preloadordocumentspeciccustomizationles(ie.
endingwith.
latexml);normallythecontentswouldbeexecutedbeforeLaTeXandotherstylelesareloadedandthuscanbeoverriddenbythem.
Bydeferringtheevaluationtobegin-documenttime,thesecontentscanoverridethosestyleles.
ThisislikelytoonlybemeaningfulforLaTeXdocuments.
AtEndDocument(@stuff)Arrangesfor@stufftobecarriedoutjustbefore\\end{document}.
Thesetokenscanbeusedforsideeffect,oranycontenttheygeneratewillappearasthelastchildrenofthedocument.
88APPENDIXC.
MODULESCountersandIDsNewCounter(ctr,within,%options);Denesanewcounter,likeLaTeX's\newcounter,butextended.
Itdenesacounterthatcanbeusedtogeneratereferencenumbers,anddenes\thectr,etc.
Italsodenesan"uncounter"whichcanbeusedtogenerateID's(xml:id)forunnumberedobjects.
ctristhenameofthecounter.
Ifdened,withinisthenameofanothercounterwhich,whenincremented,willcausethiscountertobereset.
Theoptionsareidprefix=>stringSpeciesaprextobeusedtogenerateID'swhenusingthiscounternestedNotsurethatthisisevensane.
$num=CounterValue($ctr);Fetchesthevalueassociatedwiththecounter$ctr.
$tokens=StepCounter($ctr);Analogof\stepcounter,stepsthecounterandreturnstheexpansionof\the$ctr.
UsuallyyoushoulduseRefStepCounter($ctr)instead.
$keys=RefStepCounter($ctr);Analogof\refstepcounter,stepsthecounterandreturnsahashcontain-ingthekeysrefnum=$refnum,id=>$id>.
Thismakesitsuitableforuseinapropertiesoptiontoconstructors.
Theidisgeneratedinparallelwiththereferencenumbertoassistdebugging.
$keys=RefStepID($ctr);LiketoRefStepCounter,butonlystepsthe"uncounter",andreturnsonlytheid;Thisisusefulforunnumberedcasesofobjectsthatnormallygetbotharefnumandid.
ResetCounter($ctr);Resetsthecounter$ctrtozero.
GenerateID($document,$node,$whatsit,$prefix);GeneratesanIDfornodesduringtheconstructionphase,usefulforcaseswherethecounterbasedschemeisinappropriate.
Thecallingpatternmakesitappro-priateforuseinTag,asinTag('ltx:para',afterClose=>sub{GenerateID(@_,'p');})If$nodedoesn'talreadyhaveanxml:idset,itcomputesanappropriateidbyconcatenatingthexml:idoftheclosestancestorwithanid(ifany),theprex(ifany)andauniquecounter.
89DocumentModelConstructorsdenehowTeXmarkupwillgenerateXMLfrag-ments,buttheDocumentModelisusedtocontrolexactlyhowthosefragmentsareassembled.
Tag(tag,%properties);Declarespropertiesofelementswiththenametag.
NotethatTagcansetoraddpropertiestoanyelementfromanybindingle,unlikethepropertiessetoncontrolbyDefPrimtive,DefConstructor,etc.
.
And,sincethepropertiesarerecordedinthecurrentModel,theyarenotsubjecttoTeXgrouping;onceset,theyremainineffectuntilchangedortheendofthedocument.
Thetagcanbespeciedinoneofthreeforms:prefix:namematchesspecificnameinspecificnamespaceprefix:*matchesanytaginthespecificnamespace;*matchesanytaginanynamespace.
Therearetwokindsofproperties:ScalarpropertiesForscalarproperties,onlyasinglevalueisreturnedforagivenelement.
Whenthepropertyislookedup,eachoftheaboveformsisconsidered(thespecicelementname,thenamespace,andallelements);therstdenedvalueisreturned.
Therecognizedscalarpropertiesare:autoOpen=>booleanSpecieswhethertagcanbeautomaticallyopenedifneededtoinsertanelementthatcanonlybecontainedbytag.
ThispropertycanhelpmatchthemoreSGML-likeLaTeXtoXML.
autoClose=>booleanSpecieswhetherthistagcanbeautomaticallyclosedifneededtocloseanancestornode,orinsertanelementintoanancestor.
ThispropertycanhelpmatchthemoreSGML-likeLaTeXtoXML.
CodepropertiesThesepropertiesprovideabitofcodetoberunatthetimesofcertaineventsassociatedwithanelement.
Allthecodebitsthatmatchagivenelementwillberun,andsincetheycanbeaddedbyanybindingle,andbespeciedinarandomorders,alittlebitofextracontrolisdesirable.
Firstly,anyearlycodesarerun(egafterOpen:early),thenanynor-malcodes(withoutmodier)arerun,andnallyanylatecodesarerun(eg.
afterOpen:late).
Withineachofthosegroups,thecodesassignedforanelement'sspe-cicnamearerunrst,thenthoseassignedforitspackageandnallythegenericone(*);thatis,themostspeciccodesarerunrst.
90APPENDIXC.
MODULESWhencodepropertiesareaccumulatedbyTagfornormalorlateevents,thecodeisappendedtotheendofthecurrentlist(iftherewereanypreviouscodesadded);forearlyevent,thecodeisprepended.
Therecognizedcodepropertiesare:afterOpen=>code($document,$box)Providescodetoberunwheneveranodewiththistagisopened.
Itiscalledwiththedocumentbeingconstructed,andtheinitiatingdigestedobjectasarguments.
Itiscalledafterthenodehasbeencreated,andafteranyinitialattributesduetotheconstructor(passedtoopenEle-ment)areadded.
afterOpen:earlyorafterOpen:latecanbeusedinplaceofafterOpen;thesewillberunasagroupbefore,orafter(respec-tively)theunmodiedblocks.
afterClose=>code($document,$box)Providescodetoberunwheneveranodewiththistagisclosed.
Itiscalledwiththedocumentbeingconstructed,andtheinitiatingdigestedobjectasarguments.
afterClose:earlyorafterClose:latecanbeusedinplaceofafterClose;thesewillberunasagroupbfore,orafter(respec-tively)theunmodiedblocks.
RelaxNGSchema(schemaname);Speciestheschematousefordeterminingdocumentmodel.
Youcanleaveofftheextension;itwilllookforschemaname.
rng(andmaybeeventually,.
rncifthatiseverimplemented).
RegisterNamespace(prefix,URL);DeclarestheprextobeassociatedwiththegivenURL.
Theseprexesmaybeusedinltxmlles,particularlyforconstructors,xpathexpressions,etc.
TheyarenotnecessarilythesameastheprexesthatwillbeusedinthegenerateddocumentUsetheprex#defaultforthedefault,non-prexed,namespace.
(SeeRegisterDocumentNamespace,aswellasDocTypeorRelaxNGSchema).
RegisterDocumentNamespace(prefix,URL);DeclarestheprextobeassociatedwiththegivenURLusedwithinthegen-eratedXML.
Theyarenotnecessarilythesameastheprexesusedincode(RegisterNamespace).
Thisfunctionislessrarelyneeded,asthenamespacedec-larationsaregenerallyobtainedfromtheDTDorSchemathemselvesUsetheprex#defaultforthedefault,non-prexed,namespace.
(SeeDocTypeorRelaxNGSchema).
DocType(rootelement,publicid,systemid,%namespaces);Declarestheexpectedrootelement,thepublicandsystemID'softhedocumenttypetobeusedinthenaldocument.
Thehash%namespacesspeciesthenamespacesprexesthatareexpectedtobefoundintheDTD,alongwitheach91associatednamespaceURI.
Usetheprex#defaultforthedefaultnamespace(ie.
thenamespaceofnon-prexedelementsintheDTD).
TheprexesdenedfortheDTDmaybedifferentfromtheprexesusedinim-plementationCODE(eg.
inltxmlles;seeRegisterNamespace).
ThegenerateddocumentwillusethenamespacesandprexesdenedfortheDTD.
DocumentRewritingDuringdocumentconstruction,aseachnodegetsclosed,thetextcontentgetssimpled.
We'llcallitapplyingligatures,forlackofabettername.
DefLigature(regexp,%options);Applytheregularexpression(givenasastring:"/fa/fa/"sinceitwillbecon-vertedinternallytoatrueregexp),tothetextcontent.
TheonlyoptionisfontTest=>code($font);ifgiven,thenthesubstitutionisappliedonlywhenfontTestreturnstrue.
PredenedLigaturescombinesequencesof".
"orsingle-quotesintoappropriateUnicodecharacters.
DefMathLigature($string=$replacment,%options);>AMathLigaturetypicallycombinesasequenceofmathtokens(XMTok)intoasingleone.
AsimpleexampleisDefMathLigature(role=>'RELOP',meaning=>'assign');replacesthetwotokensforcolonandequalsbyatokenrepresentingassignment.
TheoptionsarethosecharacterisinganXMTok,namely:role,meaningandname.
Formorecomplexcases(recognizingnumbers,forexample),youmaysupplyafunctionmatcher=CODE($document,$node)>,whichispassedthecurrentdocumentandthelastmathnodeinthesequence.
Itshouldexamine$nodeandanyprecedingnodes(usingpreviousSibling)andreturnalistof($n,$string,%attributes)toreplacethe$nnodesbyanewonewithtextcontentbeing$stringcontentandthegivenattributes.
Ifnoreplacementiscalledfor,CODEshouldreturnundef.
Afterdocumentconstruction,variousrewritingandaugmentingofthedocumentcantakeplace.
DefRewrite(%specification);DefMathRewrite(%specification);Thesetwodeclarationsdenedocumentrewriterulesthatareappliedtothedoc-umenttreeafterithasbeenconstructed,butbeforemathparsing,oranyotherpostprocessing,isdone.
The%specicationconsistsofasequenceofkey/valuepairswiththeinitialspecssuccessivelynarrowingtheselectionofdocument92APPENDIXC.
MODULESnodes,andtheremainingspecsindicatinghowtomodifyorreplacetheselectednodes.
Thefollowingselectportionsofthedocument:label=>labelSelectsthepartofthedocumentwithlabel=$labelscope=>scopeThescopecouldbe"label:foo"or"section:1.
2.
3"orsomethingsimilar.
Theseselectasubtreelabelled'foo',orasectionwithreferencenumber"1.
2.
3"xpath=>xpathSelectthosenodesmatchinganexplicitxpathexpression.
match=>texSelectsnodesthatlooklikewhattheprocessingoftexwouldproduce.
regexp=>regexpSelectstextnodesthatmatchtheregularexpression.
Thefollowingactupontheselectednode:attributes=>hashrefAddstheattributesgiveninthehashreferencetothenode.
replace=>replacementInterpretsreplacementasTeXcodetogeneratenodesthatwillreplacetheselectednodes.
Mid-Levelsupport$tokens=Expand($tokens);Expandsthegiven$tokensaccordingtocurrentdenitions.
$boxes=Digest($tokens);Processesanddigestesthe$tokens.
Anyargumentsneededbycontrolse-quencesin$tokensmustbecontainedwithinthe$tokensitself.
@tokens=Invocation($cs,@args);Constructsasequenceoftokensthatwouldinvokethetoken$csontheargu-ments.
RawTeX('.
.
.
texcode.
.
.
');RawTeXisaconveniencefunctionforincludingchunksofrawTeX(orLaTeX)codeinaPackageimplementation.
Itisusefulforcopyingportionsofthenormalimplementationthatcanbehandledsimplyusingmacrosandprimitives.
93Let($token1,$token2);Gives$token1thesame'meaning'(denition)as$token2;likeTeX's\let.
StartSemiVerbatim(EndSemiVerbatim();DisabledisablemostTeXcatcodes.
$tokens=Tokenize($string);Tokenizesthe$stringusingthestandardcatcodes,returningaLaTeXML::Core::Tokens.
$tokens=TokenizeInternal($string);Tokenizesthe$stringaccordingtotheinternalcattable(where@isaletter),returningaLaTeXML::Core::Tokens.
ArgumentReadersReadParameters($gullet,$spec);Readsfrom$gulletthetokenscorrespondingto$spec(aParametersob-ject).
DefParameterType(type,code($gullet,@values),%options);DenesanewParametertype,type,withcodeforitsreader.
Optionsare:reversion=>code($arg,@values);ThiscodeisresponsibleforconvertingapreviouslyparsedargumentbackintoasequenceofToken's.
optional=>booleanwhetheritisanerrorifnomatchinginputisfound.
novalue=>booleanwhetherthevaluereturnedshouldcontributetoargumentlists,orsimplybepassedover.
semiverbatim=>booleanwhetherthecatcodetableshouldbemodiedbeforereadingtokens.
.
FontDecode($code,$encoding,$implicit);Returnstheunicodestringrepresentingthegivencodepoint$code(aninteger)inthegivenfontencoding$encoding.
If$encodingisundened,theusualcase,thecurrentfontencodingandfontfamilyisusedforthelookup.
Explicitdecodingisusedwhen\\charorsimilarareinvoked($implicitisfalse),andthecodepointmustberepresentedinthefontmap,otherwiseundefisre-turned.
Implicitdecoding(ie.
$implicitistrue)occurswithintheStomachwhenaToken'scontentisbeingdigestedandconvertedtoaBox;inthatcaseonlythelower128codepointsareconverted;allcodepointsabove128areas-sumedtoalreadybeUnicode.
Thefontmapfor$encodingisautomaticallyloadedifithasnotalreadybeenloaded.
FontDecodeString($string,$encoding,$implicit);Returnstheunicodestringresultingfromdecodingtheindividualcharactersin$stringaccordingtoFontDecode,above.
LoadFontMap($encoding);Findsandloadsthefontmapfortheencodingnamed$encoding,ifithasn'tbeenloadedbefore.
Itlooksforencoding.
fontmap.
ltxml,whichwouldtypicallydenethefontmapusingDeclareFontMap,possiblyincludingex-tramapsforfamiliesliketypewriter.
Color$color=LookupColor($name);Lookupthecolorobjectassociatedwith$name.
DefColor($name,$color,$scope);Associatesthe$namewiththegiven$color(acolorobject),withthegivenscoping.
DefColorModel($model,$coremodel,$tocore,$fromcore);Denesacolormodel$modelthatisderivedfromthecorecolormodel$coremodel.
Thetwofunctions$tocoreand$fromcoreconvertacolorobjectinthatmodeltothecoremodel,orfromthecoremodeltothederivedmodel.
Coremodelsarergb,cmy,cmyk,hsbandgray.
97Low-levelFunctionsCleanID($id);Cleansan$idofdisallowedcharacters,trimmingspace.
CleanLabel($label,$prefix);Cleansa$labelofdisallowedcharacters,trimmingspace.
Theprex$prefixisprepended(orLABEL,ifnonegiven).
CleanIndexKey($key);Cleansanindexkey,soitcanbeusedasanID.
CleanBibKey($key);Cleansabibliographiccitationkey,soitcanbeusedasanID.
CleanURL($url);Cleansaurl.
UTF($code);GeneratesaUTFcharacter,handyforthethe8bitcharacters.
Forexample,UTF(0xA0)generatesthenon-breakingspace.
@tokens=roman($number);Formatsthe$numberin(lowercase)romannumerals,returningalistofthetokens.
@tokens=Roman($number);Formatsthe$numberin(uppercase)romannumerals,returningalistofthetokens.
SeealsoSeealsoLaTeXML::Global,LaTeXML::Common::Object,LaTeXML::Common::Error,LaTeXML::Core::Token,LaTeXML::Core::Tokens,LaTeXML::Core::Box,LaTeXML::Core::List,LaTeXML::Common::Number,LaTeXML::Common::Float,LaTeXML::Common::Dimension,LaTeXML::Common::Glue,LaTeXML::Core::MuDimension,LaTeXML::Core::MuGlue,LaTeXML::Core::Pair,LaTeXML::Core::PairList,LaTeXML::Common::Color,LaTeXML::Core::Alignment,LaTeXML::Common::XML,LaTeXML::Util::Radix.
LaTeXML::MathParserParsesmathematicscontentDescriptionLaTeXML::MathParserparsesthemathematicalcontentofadocument.
ItusesParse::RecDescentandagrammarMathGrammar.
98APPENDIXC.
MODULESMathRepresentationNeedsdescription.
PossibileCustomizationsNeedsdescription.
ConveniencefunctionsThefollowingfunctionsareexportedforconvenienceinwritingthegrammarproductions.
$node=New($name,$content,%attributes);CreatesanewXMToknodewithgiven$name(astringorundef),and$content(astringorundef)(butatleastoneofnameorcontentshouldbeprovided),andattributes.
$node=Arg($node,$n);Returnsthe$n-thargumentofanXMAppnode;0istheoperatornode.
Annotate($node,%attributes);Addattributesto$node.
$node=Apply($op,@args);CreateanewXMAppnoderepresentingtheapplicationofthenode$optothenodes@args.
$node=ApplyDelimited($op,@stuff);CreateanewXMAppnoderepresentingtheapplicationofthenode$optotheargumentsfoundin@stuff.
@stuffaredelimitedargumentsinthesensethattheleadingandtrailingnodesshouldrepresentopenandclosedelimitersandtheargumentsareseparatedbypunctuationnodes.
$node=InterpretDelimited($op,@stuff);SimilartoApplyDelimited,thisinterpretssequenceofdelimited,punctu-ateditemsasbeingtheapplicationof$optothoseitems.
$node=recApply(@ops,$arg);Givenasequenceofoperatorsandanargument,formsthenestedapplicationop(op(.
.
.
(arg)))>.
$node=InvisibleTimes;Createsaninvisibletimesoperator.
$boole=isMatchingClose($open,$close);Checkswhether$openand$closeforma'normal'pairofdelimiters,orifeitheris".
".
C.
1.
COMMONMODULES99$node=Fence(@stuff);Givenadelimitedsequenceofnodes,startingandendingwithopen/closede-limiters,andwithintermediatenodesseparatedbypunctuationorsuch,attempttoguesswhattypeofthingisrepresentedsuchasaset,absolutevalue,interval,andsoon.
Thiswouldbeagoodcandidateforcustomization!
$node=NewFormulae(@stuff);Givenasetofformulas,constructaFormulaeapplication,iftherearemorethanone,elsejustreturntherst.
$node=NewList(@stuff);Givenasetofexpressions,constructalistapplication,iftherearemorethanone,elsejustreturntherst.
$node=LeftRec($arg1,@more);Givenanexprfollowedbyrepeated(opexpr),composetheleftrecursivetree.
Forexamplea+b+c-dwouldgive(-(+abc)d)>MaybeFunction($token);Notethepossibleuseof$tokenasafunction,whichmaycauseincorrectpars-ing.
Thisisusedtogeneratewarningmessages.
C.
1CommonModulesDocumentationLaTeXML::Common::ConfigCongurationlogicforLaTeXMLSYNPOSISuseLaTeXML::Common::Config;my$config=LaTeXML::Common::Config->new(profile=>'name',timeout=>60,.
.
.
);$config->read(\@ARGV);$config->check;my$value=$config->get($name);$config->set($name,$value);$config->delete($name);my$bool=$config->exists($name);my@keys=$config->keys;my$options_hashref=$config->options;my$config_clone=$config->clone;100APPENDIXC.
MODULESDescriptionCongurationmanagementclassforLaTeXMLoptions.
*ResponsiblefordeningtheoptionsinterfaceandparsingtheusualPerlcommand-lineoptionssyntax*Providestheintuitivegetters,setters,aswellashashmethodsformanipulatingtheoptionvalues.
*Alsosupportscloningintonewcongurationobjects.
Methodsmy$config=LaTeXML::Common::Config->new(%options);Createsanewcongurationobject.
Notethatyoushouldtrynottoprovideyourown%optionshashbutrathercreateanemptycongurationanduse$cong->readtoreadintheoptions.
$config->read(\@ARGV);ThisisthemainmethodforparsinginLaTeXMLoptions.
Theinputarrayshouldeitherbe@ARGV,e.
g.
whentheoptionswereprovidedfromthecommandlineusingtheclassicGetopt::Longsyntax,oranyotherarrayreferencethatconformstothatsetup.
$config->check;Ensuresthatthecongurationobeysthegivenproleandperformsasetofas-signmentsofmeaningfuldefaults(whenneeded)andnormalizations(forrelativepaths,etc).
my$value=$config->get($name);Classicgetterforthe$valueofanoption$name.
$config->set($name,$value);Classicsetterforthe$valueofanoption$name.
$config->delete($name);Deletesoption$namefromtheconguration.
my$bool=$config->exists($name);Checkswhetherthekey$nameexistsintheoptionshashoftheconguration.
SimilarlytoPerl's"exist"forhashes,itreturnstrueevenwhentheoption'svalueisundened.
my@keys=$config->keys;Similarto"keys%hash"inPerl.
Returnsanarrayofalloptionnames.
my$optionshashref=$config->options;Returnstheactualhashreferencethatholdsalloptionswithinthecongurationobject.
my$configclone=$config->clone;Clones$congintoanewLaTeXML::Common::Congobject,$congclone.
C.
1.
COMMONMODULES101OPTIONSYNOPSISlatexmlc[options]Options:--VERSIONshowversionnumber.
--helpshowsthishelpmessage.
--destination=filespecifiesdestinationfile.
--output=file[obsoletesynonymfor--destination]--preload=modulerequestsloadingofanoptionalmodule;canberepeated--preamble=fileloadsatexfilecontainingdocumentfrontmatter.
MUSTinclude\begin{document}orequivalent--postamble=fileloadsatexfilecontainingdocumentbackmatter.
MUSTinclude\end{document}orequivalent--includestylesallowslatexmltoloadraw*.
styfile;bydefaultitavoidsthis.
--base=dirsetsthecurrentworkingdirectory--path=diraddsdirtothepathssearchedforfiles,modules,etc;--log=filespecifieslogfile(default:STDERR)--autoflush=countAutomaticallyrestartthedaemonafter"count"inputs.
Goodpracticeforvastbatchjobs.
(default:100)--timeout=secsTimecapforconversions(default600)--expire=secsTimecapforserverinactivity(default600)--address=URLSpecifyserveraddress(default:localhost)--port=numberSpecifyserverport(default:3354)--documentid=idassignanidtothedocumentroot.
--quietsuppressmessages(canrepeat)--verbosemoreinformativeoutput(canrepeat)--strictmakeslatexmllessforgivingoferrors--bibtexprocessesaBibTeXbibliography.
--xmlrequestsxmloutput(default).
--texrequestsTeXoutputafterexpansion.
--boxrequestsboxoutputafterexpansionanddigestion.
--format=namerequests"name"astheoutputformat.
Supported:tex,box,xml,html4,html5,xhtmlhtmlimplieshtml5--noparsesuppressesparsingmath(default:off)--parse=nameenablesparsingmath(default:on)andselectsparserframework"name".
Supported:RecDescent,no--profile=namespecifyprofileasdefinedinLaTeXML::Common::ConfigSupported:standard|math|fragment|.
.
.
(default:standard)102APPENDIXC.
MODULES--mode=nameAliasforprofile--cache_key=nameProvidesanameforthecurrentoptionset,toenabledaemonizedconversionswithoutneedingre-initializing--whatsin=chunkDefinestheprovidedinputchunk,choosefromdocument(default),fragmentandformula--whatsout=chunkDefinestheexpectedoutputchunk,choosefromdocument(default),fragmentandformula--postrequestsafollowuppost-processing--nopostforbidsfollowuppost-processing--validate,--novalidateEnables(thedefault)ordisablesvalidationofthesourcexml.
--omitdoctypeomitstheDoctypedeclaration,--noomitdoctypedisablestheomission(thedefault)--numbersectionsenables(thedefault)theinclusionofsectionnumbersintitles,crossrefs.
--nonumbersectionsdisablestheabove--timestampprovidesatimestamp(typicallyatimeanddate)tobeembeddedinthecomments--embedrequestsanembeddableXHTMLsnippet(requires:--post,--profile=fragment)DEPRECATED:Use--whatsout=fragmentTODO:Removecompletely--stylesheetspecifiesastylesheet,tobeusedbythepost-processor.
--css=cssfileaddsacssstylesheettohtml/xhtml(canberepeated)--nodefaultresourcesdisablesprocessingbuilt-inresources--javscript=jsfileaddsalinktoajavascriptfileintohtml/html5/xhtml(canberepeated)--icon=iconfilespecifyafiletouseasa"favicon"--xsltparameter=name:valuepassesparameterstotheXSLT.
--splitrequestssplittingeachdocument--nosplitdisablestheabove(default)--splitatsetsleveltosplitthedocument--splitpath=xpathsetsxpathexpressiontouseforsplitting(defaultsplitsatsections,ifsplittingisenabled)--splitnaming=(id|idrelative|label|labelrelative)specifieshowtonamesplitfiles(idrelative).
--scanscansdocumentstoextractids,labels,etc.
sectiontitles,etc.
(default)--noscandisablestheabove--crossreffillsincrossreferences(default)--nocrossrefdisablestheabove--urlstyle=(server|negotiated|file)formattouseforurls(defaultserver).
C.
1.
COMMONMODULES103--navigationtoc=(context|none)generatesatableofcontentsinnavigationbar--indexrequestscreatinganindex(default)--noindexdisablestheabove--splitindexSplitsindexintopagesperinitial.
--nosplitindexdisablestheabove(default)--permutedindexpermutesindexphrasesintheindex--nopermutedindexdisablestheabove(default)--bibliography=filesetsabibliographyfile--splitbibliographysplitsthebibliographyintopagesperinitial.
--nosplitbibliographydisablestheabove(default)--prescancarriesoutonlythesplit(ifenabled)andscan,storingcross-referencingdataindbfile(defaultiscompleteprocessing)--dbfile=dbfilesetsfiletostorecrossreferences--sitedirectory=dirsetsthebasedirectoryofthesite--sourcedirectory=dirsetsthebasedirectoryoftheoriginalTeXsource--source=inputasanalternativetopassingtheinputasthelastargument,aftertheoptionsetyoucanalsospecifyitasthevaluehere.
usefulforpredictableAPIcalls--mathimagesconvertsmathtoimages(defaultforhtml4format)--nomathimagesdisablestheabove--mathimagemagnification=magspecifiesmagnificationfactor--presentationmathmlconvertsmathtoPresentationMathML(defaultforxhtml&html5formats)--pmmlaliasfor--presentationmathml--nopresentationmathmldisablestheabove--linelength=nformatspresentationmathmltoalinelengthmaxofncharacters--contentmathmlconvertsmathtoContentMathML--nocontentmathmldisablestheabove(default)--cmmlaliasfor--contentmathml--openmathconvertsmathtoOpenMath--noopenmathdisablestheabove(default)--omaliasfor--openmath--keepXMathpreservestheintermediateXMathrepresentation(defaultistoremove)--mathtexaddsTeXannotationtoparallelmarkup--nomathtexdisablestheabove(default)--parallelmathuseparallelmathannotations(default)--noparallelmathdisableparallelmathannotations--plane1useplane-1unicodeforsymbols(default,ifneeded)--noplane1donotuseplane-1unicode--graphicimagesconvertsgraphicstoimages(default)104APPENDIXC.
MODULES--nographicimagesdisablestheabove--graphicsmap=type.
typespecifiesagraphicsfilemapping--pictureimagesconvertspictureenvironmentstoimages(default)--nopictureimagesdisablestheabove--svgconvertspictureenvironmentstoSVG--nosvgdisablestheabove(default)--nocommentsomitcommentsfromtheoutput--inputencoding=encspecifytheinputencoding.
--debug=packageenablesdebuggingoutputforthenamedpackageIfyouwanttoprovideaTeXsnippetdirectlyoninput,ratherthansupplyale-name,usetheliteral:protocoltoprexyoursnippet.
Options&ArgumentsGeneralOptions--verboseIncreasestheverbosityofoutputduringprocessing,usedtwiceisprettychatty.
Canbeusefulforgettingmoredetailswhenerrorsoccur.
--quietReducestheverbosityofoutputduringprocessing,usedtwiceisprettysilent.
--VERSIONShowstheversionnumberoftheLaTeXMLpackage.
.
--debug=packageEnablesdebuggingoutputforthenamedpackage.
ThepackageisgivenwithouttheleadingLaTeXML::.
--base=dirSepciesthebaseworkingdirectoryfortheconversionserver.
Usefulwhenconvertingsetsofdocumentsthatuserelativepaths.
--log=leSpeciesthelogle;bedefaultanyconversionmessagesareprintedtoSTDERR.
--helpShowsthishelpmessage.
C.
1.
COMMONMODULES105SourceOptions--destination=leSpeciesthedestinationle;bydefaulttheXMLiswrittentoSTDOUT.
--preload=moduleRequeststheloadingofanoptionalmoduleorpackage.
ThismaybeusefuliftheTeXcodedoesnotspeciclyrequirethemodule(eg.
throughinputorusepackage).
Forexample,use--preload=LaTeX.
pooltoforceLaTeXmode.
--preamble=leRequeststheloadingofatexlewithdocumentfrontmatter,tobereadinbeforetheconverteddocument,butafterall--preloadentries.
NotethatthegivenleMUSTcontain\begin{document}oranequivalentenvi-ronmentstart,whenprocessingLaTeXdocuments.
Iftheledoesnotcontaincontenttoappearinthenaldocument,butonlymacrodenitionsandsettingofinternalcounters,itismoreappropriatetouse--preloadinstead.
--postamble=leRequeststheloadingofatexlewithdocumentbackmatter,tobereadinaftertheconverteddocument.
NotethatthegivenleMUSTcontain\end{document}oranequivalentenvi-ronmentend,whenprocessingLaTeXdocuments.
--sourcedirectory=sourceSpeciesthedirectorywheretheoriginallatexsourceislocated.
UnlessLa-TeXMLisrunfromthatdirectory,oritcanbedeterminedfromthexmllename,itmaybenecessarytospecifythisoptioninordertondgraphicsandstyleles.
--path=dirAdddirtothesearchpathsusedwhensearchingforles,modules,styleles,etc;somewhatlikeTEXINPUTS.
Thisoptioncanberepeated.
--validate,--novalidateEnables(ordisables)thevalidationofthesourceXMLdocument(thedefault).
--bibtexForceslatexmltotreattheleasaBibTeXbibliography.
NotethatthetimingisslightlydifferentthantheusualcasewithBibTeXandLaTeX.
Inthelattercase,BibTeXsimplyselectsandformatsasubsetofthebibliographicentries;theactualTeXexpansioniscarriedoutwhentheresultisincludedinaLaTeXdocument.
Incontrast,latexmlprocessesandexpandstheentirebibliography;theselectionofentriesisdoneduringpost-processing.
Thisalsomeansthatany106APPENDIXC.
MODULESpackagesthatdenemacrosusedinthebibliographymustbespeciedusingthe--preloadoption.
--inputencoding=encodingSpecifytheinputencoding,eg.
--inputencoding=iso-8859-1.
Theen-codingmustbeoneknowntoPerl'sEncodepackage.
NotethatthisonlyenablesthetranslationoftheinputbytestoUTF-8usedinternallybyLaTeXML,butdoesnotaffectcatcodes.
Insuchcases,youshouldbeusingtheinputencpack-age.
Notealsothatthisdoesnotaffecttheoutputencoding,whichisalwaysUTF-8.
TeXConversionOptions--includestylesThisoptionalallowsprocessingofstyleles(leswithextensionssty,cls,clo,cnf).
Bydefault,theselesareignoredunlessalatexmlimplementationofthemisfound(withanextensionofltxml).
Thesestylelesgenerallyfallintotwoclasses:Thosethatmerelyaffectdocu-mentstyleareignorableintheXML.
Othersdenenewmarkupanddocumentstructure,oftenusingdeeperLaTeXmacrostoachievetheirends.
Althoughtheomissionwillleadtoothererrors(missingmacrodenitions),itisunlikelythatprocessingtheTeXcodeinthestylelewillleadtoacorrectdocument.
--timeout=secsSettimecapforconversionjobs,inseconds.
AnyjobfailingtoconvertinthetimerangewouldreturnwithaFatalerroroftimingout.
Defaultvalueis600,setto0todisable.
--nocommentsNormallylatexmlpreservescommentsfromthesourcele,andaddsacommentevery25linesasanaidintrackingthesource.
Theoption--nocommentsdiscardssuchcomments.
--documentid=idAssignsanIDtotherootelementoftheXMLdocument.
ThisIDisgenerallyinheritedastheprexofID'sonallotherelementswithinthedocument.
ThisisusefulwhenconstructingasiteofmultipledocumentssothatallnodeshaveuniqueIDs.
--strictSpeciesastrictprocessingmode.
Bydefault,undenedcontrolsequencesandinvaliddocumentconstructs(thatviolatetheDTD)givewarningmessages,butattempttocontinueprocessing.
Using--strictmakesthemgeneratefatalerrors.
C.
1.
COMMONMODULES107--postRequestpost-processing,auto-enabledbyanyrequestedpost-processor.
Dis-abledbydefault.
Ifpost-processingisenabled,thegraphicsandcross-referencingprocessorsareonbydefault.
FormatOptions--format=(html|html5|html4|xhtml|xml|epub)Speciestheoutputformatforpostprocessing.
Bydefault,itwillbeguessedfromtheleextensionofthedestination(ifgiven),withhtmlimplyinghtml5,xhtmlimplyingxhtmlandthedefaultbeingxml,whichyouprobablydon'twant.
Thehtml5formatconvertsthematerialtohtml5formwithmathematicsasMathML;html5supportsSVG.
html4formatconvertsthematerialtotheear-lierhtmlform,version4,andthemathematicstopngimages.
xhtmlformatconvertstoxhtmlandusespresentationMathML(afterattemptingtoparsethemathematics)forrepresentingthemath.
html5similarlyconvertsmathtopre-sentationMathML.
Inthesecases,anygraphicswillbeconvertedtoweb-friendlyformatsand/orcopiedtothedestinationdirectory.
Ifyousimplyspecifyhtml,itwilltreatthatashtml5.
Forthedefault,xml,theoutputisleftinLaTeXML'sinternalxml,butthemathisparsedandconvertedtopresentationMathML.
Forhtml,html5andxhtml,adefaultstylesheetisprovided,butseethe--stylesheetoption.
--xmlRequestsXMLoutput;thisisthedefault.
DEPRECATED:use--format=xmlinstead--texRequestsTeXoutputfordebuggingpurposes;processingisonlycarriedoutthroughexpansionanddigestion.
ThismaynotbequitevalidTeX,sinceUni-codemaybeintroduced.
--boxRequestsBoxoutputfordebuggingpurposes;processingiscarriedoutthroughexpansionanddigestions,andtheresultisprinted.
--profileVarietyofshorthandproles.
Notethattheprolescomewithavarietyofpresetoptions.
Youcanexamineanyofthemintheirresources/Profiles/name.
optle.
Example:latexmlc--profile=math'literal:1+2=3'108APPENDIXC.
MODULES--omitdoctype,--noomitdoctypeOmits(orincludes)thedocumenttypedeclaration.
ThedefaultistoincludeitifthedocumentmodelwasbasedonaDTD.
--numbersections,--nonumbersectionsIncludes(default),ordisablestheinclusionofsection,equation,etc,numbersintheformatteddocumentandcrossreferencelinks.
--stylesheet=xslleRequeststheXSLtransformationofthedocumentusingthegivenxslleasstylesheet.
Ifthestylesheetisomitted,a'standard'oneappropriatefortheformat(html4,html5orxhtml)willbeused.
--css=cssleAddscssleasacssstylesheettobeusedinthetransformedhtml/html5/xhtml.
Multiplestylesheetscanbeused;theyareincludedinthehtmlintheordergiven,followingthedefaultltx-LaTeXML.
css(unless--nodefaultcss).
Thestylesheetiscopiedtothedestinationdirectory,unlessitisanabsoluteurl.
Somestylesheetsincludedinthedistributionare--css=navbar-leftPutsanav-igationbarontheleft.
(defaultomitsnavbar)--css=navbar-rightPutsanavi-gationbarontheleft.
--css=theme-blueAbluecoloringthemeforheadings.
--css=amsartAstylesuitableforjournalarticles.
--javascript=jsleIncludesalinktothejavascriptlejsle,tobeusedinthetransformedhtm-l/html5/xhtml.
Multiplejavascriptlescanbeincluded;theyarelinkedinthehtmlintheordergiven.
Thejavascriptleiscopiedtothedestinationdirectory,unlessitisanabsoluteurl.
--icon=iconleCopiesiconletothedestinationdirectoryandsetsupthelinkageinthetrans-formedhtml/html5/xhtmltousethatasthe"favicon".
--nodefaultresourcesDisablesthecopyingandinclusionofresourcesaddedbythebindingles;ThisincludesCSS,javascriptorotherles.
Thisdoesnotaffectresourcesexplicitlyrequestedbythe--cssor--javascriptoptions.
--timestamp=timestampProvidesatimestamp(typicallyatimeanddate)tobeembeddedinthecom-mentsbythestockXSLTstylesheets.
Ifyoudon'tsupplyatimestamp,thecur-renttimeanddatewillbeused.
(Youcanuse--timestamp=0toomitthetimestamp).
--xsltparameter=name:valuePassesparameterstotheXSLTstylesheet.
Seethemanualorthestylesheetitselfforavailableparameters.
C.
1.
COMMONMODULES109Site&CrossreferencingOptions--split,--nosplitEnablesordisables(default)thesplittingofdocumentsintomultiple'pages'.
Ifenabled,thethedocumentwillbesplitintosections,bibliography,indexandappendices(ifany)bydefault,unless--splitpathisspecied.
--splitat=unitSpecieswhatlevelofthedocumenttosplitat.
Shouldbeoneofchapter,section(thedefault),subsectionorsubsubsection.
Formorecon-trol,see--splitpath.
--splitpath=xpathSpeciesanXPathexpressiontoselectnodesthatwillgenerateseparatepages.
Thedefaultsplitpathis//ltx:section|//ltx:bibliography|//ltx:appendix|//ltx:indexSpecifying--splitpath="//ltx:section|//ltx:subsection|//ltx:bibliography|//ltx:appendix|//ltx:index"wouldsplitthedocumentatsubsectionsaswellassections.
--splitnaming=(id|idrelative|label|labelrelative)Specieshowtonamethelesforsubdocumentscreatedbysplitting.
Thevaluesidandlabelsimplyusetheidorlabelofthesubdocument'srootnodeforit'slename.
idrelativeandlabelrelativeusetheportionoftheidorlabelthatfollowstheparentdocument'sidorlabel.
Furthermore,toimposestructureanduniqueness,ifasplitdocumenthaschildrenthatarealsosplit,thatdocument(andit'schildren)willbeinaseparatesubdirectorywiththenameindex.
--scan,--noscanEnables(default)ordisablesthescanningofdocumentsforids,labels,refer-ences,indexmarks,etc,foruseinllinginrefs,cites,indexandsoon.
ItmaybeusefultodisablewhengeneratingdocumentsnotbasedontheLaTeXMLdoctype.
--crossref,--nocrossrefEnables(default)ordisablesthellinginofreferences,hrefs,etcbasedonapreviousscan(eitherfrom--scan,or--dbfile)ItmaybeusefultodisablewhengeneratingdocumentsnotbasedontheLaTeXMLdoctype.
--urlstyle=(server|negotiated|file)ThisoptiondeterminesthewaythatURLswithinthedocumentsareformatted,dependingonthewaytheyareintendedtobeserved.
Thedefault,server,110APPENDIXC.
MODULESeliminatesunneccessarytrailingindex.
html.
Withnegotiated,thetrail-ingleextension(typicallyhtmlorxhtml)areeliminated.
Theschemefilepreservescomplete(butrelative)urlssothatthesitecanbebrowsedasleswithoutanyserver.
--navigationtoc=(context|none)Generatesatableofcontentsinthenavigationbar;defaultisnone.
The'con-text'styleofTOC,issomewhatverboseandrevealsmoredetailnearthecurrentpage;itismostsuitablefornavigationbarsplacedontheleftorright.
OtherstylesofTOCshouldbedevelopedandaddedhere,suchasashortform.
--index,--noindexEnables(default)ordisablesthegenerationofanindexfromindexmarksem-beddedwithinthedocument.
Enablingthishasnoeffectunlessthereisanindexelementinthedocument(generatedby\printindex).
--splitindex,--nosplitindexEnablesordisables(default)thesplittingofgeneratedindexesintoseparatepagesperinitialletter.
--bibliography=pathnameSpeciesabibliographygeneratedfromaBibTeXletobeusedtollinabibli-ographyelement.
Hand-writtenbibliographiesplacedinathebibliographyenvironmentdonotneedthis.
Theoptionhasnoeffectunlessthereisanbibli-ographyelementinthedocument(generatedby\bibliography).
Notethatthisoptionprovidesthebibliographytobeusedtollinthebibliogra-phyelement(generatedby\bibliography);latexmlpostdoesnot(currently)directlyprocessandformatsuchabibliography.
--splitbibliography,--nosplitbibliographyEnablesordisables(default)thesplittingofgeneratedbibliographiesintosepa-ratepagesperinitialletter.
--prescanBydefaultlatexmlpostprocessesasingledocumentintoone(ormore;see--split)destinationlesinasinglepass.
Whengeneratingacomplicatedsiteconsistingofseveraldocumentsitmaybeadvantageoustorstscanthroughthedocumentstoextractandstore(indbfile)cross-referencingdata(suchasids,titles,urls,andsoon).
Alaterpassthenhascompleteinformationallowingalldocumentstoreferenceeachother,andalsoconstructsanindexandbibliographythatreectstheentiredocumentset.
Thesameeffect(thoughlessefcient)canbeachievedbyrunninglatexmlposttwice,providedadbfileisspecied.
--dbfile=leSpeciesalenametouseforthecrossreferencingdatawhenusingtwo-passprocessing.
Thislemayresideintheintermediatedestinationdirectory.
C.
1.
COMMONMODULES111--sitedirectory=dirSpeciesthebasedirectoryoftheoverallwebsite.
Pathnamesinthedatabasearestoredinaformrelativetothisdirectorytomakeitmoreportable.
--embedTODO:Deprecated,use--whatsout=fragmentRequestsanembeddableXHTMLdiv(requires:--post--format=xhtml),respectivelythetopdivisionofthedoc-ument'sbody.
Caveat:Thisexperimentalmodeisenabledonlyforfragmentproleandpost-processeddocuments(toXHTML).
MathOptionsTheseoptionsspecifyhowmathshouldbeconvertedintootherfor-mats.
Multipleformatscanberequested;howtheywillbecombineddependsontheformatandotheroptions.
--noparseSuppressesparsingmath(default:parsingison)--parse=nameEnablesparsingmath(default:parsingison)andselectsparserframework"name".
Supported:RecDescent,noTip:--parse=noisequivalentto--noparse--mathimages,--nomathimagesRequestsordisablestheconversionofmathtoimages(pngbydefault).
Conver-sionisthedefaultforhtml4format.
--mathsvg,--nomathsvgRequestsordisablestheconversionofmathtosvgimages.
--mathimagemagnification=factorSpeciesthemagnicationusedformathimages(bothpngandsvg),iftheyaremade.
Defaultis1.
75.
--presentationmathml,--nopresentationmathmlRequestsordisablesconversionofmathtoPresentationMathML.
Conversionisthedefaultforxhtmlandhtml5formats.
--linelength=number(Experimental)Line-breaksthegeneratedPresentationMathMLsothatitisnolongerthannumber'characters'.
--plane1ConvertsthecontentofPresentationMathMLtokenelementstotheappropriateUnicodePlane-1codepointsaccordingtotheselectedfont,whenapplicable(thedefault).
112APPENDIXC.
MODULES--hackplane1ConvertsthecontentofPresentationMathMLtokenelementstotheappropri-ateUnicodePlane-1codepointsaccordingtotheselectedfont,butonlyforthemathvariantsdouble-struck,frakturandscript.
Thisgivessupportforcurrent(asofAugust2009)versionsofFirefoxandMathPlayer,providedasufcientsetoffontsisavailable(eg.
STIX).
--contentmathml,--nocontentmathmlRequestsordisablesconversionofmathtoContentMathML.
Conversionisdis-abledbydefault.
Notethatthisconversionisonlypartiallyimplemented.
--openmathRequestsordisablesconversionofmathtoOpenMath.
Conversionisdisabledbydefault.
Notethatthisconversionisonlypartiallyimplemented.
--keepXMath,--xmathBydefault,whenanyoftheMathMLorOpenMathconversionsareused,theintermediatemathrepresentationwillberemoved;thisoptionpreservesit;itwillbeusedassecondaryparallelmarkup,whenitfollowstheoptionsforothermathrepresentations.
GraphicsOptions--graphicimages,--nographicimagesEnables(default)ordisablestheconversionofgraphicstoweb-appropriatefor-mat(png).
--graphicsmap=sourcetype.
desttypeSpeciesamappingofgraphicsletypes.
Typically,graphicselementsspecifyagraphicslethatwillbeconvertedtoamoreappropriateletargetformat;forexample,postscriptlesusedforgraphicswithLaTeXwillbeconvertedtopngformatforuseontheweb.
AswithLaTeX,whenagraphicsleisspeciedwithoutaletype,thesystemwillsearchforthemostappropriatetargettypele.
Whenthisoptionisused,itoverridesandreplacesthedefaultsandprovidesamappingofsourcetypetodesttype.
Theoptioncanberepeatedtoprovideseveralmappings,withtheearlierformatspreferred.
Ifthedesttypeisomitted,itspeciescopyinglesoftypesourcetype,unchanged.
Thedefaultsettingsisequivalenttohavingsuppliedtheoptions:svgpnggifjpgjpegeps.
pngps.
pngai.
pngpdf.
pngTherstformatsarepreferredandusedunchanged,whilethelatteronesareconvertedtopng.
C.
1.
COMMONMODULES113--pictureimages,--nopictureimagesEnables(default)ordisablestheconversionofpictureenvironmentsandpstricksmaterialintoimages.
--svg,--nosvgEnablesordisables(default)theconversionofpictureenvironmentsandpstricksmaterialtoSVG.
Daemon,ServerandClientOptionsOptionsusedonlyfordaemonizedconver-sions,e.
g.
talkingtoaremoteservervialatexmlc,orlocalprocessingviatheLaTeXML::Plugin::latexmlsplugin.
Forreliablecommunicationandastableconversionexperience,invokelatexmlsonlythroughthelatexmlcclient(youneedtoset--expiretoapositivevalue,inordertorequestauto-spawningofadedicatedconversionserver).
--autoflush=countAutomaticallyrestartthedaemonafterconverting"count"inputs.
Goodpracticeforvastbatchjobs.
(default:100)--expire=secsSetaninactivitytimeoutvalueinseconds.
Iftheserverprocessisnotgivenanyinputforthespeciedduration,itwillautomaticallyterminate.
Thedefaultvalueis600seconds,setto0toneverexpire,-1toentirelyoptoutofusinganindependentserver.
--address=URLSpecifyserveraddress(default:localhost)--port=numberSpecifyserverport(default:3334formath,3344forfragmentand3354forstandard)LaTeXML::Common::ObjectAbstractbaseclassformostLaTeXMLobjects.
DescriptionLaTeXML::Common::Objectservesasanabstractbaseclassforallotherobjects(boththedataobjectsandcontrolobjects).
Itprovidesforcommonmethodsforstringi-cationandcomparisonoperationstosimplifycodingandtobeautifyerrorreporting.
114APPENDIXC.
MODULESGenericfunctions$string=Stringify($object);Returnsastringidentifying$object,fordebugging.
Worksonanyvaluesandobjects,butinvokesthestringifymethodonblessedobjects.
Moreinformativethanthedefaultperlconversiontoastring.
$string=ToString($object);Converts$objecttostringattempting,whenpossible,togeneratestraighttextwithoutTeXmarkup.
ThisismostusefulforconvertingTokensorBoxestodocumentcontentorattributevalues,orvaluestobeusedforpathnames,key-words,etc.
Generally,however,itisnotpossibletoconvertWhatsitsgeneratedbyConstructorsintocleanstrings,withoutTeXmarkup.
Worksonanyvaluesandobjects,butinvokesthetoStringmethodonblessedobjects.
$boolean=Equals($x,$y);Comparesthetwoobjectsforequality.
Worksonanyvaluesandobjects,butinvokestheequalsmethodonblessedobjects,whichdoesadeepcomparisonofthetwoobjects.
$tokens=Revert($object);ReturnsaTokenslistcontainingtheTeXthatwouldcreate$object.
NotethatthisisnotnecessarilytheoriginalTeXcode;expansionsorothersubstitutionsmayhavetakenplace.
Methods$string=$object->stringify;Returnsareadablerepresentationof$object,usefulfordebugging.
$string=$object->toString;Returnsthestringcontentof$object;mostusefulforextractingaclean,us-able,Unicodestringfromtokensorboxesthatmightrepresentingalenameorsuch.
Totheextentpossible,thisshouldprovideastringthatcanbeusedasXMLcontent,orattributevalues,orforlenamesorwhatever.
However,controlsequencesdenedasConstructorsmayleaveTeXcodeinthevalue.
$boole=$object->equals($other);Returnswhether$objectand$otherareequal.
Shouldperformadeepcompari-sion,butthedefaultimplementationjustcomparesforobjectidentity.
$boole=$object->isaToken;Returnswhether$objectisanLaTeXML::Core::Token.
$boole=$object->isaBox;Returnswhether$objectisanLaTeXML::Core::Box.
C.
1.
COMMONMODULES115$boole=$object->isaDefinition;Returnswhether$objectisanLaTeXML::Core::Definition.
$digested=$object->beDigested;Doeswhateverisneededtodigesttheobject,andreturnthedigestedrepresenta-tion.
Tokenswouldbedigestedintoboxes;Someobjects,suchasnumberscanjustreturnthemselves.
$object->beAbsorbed($document);Dowhateverisneededtoabsorbthe$objectintothe$document,typicallybyinvokingappropriatemethodsonthe$document.
LaTeXML::Common::ColorAbstractclassrepresentatingcolorsusingvariouscolormodels;extendsLaTeXML::Common::Object.
Exportedfunctions$color=Color($model,@components);CreatesaColorobjectusingthegivencolormodel,andwiththegivencom-ponents.
Thecorecolormodelsarergb,hsv,cmy,cmykandgray.
Thecomponentsofcolorsusingcorecolormodelsarebetween0and1(inclusive)Black,WhiteConstantcolorobjectsrepresentingblackandwhite,respectively.
Methods$model=$color->model;Returnthenameofthecolormodel.
@components=$color->components;Returnthecomponentsofthecolor.
$other=$color->convert($tomodel);Convertsthecolortoanothercolormodel.
$string=$color->toString;Returnsaprintedrepresentationofthecolor.
$hex=$color->toHex;ReturnsastringrepresentingthecolorasRGBinhexadecimal(6digits).
$other=$color->toCore();Convertsthecolortooneofthecorecolors.
116APPENDIXC.
MODULES$complement=$color->complement();Returnsthecomplementcolor(worksforcolorsinrgb,cmyandgraycolormodels).
$new=$color->mix($other,$fraction);Returnsanewcolorwhichresultsfrommixinga$fractionof$colorwith(1-$fraction)ofcolor$other.
$new=$color->add($other);Returnsanewcolormadebyaddingthecomponentsofthetwocolors.
$new=$color->scale($m);Returnsanewcolormadebymulitiplyingthecomponentsby$n.
$new=$color->multiply(@m);Returnsanewcolormadebymulitiplyingthecomponentsbythecorrespondingcomponentfrom@n.
SeealsoSupportedcolormodels:LaTeXML::Common::Color::rgb,LaTeXML::Common::Color::hsb,LaTeXML::Common::Color::cmy,LaTeXML::Common::Color::cmyk,LaTeXML::Common::Color::grayandLaTeXML::Common::Color::Derived.
LaTeXML::Common::Color::rgbRepresentscolorsinthergbcolormodel:red,greenandbluein[0.
.
1];extendsLaTeXML::Common::Color.
LaTeXML::Common::Color::hsbRepresentscolorsinthehsbcolormodel:hue,saturation,brightnessin[0.
.
1];extendsLaTeXML::Common::Color.
LaTeXML::Common::Color::cmyRepresentscolorsinthecmycolormodel:cyan,magentaandyellow[0.
.
1];extendsLaTeXML::Common::Color.
LaTeXML::Common::Color::cmykRepresentscolorsinthecmykcolormodel:cyan,magenta,yellowandblackin[0.
.
1];extendsLaTeXML::Common::Color.
LaTeXML::Common::Color::grayRepresentscolorsinthegraycolormodel:grayvaluein[0.
.
1];extendsLaTeXML::Common::Color.
C.
1.
COMMONMODULES117LaTeXML::Common::Color::DerivedRepresentscolorsinderivedcolormodelsSynopsisLaTeXML::Common::Color::Derivedrepresentscolorsinderivedcolormod-els.
Theseareusedtosupportvariouscolormodelsdenedanddenableviathexcolorpackage,suchascolorswherethecomponentsareindifferentranges.
ItextendsLaTeXML::Common::Color.
LaTeXML::Common::NumberRepresentationofnumbers;extendsLaTeXML::Common::Object.
Exportedfunctions$number=Number($num);CreatesaNumberobjectrepresenting$num.
Methods@tokens=$object->unlist;Returnalistofthetokensmakingupthis$object.
$string=$object->toString;Returnastringrepresenting$object.
$string=$object->ptValue;Returnavaluerepresenting$objectwithoutthemeasurementunit(pt)withlimiteddecimalplaces.
$string=$object->pxValue;Returnanintegervaluerepresenting$objectinpixels.
UsesthestatevariableDPI(dotsperinch).
$n=$object->valueOf;Returnthevalueinscaledpoints(ignoringshrinkandstretch,ifany).
$n=$object->smaller($other);Return$objector$other,whicheverissmaller$n=$object->larger($other);Return$objector$other,whicheverislarger$n=$object->absolute;Returnanobjectrepresentingtheabsolutevalueofthe$object.
118APPENDIXC.
MODULES$n=$object->sign;Returnaninteger:-1fornegatives,0for0and1forpositives$n=$object->negate;Returnanobjectrepresentingthenegativeofthe$object.
$n=$object->add($other);Returnanobjectrepresentingthesumof$objectand$other$n=$object->subtract($other);Returnanobjectrepresentingthedifferencebetween$objectand$other$n=$object->multiply($n);Returnanobjectrepresentingtheproductof$objectand$n(aregularnum-ber).
$n=$object->divide($n);Returnanobjectrepresentingthe(truncating)divisionof$objectby$n(aregularnumber).
$n=$object->divideround($n);Returnanobjectrepresentingthe(rounding)divisionof$objectby$n(aregularnumber).
LaTeXML::Common::FloatRepresentationofoatingpointnumbers;extendsLaTeXML::Common::Number.
Exportedfunctions$number=Float($num);Createsaoatingpointobjectrepresenting$num;ThisisnotpartofTeX,butuseful.
LaTeXML::Common::DimensionRepresentationofdimensions;extendsLaTeXML::Common::Number.
Exportedfunctions$dimension=Dimension($dim);CreatesaDimensionobject.
$numcanbeastringwiththenumberandunits(withanyoftheusualTeXrecognizedunits),orjustanumberstandingforscaledpoints(sp).
C.
1.
COMMONMODULES119LaTeXML::Common::GlueRepresentationofglue,skips,stretchydimensions;extendsLaTeXML::Common::Dimension.
Exportedfunctions$glue=Glue($gluespec);$glue=Glue($sp,$plus,$pfill,$minus,$mfill);CreatesaGlueobject.
$gluespeccanbeastringintheformthatTeXrecog-nizes(numberunitsoptionalplusandminusparts).
Alternatively,thedimension,plusandminuspartscanbegivenseparately:$pfilland$mfillare0(whenthe$plusor$minuspartisinsp)or1,2,3forl,llorlll.
LaTeXML::Common::FontRepresentationoffontsDescriptionLaTeXML::Common::FontrepresentfontsinLaTeXML.
ItextendsLaTeXML::Common::Object.
ThismoduledenesFontobjects.
I'mnotcompletelyhappywiththearrangement,ormaybejusttheuseofit,soI'mnotgoingtodocumentextensivelyatthispoint.
Theattributesarefamily:serif,sansserif,typewriter,caligraphic,fraktur,scriptseries:medium,boldshape:upright,italic,slanted,smallcapssize:TINY,Tiny,tiny,SMALL,Small,small,normal,Normal,large,Large,LARGE,huge,Huge,HUGE,gigantic,Gigantic,GIGANTICcolor:anynamedcolor,defaultisblackTheyareusuallymergedagainstthecurrentfont,attemptingtomimicthe,some-timescounter-intuitive,waythatTeXdoesit,particularlyformathMethods$font->specialize($string);Inmathmode,LaTeXML::Common::Fontsupportscomputingafontreect-inghowthespecic$stringwouldbeprintedwhen$fontisactive;This(attemptsto)handlethecuriouswaysthatlowercasegreekoftendoesn'tgetadifferentfont.
Inparticular,itrecognizesthefollowingclassesofstrings:singlelatinletter,singleuppercasegreekcharacter,singlelowercasegreekcharacter,digits,andothers.
120APPENDIXC.
MODULESLaTeXML::Common::ModelRepresentstheDocumentModelDescriptionLaTeXML::Common::ModelencapsulatesinformationaboutthedocumentmodeltobeusedinconvertingadigesteddocumentintoXMLbytheLaTeXML::Core::Document.
Thisinformationisbasedonthedocumentschema(eg,DTD,RelaxNG),butisalsomodiedbypackagemodules;thusthemodelmaynotbecompleteuntildigestioniscompleted.
Thekindsofinformationthatisrelevantisnotonlythecontentmodel(whateachelementcancontaincontain),butalsoSGML-likeinformationsuchaswhetheranel-ementcanbeimplicitlyopenedorclosed,ifneededtoinsertanewelementintothedocument.
Currently,onlyanapproximationtotheschemaisunderstoodandused.
Forexam-ple,weonlyrecordthatcertainelementscanappearwithinanother;wedon'tpreserveanyinformationaboutrequiredorderornumberofinstances.
ItextendsLaTeXML::Common::Object.
ModelCreation$model=LaTeXML::Common::Model->new(%options);Createsanewmodel.
Theonlyusefuloptionispermissive=>1whichig-noresanyDTDandallowsthedocumenttobebuiltwithoutfollowinganypar-ticularcontentmodel.
DocumentType$model->setDocType($rootname,$publicid,$systemid,%namespaces);Declarestheexpectedrootelement,thepublicandsystemID'softhedocumenttypetobeusedinthenaldocument.
Thehash%namespacesspeciesthenamespaceprexesthatareexpectedtobefoundintheDTD,alongwiththeassociatednamespaceURI.
Theseprexesmaybedifferentfromtheprexesusedinimplementationcode(eg.
inltxmlles;seeRegisterNamespace).
Thegenerateddocumentwillusethenamespacesandprexesdenedhere.
NamespacesNotethattherearetwonamespacemappingsbetweennamespaceURIsandprexesthatarerelevanttoLaTeXML.
The'code'mappingistheoneusedincodeimplementingpackages,andinparticular,constructorsdenedwithinthosepackages.
TheprexltxisusedconsistentlytorefertoLaTeXML'sownnamespace(http://dlmf.
nist.
gov/LaTeXML).
Theothermapping,the'document'mapping,isusedinthecreateddocument;thismaybedifferentfromthe'code'mappinginordertoaccommodateDTDs,forexample,orforusebyotherapplicationsthatexpectarigidnamespacemapping.
C.
1.
COMMONMODULES121$model->registerNamespace($prefix,$namespaceurl);Register$prefixtostandforthenamespace$namespaceurl.
ThisprexcanthenbeusedtocreatenodesinconstructorsandDocumentmethods.
ItwillalsoberecognizedinXPathexpressions.
$model->getNamespacePrefix($namespace,$forattribute,$probe);Returntheprextouseforthegiven$namespace.
If$forattributeisnonzero,thenitlooksuptheprexasappropriateforattributes.
If$probeisnonzero,itonlyprobesfortheprex,withoutcreatingamissingentry.
$model->getNamespace($prefix,$probe);Returnthenamespaceurlforthegiven$prefix.
Modelqueries$boole=$model->canContain($tag,$childtag);Returnswhetheranelementwithqualiedname$tagcancontainanele-mentwithqualiedname$childtag.
Thetagnames#PCDATA,#Document,#Commentand#ProcessingInstructionarespeciallyrecognized.
$boole=$model->canHaveAttribute($tag,$attribute);Returnswhetheranelementwithqualiedname$tagisallowedtohaveanattributewiththegivenname.
SeealsoLaTeXML::Common::Model::DTD,LaTeXML::Common::Model::RelaxNG.
LaTeXML::Common::Model::DTDRepresentsDTDdocumentmodels;extendsLaTeXML::Common::Model.
LaTeXML::Common::Model::RelaxNGRepresentsRelaxNGdocumentmodels;extendsLaTeXML::Common::Model.
LaTeXML::Common::ErrorErrorandProgressReportingandLoggingsupport.
DescriptionLaTeXML::Common::Errordoessomesimplestackanalysistogeneratemoreinformative,readable,errormessagesforLaTeXML.
ItsroutinesareusedbytheerrorreportingmethodsfromLaTeXML::Global,namelyWarn,ErrorandFatal.
122APPENDIXC.
MODULESErrorReportingTheErrorreportingfunctionsalltakeasimilarsetofarguments,thedifferencesareintheimpliedseverityofthesituation,andintheamountofdetailthatwillbereported.
The$categoryisastringnamingabroadcategoryoferrors,suchas"unde-ned".
Thesetisopen-ended,butseethemanualforalistofrecognizedcategories.
$objectistheobjectwhosepresenceorlackcausedtheproblem.
$whereindicateswheretheproblemoccurred;passsinthe$gulletor$stomachiftheproblemoccurredduringexpansionordigestion;passinadoc-umentnodeifitoccurredthere.
Astringwillbeusedasis;ifanundenedvalueisused,theerrorhandlerwilltrytoguess.
The$messageshouldbeasomewhatconcise,butreadable,explanationoftheproblem,butoughttonotrefertothedocumentorany"incidentspecic"information,soastosupportindexinginbuildsystems.
@detailsprovidesadditionallinesofinformationthatmaybeindidentspecic.
Fatal($category,$object,$where,$message,@details);Signalsanfatalerror,printing$messagealongwithsomecontext.
Inverbosemodeastacktraceisprinted.
Error($category,$object,$where,$message,@details);Signalsanerror,printing$messagealongwithsomecontext.
Ifinstrictmode,thisisthesameasFatal().
Otherwise,itattemptstocontinueprocessing.
.
Warn($category,$object,$where,$message,@details);Printsawarningmessagealongwithashortindicatoroftheinputcontext,unlessverbosityisquiet.
Info($category,$object,$where,$message,@details);Printsaninformationalmessagealongwithashortindicatoroftheinputcontext,unlessverbosityisquiet.
NoteProgress($message);Prints$messageunlesstheverbositylevelbelow0.
Typicallyjustashortmarktoindicatemotion,butcanbelonger;provideyourownnewlines,ifneeded.
NoteProgressDetailed($message);LikeNoteProgress,butfornoiserprogress,onlyprintswhenverbosity>=1.
InternalFunctionsNouserserviceablepartsinside.
Thesesymbolsarenotex-ported.
$string=LaTeXML::Common::Error::generateMessage($typ,$msg,$lng,@more);Constructsanerrororwarningmessagebasedonthecurrentstackandthecur-rentlocationinthedocument.
$typisashortstringcharacterizingthetypeofC.
2.
COREMODULES123message,suchas"Error".
$msgistheerrormessageitself.
If$lngistrue,willgenerateamoreverbosemessage;thisalsousestheVERBOSITYsetinthe$STATE.
Longermessageswillshowatraceoftheobjectsinvokedonthestack,@moreareadditionalstringstoincludeinthemessage.
$string=LaTeXML::Common::Error::stacktrace;Returnaformattedstringshowingatraceofthestackframesupuntilthisfunctionwasinvoked.
@objects=LaTeXML::Common::Error::objectStack;Returnalistofobjectsinvokedonthestack.
Thisprocedureonlyconsidersthosestackframeswhichinvolvemethods,andtheobjectsarethose(unique)objectsthatthemethodwascalledon.
C.
2CoreModulesDocumentationLaTeXML::Core::StateStoresthecurrentstateofprocessing.
DescriptionALaTeXML::Core::Stateobjectstoresthecurrentstateofprocessing.
Itrecord-ingcatcodes,variablesvalues,denitionsandsoforth,aswellasmimicingTeX'sscopingrules.
AccesstoStateandProcessing$STATE->getStomach;ReturnsthecurrentStomachusedfordigestion.
$STATE->getModel;ReturnsthecurrentModelrepresentingthedocumentmodel.
ScopingTheassignmentmethods,describedbelow,generallytakea$scopeargu-ment,whichdetermineshowtheassignmentismade.
Theallowedvaluesandthierimplicationsare:global:globalassignment.
local:localassignment,withinthecurrentgrouping.
undef:globalif\globalpreceded,elselocal(default):storestheassignmentina'scope'whichcanbeloadedlater.
Ifnoscopingisspecied,thentheassignmentwillbeglobalifapreceding\globalhassettheglobalag,otherwisethevaluewillbeassignedwithinthecur-rentgrouping.
124APPENDIXC.
MODULES$STATE->pushFrame;Startsanewlevelofgrouping.
Notethatthisislowerlevelthan\bgroup;SeeLaTeXML::Core::Stomach.
$STATE->popFrame;Endsthecurrentlevelofgrouping.
Notethatthisislowerlevelthan\egroup;SeeLaTeXML::Core::Stomach.
$STATE->setPrefix($prefix);Setsaprex(eg.
globalfor\global,etc)forthenextoperation,ifapplica-ble.
$STATE->clearPrefixes;Clearsanyprexes.
Values$value=$STATE->lookupValue($name);Lookupthecurrentvalueassociatedwiththethestring$name.
$STATE->assignValue($name,$value,$scope);Assign$valuetobeassociatedwiththethestring$name,accordingtothegivenscopingrule.
Valuesarealsousedtospecifymostcongurationparameters(whichcanthere-foralsobescoped).
Therecognizedcongurationparametersare:VERBOSITY:thelevelofverbosityfordebuggingoutput,with0beingdefault.
STRICT:whethererrors(eg.
undefinedmacros)arefatal.
INCLUDE_COMMENTS:whethertopreservecommentsinthesource,andtoaddoccasionallinenumbercomments.
(Defaulttrue).
PRESERVE_NEWLINES:whethernewlinesinthesourceshouldbepreserved(not100%TeX-like).
Bydefaultthisistrue.
SEARCHPATHS:alistofdirectoriestosearchforsources,implementations,etc.
$STATE->pushValue($name,$value);Thisislike->assign,butpushesavalueontotheendofthestoredvalue,whichshouldbeaLISTreference.
Scopingisnothandledhere(yet),itsimplypushesthevalueontothelastbindingof$name.
$boole=$STATE->isValuebound($type,$name,$frame);Returnswhetherthevalue$nameisbound.
If$frameisgiven,checkwhetheritisboundinthe$frame-thframe,with0beingthetopframe.
C.
2.
COREMODULES125CategoryCodes$value=$STATE->lookupCatcode($char);Lookupthecurrentcatcodeassociatedwiththethecharacter$char.
$STATE->assignCatcode($char,$catcode,$scope);Set$chartohavethegiven$catcode,withtheassignmentmadeaccordingtothegivenscopingrule.
Thismethodisalsousedtospecifywhetheragivencharacterisactiveinmathmode,byusingmath:$charforthecharacter,andusingavalueof1tospecifythatitisactive.
Denitions$defn=$STATE->lookupMeaning($token);Getthe"meaning"currentlyassociatedwith$token,eitherthedenition(ifitisacontrolsequenceoractivecharacter)orthetokenitselfifitshouldn'tbeexecutable.
(SeeLaTeXML::Core::Definition)$STATE->assignMeaning($token,$defn,$scope);Setthedenitionassociatedwith$tokento$defn.
If$globallyistrue,itmakesthistheglobaldenitionratherthanboundwithinthecurrentgroup.
(SeeLaTeXML::Core::Definition,andLaTeXML::Package)$STATE->installDefinition($definition,$scope);Installthedenitionintothecurrentstackframeunderitsnormalcontrolse-quence.
NamedScopesNamedscopescanbeusedtosetvariablesorredenecontrolse-quenceswithinascopeotherthanthestandardTeXgrouping.
Forexample,theLa-TeXimplementationwillautomaticallyactivateanydenitionsthatweredenedwithanamedscopeof,say"section:4",duringtheportionofthedocumentthathasthesectioncounterequalto4.
Similarly,ascopenamed"label:foo"willbeactivatedinportionsofthedocumentwhere\label{foo}isineffect.
$STATE->activateScope($scope);Installsanydenitionsthatwereassociatedwiththenamed$scope.
Notethattheseareplacedinthecurrentgroupingframeandwilldisappearwhenthatgroupingends.
$STATE->deactivateScope($scope);Removesanydenitionsthatwereassociatedwiththenamed$scope.
Nor-mallynotneeded,sinceascopesdenitionsarelocallyboundanyway.
126APPENDIXC.
MODULES$sp=$STATE->convertUnit($unit);ConvertsaTeXunitoftheform'10em'(orwhateverTeXunit)intoscaledpoints.
(Denedheresinceinprincipleitcouldtrackthesizeofemsandsoforth(butcurrentlydoesn't))LaTeXML::Core::MouthTokenizetheinput.
DescriptionALaTeXML::Core::Mouth(andsubclasses)isresponsiblefortokenizing,ie.
con-vertingplaintextandstringsintoLaTeXML::Core::Tokensaccordingtothecurrentcategorycodes(catcodes)storedintheLaTeXML::Core::State.
ItextendsLaTeXML::Common::Object.
CreatingMouths$mouth=LaTeXML::Core::Mouth->create($source,%options);CreatesanewMouthoftheappropriateclassforreadingfrom$source.
$mouth=LaTeXML::Core::Mouth->new($string,%options);CreatesanewMouthreadingfrom$string.
Methods$token=$mouth->readToken;ReturnsthenextLaTeXML::Core::Tokenfromthesource.
$boole=$mouth->hasMoreInput;Returnswhetherthereismoredatatoread.
$string=$mouth->getLocator;Returnadescriptionofcurrentpositioninthesource,forreportingerrors.
$tokens=$mouth->readTokens;Readsallremainingtokensinthemouth,removinganytrailingspacecatcodetokens$lines=$mouth->readRawLine;Readsaraw(untokenized)linefrom$mouth,orundefifnoneisfound.
LaTeXML::Core::GulletExpandsexpandabletokensandparsescommontokensequences.
C.
2.
COREMODULES127DescriptionALaTeXML::Core::Gulletreadstokens(LaTeXML::Core::Token)fromaLaTeXML::Core::Mouth.
Itisresponsibleforexpandingmacrosandex-pandablecontrolsequences,ifthecurrentdenitionassociatedwiththetokenintheLaTeXML::Core::StateisanLaTeXML::Core::Definition::Expandabledenition.
TheLaTeXML::Core::Gulletalsoprovidesavarietyofmethodsforreadingvarioustypesofinputsuchasarguments,optionalarguments,aswellasforparsingLaTeXML::Common::Number,LaTeXML::Common::Dimension,etc,accordingtoTeX'srules.
ItextendsLaTeXML::Common::Object.
ManagingInput$gullet->openMouth($mouth,$noautoclose);IsthispublicPreparestoreadtokensfrom$mouth.
If$noautocloseistrue,theMouthwillnotbeautomaticallyclosedwhenitisexhausted.
$gullet->closeMouth;IsthispublicFinishesreadingfromthecurrentmouth,andrevertstotheoneineffectbeforethelastopenMouth.
$gullet->flush;IsthispublicClearsallinputs.
$gullet->getLocator;Returnsanobjectdescribingthecurrentlocationintheinputstream.
Low-levelmethods$tokens=$gullet->expandTokens($tokens);ReturntheLaTeXML::Core::Tokensresultingfromexpandingalltheto-kensin$tokens.
Thisisactuallyonlyusedinafewcircumstanceswheretheargumentstoanexpandableneedexplicitexpansion;usuallyexpansionhappensattherighttime.
$token=$gullet->readToken;Returnthenexttokenfromtheinputsource,orundefifthereisnomoreinput.
$token=$gullet->readXToken($toplevel,$commentsok);Returnthenextunexpandabletokenfromtheinputsource,orundefifthereisnomoreinput.
Ifthenexttokenisexpandable,itisexpanded,anditsexpansionisreinsertedintotheinput.
If$commentsok,acommentreadorpendingwillbereturned.
$gullet->unread(@tokens);Pushthe@tokensbackintotheinputstreamtobere-read.
128APPENDIXC.
MODULESMid-levelmethods$token=$gullet->readNonSpace;Readandreturnthenextnon-spacetokenfromtheinputafterdiscardinganyspaces.
$gullet->skipSpaces;Skipthenextspacesfromtheinput.
$gullet->skip1Space($expanded);Skipthenexttokenfromtheinputifitisaspace.
IfC($expanded>istrue,expands(like).
$tokens=$gullet->readBalanced;Readasequenceoftokensfromtheinputuntilthebalancing'}'(assumingthe'{'hasalreadybeenread).
ReturnsaLaTeXML::Core::Tokens,exceptinanarraycontext,returnsthecollectedtokensandtheclosingtoken.
$boole=$gullet->ifNext($token);Returnstrueifthenexttokenintheinputmatches$token;thepossiblymatch-ingtokenremainsintheinput.
$tokens=$gullet->readMatch(@choices);Readandreturnwhicheverof@choicesmatchestheinput,orundefifnonedo.
EachofthechoicesisanLaTeXML::Core::Tokens.
$keyword=$gullet->readKeyword(@keywords);Readandreturnwhicheverof@keywords(eachastring)matchestheinput,orundefifnonedo.
ThisissimilartoreadMatch,butcaseandcatcodesareignored.
Also,leadingspacesareskipped.
$tokens=$gullet->readUntil(@delims);Readandreturna(balanced)sequenceofLaTeXML::Core::Tokensuntilmatchingoneofthetokensin@delims.
Inalistcontext,italsoreturnswhichofthedelimitersendedthesequence.
High-levelmethods$tokens=$gullet->readArg;ReadandreturnaTeXargument;thenextTokenorTokens(ifsurroundedbybraces).
$tokens=$gullet->readOptional($default);ReadandreturnaLaTeXoptionalargument;returns$defaultifthereisno'[',otherwisethecontentsofthe[].
C.
2.
COREMODULES129$thing=$gullet->readValue($type);Readsanargumentofagiventype:oneof'Number','Dimension','Glue','MuGlue'or'any'.
$value=$gullet->readRegisterValue($type);Readacontrolsequencetoken(andpossiblyit'sarguments)thatnamesaregister,andreturnthevalue.
Returnsundefifthenexttokenisn'tsucharegister.
$number=$gullet->readNumber;ReadaLaTeXML::Common::NumberaccordingtoTeX'srulesofthevari-ousthingsthatcanbeusedasanumericalvalue.
$dimension=$gullet->readDimension;ReadaLaTeXML::Common::DimensionaccordingtoTeX'srulesofthevariousthingsthatcanbeusedasadimensionvalue.
$mudimension=$gullet->readMuDimension;ReadaLaTeXML::Core::MuDimensionaccordingtoTeX'srulesofthevariousthingsthatcanbeusedasamudimensionvalue.
$glue=$gullet->readGlue;ReadaLaTeXML::Common::GlueaccordingtoTeX'srulesofthevariousthingsthatcanbeusedasagluevalue.
$muglue=$gullet->readMuGlue;ReadaLaTeXML::Core::MuGlueaccordingtoTeX'srulesofthevariousthingsthatcanbeusedasamugluevalue.
LaTeXML::Core::StomachDigeststokensintoboxes,lists,etc.
DescriptionLaTeXML::Core::StomachdigeststokensreadfromaLaTeXML::Core::Gullet(theywillhavealreadybeenexpanded).
ItextendsLaTeXML::Common::Object.
TherearebasicallyfourcaseswhendigestingaLaTeXML::Core::Token:AplaincharacterissimplyconvertedtoaLaTeXML::Core::BoxrecordingthecurrentLaTeXML::Common::Font.
130APPENDIXC.
MODULESAprimitiveIfacontrolsequencerepresentsLaTeXML::Core::Definition::Primitive,theprimitiveisinvoked,executingitsstoredsubroutine.
Thisistypicallydoneforsideeffect(changingthestateintheLaTeXML::Core::State),al-thoughtheymayalsocontributedigestedmaterial.
Aswithmacros,anyargu-mentstotheprimitivearereadfromtheLaTeXML::Core::Gullet.
Grouping(orenvironmentbodies)arecollectedintoaLaTeXML::Core::List.
ConstructorsAspecialclassofcontrolsequence,calledaLaTeXML::Core::Definition::ConstructorproducesaLaTeXML::Core::Whatsitwhichremembersthecontrolse-quenceandargumentsthatcreatedit,anddenesitsowntranslationintoXMLelements,attributesanddata.
Argumentstoaconstructorarereadfromthegulletandalsodigested.
Digestion$list=$stomach->digestNextBody;ReturnthedigestedLaTeXML::Core::Listafterreadinganddigestinga'body'fromtheitsGullet.
Thebodyextendsuntilthecurrentlevelofboxingorenvironmentisclosed.
$list=$stomach->digest($tokens);ReturntheLaTeXML::Core::Listresutingfromdigestingthegivento-kens.
Thisistypicallyusedtodigestargumentstoprimitivesorconstructors.
@boxes=$stomach->invokeToken($token);Invokethegiven(expanded)token.
IfitcorrespondstoaPrimitiveorConstruc-tor,thedenitionwillbeinvoked,readinganyneededargumentsfromthecur-rentinputsource.
Otherwise,thetokenwillbedigested.
AListofBox's,Lists,Whatsit'sisreturned.
@boxes=$stomach->regurgitate;Removesandreturnsalistoftheboxesalreadydigestedatthecurrentlevel.
Thispeculiarbeastisusedbythingslike\choose(whichisaPrimitiveinTeX,butaConstructorinLaTeXML).
Grouping$stomach->bgroup;Beginanewlevelofbindingbypushinganewstackframe,andanewlevelofboxingthedigestedoutput.
C.
2.
COREMODULES131$stomach->egroup;Endalevelofbindingbypoppingthelaststackframe,undoingwhateverbind-ingsappearedthere,andalsodecrementingthelevelofboxing.
$stomach->begingroup;Beginanewlevelofbindingbypushinganewstackframe.
$stomach->endgroup;Endalevelofbindingbypoppingthelaststackframe,undoingwhateverbind-ingsappearedthere.
Modes$stomach->beginMode($mode);Beginprocessingin$mode;oneof'text','display-math'or'inline-math'.
Thisalsobeginsanewlevelofgroupingandswitchestoafontappropriateforthemode.
$stomach->endMode($mode);Endprocessingin$mode;anerrorissignalledif$stomachisnotcurrentlyin$mode.
Thisalsoendsalevelofgrouping.
LaTeXML::Core::DocumentRepresentsanXMLdocumentunderconstruction.
DescriptionALaTeXML::Core::DocumentrepresentsanXMLdocumentbeingcon-structedbyLaTeXML,andalsoprovidesthemethodsforconstructingit.
ItextendsLaTeXML::Common::Object.
LaTeXMLwillhavedigestedthesourcematerialresultinginaLaTeXML::Core::List(fromaLaTeXML::Core::Stomach)ofLaTeXML::Core::Boxs,LaTeXML::Core::Whatsitsandsublists.
Atthisstage,adocumentiscreatedanditisresponsiblefor'ab-sorbing'thedigestedmaterial.
Generally,theLaTeXML::Core::BoxsandLaTeXML::Core::Listscreatetextnodes,whereastheLaTeXML::Core::WhatsitscreateXMLdocumentfragments,elementsandattributesaccordingtothedeningLaTeXML::Core::Definition::Constructor.
Mostdocumentconstructionoccursatacurrentinsertionpointwherema-terialwillbeadded,andwhichmovesalongwiththeinsertedmaterial.
TheLaTeXML::Common::Model,derivedfromvariousdeclarationsanddocumenttype,isconsultedtodeterminewhetheraninsertionisallowedandwhenelementsmayneedtobeautomaticallyopenedorclosedinordertocarryoutagiveninsertion.
Forexample,asubsectionelementwilltypicallybeclosedautomaticallywhenitisattemptedtoopenasectionelement.
132APPENDIXC.
MODULESInthemethodsdescribedhere,theterm$qnameisusedforXMLqualiednames.
Thesearetagnameswithanamespaceprex.
TheprexshouldbeoneregisteredwiththecurrentModel,forusewithinthecode.
ThisprexisnotnecessarilythesameastheoneusedinanyDTD,butshouldbemappedtotheaNamespaceURIthatwasregisteredfortheDTD.
Theargumentsnamed$nodeareanXML::LibXMLnode.
Themethodsherearegroupedintothreesectionscoveringbasicaccesstothedocu-ment,insertionmethodsatthecurrentinsertionpoint,andlesscommonlyused,lower-level,documentmanipulationmethods.
Accessors$doc=$document->getDocument;ReturnstheXML::LibXML::Documentcurrentlybeingconstructed.
$doc=$document->getModel;ReturnstheLaTeXML::Common::Modelthatrepresentsthedocumentmodelusedforthisdocument.
$node=$document->getNode;Returnsthenodeatthecurrentinsertionpointduringconstruction.
Thisnodeisconsideredstilltobe'open';anyinsertionswillgointoit(ifpossible).
ThenodewillbeanXML::LibXML::Element,XML::LibXML::Textor,initially,XML::LibXML::Document.
$node=$document->getElement;ReturnstheclosestancestortothecurrentinsertionpointthatisanElement.
$node=$document->getChildElement($node);Returnsalistofthechildelements,ifany,ofthe$node.
@nodes=$document->getLastChildElement($node);Returnsthelastchildelementofthe$node,ifithasone,elseundef.
$node=$document->getFirstChildElement($node);Returnstherstchildelementofthe$node,ifithasone,elseundef.
@nodes=$document->findnodes($xpath,$node);Returnsalistofnodesmatchingthegiven$xpathexpression.
Thecontextnodefor$xpathis$node,ifgiven,otherwiseitisthedocumentelement.
$node=$document->findnode($xpath,$node);Returnstherstnodematchingthegiven$xpathexpression.
Thecontextnodefor$xpathis$node,ifgiven,otherwiseitisthedocumentelement.
C.
2.
COREMODULES133$node=$document->getNodeQName($node);Returnsthequaliedname(localnamewithnamespaceprex)ofthegiven$node.
Thenamespaceprexmappingisthecodemappingofthecurrentdoc-umentmodel.
$boolean=$document->canContain($tag,$child);Returnswhetheranelement$tagcancontainachild$child.
$tagand$childcanbenodes,qualiednamesofnodes(prex:localname),oroneofasetofspecialsymbols#PCDATA,#Comment,#Documentor#ProcessingInstruction.
$boolean=$document->canContainIndirect($tag,$child);Returnswhetheranelement$tagcancontainachild$childeitherdirectly,orafterautomaticallyopeningoneormoreautoOpen-ableelements.
$boolean=$document->canContainSomehow($tag,$child);Returnswhetheranelement$tagcancontainachild$childeitherdirectly,orafterautomaticallyopeningoneormoreautoOpen-ableelements.
$boolean=$document->canHaveAttribute($tag,$attrib);Returnswhetheranelement$tagcanhaveanattributenamed$attrib.
$boolean=$document->canAutoOpen($tag);Returnswhetheranelement$tagisabletobeautomaticallyopened.
$boolean=$document->canAutoClose($node);Returnswhetherthenode$nodecanbeautomaticallyclosed.
ConstructionMethodsThesemethodsarethemostcommononesusedforcon-structionofdocuments.
Theygenerallyoperatebycreatingnewmaterialatthecurrentinsertionpoint.
Thatpointinitiallyisjustthedocumentitself,butitmovesalongtofollowanynewinsertions.
Thesemethodsalsoadapttothedocumentmodelsoastoautomaticallyopenorcloseelements,whenitisrequiredforthependinginsertionandallowedbythedocumentmodel(SeeTag).
$xmldoc=$document->finalize;Thismethodnalizesthedocumentbycleaningupvarioustemporaryattributes,andreturnstheXML::LibXML::Documentthatwasconstructed.
@nodes=$document->absorb($digested);Absorbthe$digestedobjectintothedocumentatthecurrentinsertionpointaccordingtoitstype.
Variousofthetheothermethodsareinvokedasneeded,anddocumentnodesmaybeautomaticallyopenedorclosedaccordingtothedocumentmodel.
134APPENDIXC.
MODULESThismethodreturnsthenodesthatwereconstructed.
Notethatthenodesmayincludechildrenofothernodes,andnodesthatmayalreadyhavebeenremovedfromthedocument(SeelterChildrenandlterDeleted).
Also,textinsertionsareoftenmergedwithexistingtextnodes;insuchcases,thewholetextnodeisincludedintheresult.
$document->insertElement($qname,$content,%attributes);Thisisashorthandforcreatinganelement$qname(withgivenattributes),absorbing$contentfromwithinthatnewnode,andthenclosingit.
The$contentmustbedigestedmaterial,eitherasinglebox,oranarrayofboxes,whichwillbeabsorbedintotheelement.
Thismethodreturnsthenewlycreatednode,althoughitwillnolongerbethecurrentinsertionpoint.
$document->insertMathToken($string,%attributes);Insertamathtoken(XMTok)containingthestring$stringwiththegivenat-tributes.
Usefulattributeswouldbename,role,font.
Returnsthenewlyinsertednode.
$document->insertComment($text);Insert,andreturn,acommentwiththegiven$textintothecurrentnode.
$document->insertPI($op,%attributes);Insert,andreturn,aProcessingInstructionintothecurrentnode.
$document->openText($text,$font);Openatextnodeinfont$font,performinganyrequiredautomaticopeningandclosingofintermedatenodes(includingthoseneededforfontchanges)andinsertingthestring$textintoit.
$document->openElement($qname,%attributes);Openanelement,named$qnameandwiththegivenattributes.
Thiswillbeinsertedintothecurrentnodewhileperforminganyrequiredautomaticopen-ingandclosingofintermedatenodes.
Thenewelementisreturned,andalsobecomesthecurrentinsertionpoint.
Anerror(fatalifinStrictmode)issig-nalledifthereisnoallowedwaytoinsertsuchanelementintothecurrentnode.
$document->closeElement($qname);Closetheclosestopenelementnamed$qnameincludinganyintermedatenodesthatmaybeautomaticallyclosed.
Ifthatisnotpossible,signalanerror.
Theclosednode'sparentbecomesthecurrentnode.
Thismethodreturnstheclosednode.
$node=$document->isOpenable($qname);Checkwhetheritispossibletoopena$qnameelementatthecurrentinsertionpoint.
C.
2.
COREMODULES135$node=$document->isCloseable($qname);Checkwhetheritispossibletoclosea$qnameelement,returningthenodethatwouldbeclosedifpossible,otherwiseundef.
$document->maybeCloseElement($qname);Closea$qnameelement,ifitispossibletodoso,returnstheclosednodeifitwasfound,elseundef.
$document->addAttribute($key=>$value);Addthegivenattributetothenodenearesttothecurrentinsertionpointthatisallowedtohaveit.
Thisdoesnotchangethecurrentinsertionpoint.
$document->closeToNode($node);Thismethodclosesallchildrenof$nodeuntil$nodebecomestheinsertionpoint.
Notethatitclosesanyopennodes,notonlyautoCloseableones.
InternalInsertionMethodsThesearedescribedasanaidetounderstandingthecode;theyrarely,ifever,shouldbeusedoutsidethismodule.
$document->setNode($node);Setsthecurrentinsertionpointtobe$node.
Thisshouldberarelyused,ifatall;Theconstructionmethodsofdocumentgenerallymaintainthenotionofinsertionpointautomatically.
Thismaybeusefultoallowinsertionintoadifferentpartofthedocument,butyouprobablywanttosettheinsertionpointbacktothepreviousnode,afterwards.
$string=$document->getInsertionContext($levels);Fordebugging,returnastringshowingthecontextofthecurrentinsertionpoint;thatis,thestringofthenodesleadinguptoit.
if$levelsisdened,showonlythatmanynodes.
$node=$document->findinsertionpoint($qname);Thisinternalmethodisusedtondtheappropriatepoint,relativetothecurrentinsertionpoint,thatanelementwiththespecied$qnamecanbeinserted.
Thatpositionmayrequireautomaticopeningorclosingofelements,accordingtowhatisallowedbythedocumentmodel.
@nodes=getInsertionCandidates($node);Returnsalistofelementswhereanarbitraryinsertionmighttakeplace.
Roughlythisisaliststartingwith$node,followedbyitsparentandtheparentssiblings(inreverseorder),followedbythegrandparentandsiblings(inreverseorder).
$node=$document->floatToElement($qname);Findsthenearestelementatorprecedingthecurrentinsertionpoint(seegetInsertionCandidates),thatcanacceptanelement$qname;itmoves136APPENDIXC.
MODULEStheinsertionpointtothatpoint,andreturnsthepreviousinsertionpoint.
Gen-erally,afterdoingwhateveryouneedatthenewinsertionpoint,youshouldcall$document->setNode($node);torestoretheinsertionpoint.
Ifnosuchpointisfound,theinsertionpointisleftunchanged,andundefisreturned.
$node=$document->floatToAttribute($key);ThismethodworksthesameasfloatToElement,butndthenearestele-mentthatcanaccepttheattribute$key.
$node=$document->openTextinternal($text);Thisisaninternalmethod,usedbyopenText,thatassumestheinsertionpointhasbeenappropriatelyadjusted.
)$node=$document->openMathTextinternal($text);Thisinternalmethodappends$texttothecurrentinsertionpoint,whichisassumedtobeamathnode.
Itchecksformathligaturesandcarriesoutanycombinationscalledfor.
$node=$document->closeTextinternal();Thisinternalmethodclosesthecurrentnode,whichshouldbeatextnode.
Itcarriesoutanytextligaturesonthecontent.
$node=$document->closeNodeinternal($node);Thisinternalmethodclosesanyopentextorelementnodesstartingatthecurrentinsertionpoint,uptoandincluding$node.
Afterwards,theparentof$nodewillbethecurrentinsertionpoint.
Itcondensesthetreetoavoidredundantfontswitchingelements.
$document->afterOpen($node);CarriesoutanyafterOpenoperationsthathavebeenrecorded(usingTag)fortheelementnameof$node.
$document->afterClose($node);CarriesoutanyafterCloseoperationsthathavebeenrecorded(usingTag)fortheelementnameof$node.
DocumentModicationThefollowingmethodsareusedtoperformvarioussortsofmodicationandrearrangementsofthedocument,afterthenormalowofinsertionhastakenplace.
Thesemaybeneededafteranenvironment(orperhapsthewholedocument)hasbeencompletedandoneneedstoanalyzewhatitcontainstodecideontheappropriaterepresentation.
$document->setAttribute($node,$key,$value);Setstheattribute$keyto$valueon$node.
ThismethodispreferredoverthedirectLibXMLone,sinceittakescareofdecodingnamespaces(if$keyisaqname),andalsomanagesrecordingofxml:id's.
C.
2.
COREMODULES137$document->recordID($id,$node);Recordstheassociationofthegiven$nodewiththe$id,whichshouldbethexml:idattributeofthe$node.
Usuallythisassociationwillbemaintainedbythemethodsthatcreatenodesorsetattributes.
$document->unRecordID($id);Removesthenodeassociatedwiththegiven$id,ifany.
Thismightbeneededifanodeisdeleted.
$document->modifyID($id);Adjusts$id,ifneeded,sothatitisunique.
Itdoesthisbyappendingaletterandincrementinguntilitndsanidthatisnotyetassociatedwithanode.
$node=$document->lookupID($id);Returnsthenode,ifany,thatisassociatedwiththegiven$id.
$document->setNodeBox($node,$box);Recordsthe$box(beingaBox,WhatsitorList),thatwas(presumably)re-sponsibleforthecreationoftheelement$node.
Thisinformationisusefulfordeterminingsourcelocations,originalTeXstrings,andsoforth.
$box=$document->getNodeBox($node);Returnsthe$boxthatwasresponsibleforcreatingtheelement$node.
$document->setNodeFont($node,$font);Recordsthefontobjectthatencodesthefontthatshouldbeusedtodisplayanytextwithintheelement$node.
$font=$document->getNodeFont($node);Returnsthefontobjectassociatedwiththeelement$node.
$node=$document->openElementAt($point,$qname,%attributes);Opensanewchildelementin$pointwiththequaliedname$qnameandwiththegivenattributes.
Thismethodisnotaffectedby,nordoesitaffect,thecurrentinsertionpoint.
Itdoesmanagenamespaces,xml:id'sandassociatingabox,fontandlocatorwiththenewelement,aswellasrunninganyafterOpenoperations.
$node=$document->closeElementAt($node);Closes$node.
Thismethodisnotaffectedby,nordoesitaffect,thecurrentinsertionpoint.
However,itdoesrunanyafterCloseoperations,soanyele-mentthatwascreatedusingthelower-levelopenElementAtshouldbeclosedusingthismethod.
138APPENDIXC.
MODULES$node=$document->appendClone($node,@newchildren);Appendsclonesof@newchildrento$node.
Thismethodmodiesanyidsfoundwithin@newchildren(usingmodifyID),andxesupanyreferencestothoseidswithintheclonessothattheyrefertothemodiedid.
$node=$document->wrapNodes($qname,@nodes);Thismethodwrapsthe@nodesbyanewelementwithqualiedname$qname,thatnewnodereplacestherstof@node.
Theremainingnodesin@nodesmustbefollowingsiblingsoftherstone.
NOTE:DoesthisneedmultiplenodesIfso,perhapssomekindofmovenodeshelperOtherwise,whataboutattributes$node=$document->unwrapNodes($node);Unwrapthechildrenof$node,byreplacing$nodebyitschildren.
$node=$document->replaceNode($node,@nodes);Replace$nodeby@nodes;presumablytheyaresomesortofdescendantnodes.
$node=$document->renameNode($node,$newname);Rename$nodetothetagname$newname;equivalentlyreplace$nodebyanewnodewithname$newnameandcopytheattributesandcontents.
Itisassumedthat$newnamecancontainthoseattributesandcontents.
@nodes=$document->filterDeletions(@nodes);Thisfunctionisusefulwith$doc-absorb($box)>,whenyouwanttolteroutanynodesthathavebeendeletedandnolongerappearinthedocument.
@nodes=$document->filterChildren(@nodes);Thisfunctionisusefulwith$doc-absorb($box)>,whenyouwanttolteroutanynodesthatarechildrenofothernodesin@nodes.
LaTeXML::Core::RewriteRewriterulesformodifyingtheXMLdocument.
DescriptionLaTeXML::Core::RewriteimplementsrewriterulesformodifyingtheXMLdocument.
SeeLaTeXML::Packagefordeclarationswhichcreatetherewriterules.
Furtherdocumentationneeded.
LaTeXML::Core::TokenRepresentationofaToken:apairofcharacterandcategorycode(catcode);ItextendsLaTeXML::Common::Object.
C.
2.
COREMODULES139Exportedfunctions$catcode=CCESCAPE;Constantsforthecategorycodes:CC_BEGIN,CC_END,CC_MATH,CC_ALIGN,CC_EOL,CC_PARAM,CC_SUPER,CC_SUB,CC_IGNORE,CC_SPACE,CC_LETTER,CC_OTHER,CC_ACTIVE,CC_COMMENT,CC_INVALID,CC_CS.
[Thelast2are(apparent)extensions,withcatcodes16and17,respectively].
$token=Token($string,$cc);CreatesaLaTeXML::Core::Tokenwiththegivencontentandcatcode.
Thefollowingshorthandversionsarealsoexportedforconvenience:T_BEGIN,T_END,T_MATH,T_ALIGN,T_PARAM,T_SUB,T_SUPER,T_SPACE,T_LETTER($letter),T_OTHER($char),T_ACTIVE($char),T_COMMENT($comment),T_CS($cs)@tokens=Explode($string);Returnsalistofthetokenscorrespondingtothecharactersin$string.
AlltokenshavecatcodeCCOTHER,exceptforspaceswhichhavecatcodeCCSPACE.
@tokens=ExplodeText($string);Returnsalistofthetokenscorrespondingtothecharactersin$string.
All(roman)lettershavecatcodeCCLETTER,allothershavecatcodeCCOTHER,exceptforspaceswhichhavecatcodeCCSPACE.
UnTeX($object);Converts$objecttoastringcontainingTeXthatcreatedit(orcouldhave).
NotethatthisisnotnecessarilytheoriginalTeXcode;expansionsorothersub-stitutionsmayhavetakenplace.
Methods@tokens=$object->unlist;Returnalistofthetokensmakingupthis$object.
$string=$object->toString;Returnastringrepresenting$object.
$string=$token->getCSName;Returnthestringorcharacterpartofthe$token;forthespecialcategorycodes,returnsthestandardstring(eg.
TBEGIN->getCSNamereturns"{").
140APPENDIXC.
MODULES$string=$token->getString;Returnthestringorcharacterpartofthe$token.
$code=$token->getCharcode;Returnthecharactercodeofthecharacterpartofthe$token,or256ifitisacontrolsequence.
$code=$token->getCatcode;Returnthecatcodeofthe$token.
LaTeXML::Core::TokensRepresentslistsofLaTeXML::Core::Token's;extendsLaTeXML::Common::Object.
Exportedfunctions$tokens=Tokens(@token);CreatesaLaTeXML::Core::TokensfromalistofLaTeXML::Core::Token'sTokensmethodsThefollowingmethodisspecictoLaTeXML::Core::Tokens.
$tokenscopy=$tokens->clone;Returnashallowcopyofthe$tokens.
ThisisusefulbeforereadingfromaLaTeXML::Core::Tokens.
LaTeXML::Core::BoxRepresentationsofdigestedobjects;extendsLaTeXML::Common::Object.
ExportedFunctions$box=Box($string,$font,$locator,$tokens);CreatesaBoxrepresentingthe$stringinthegiven$font.
The$locatorrecordsthedocumentsourceposition.
The$tokensisaTokenslistcontainingtheTeXthatcreated(orcouldhave)theBox.
If$fontor$locatorareundef,theyareobtainedfromthecurrentlyactiveLaTeXML::Core::State.
Notethat$stringcanbeundefwhichcontributesnothingtothegenerateddocument,butdoesrecordtheTeXcode(in$tokens).
C.
2.
COREMODULES141Methods$font=$digested->getFont;Returnsthefontusedby$digested.
$boole=$digested->isMath;Returnswhether$digestedwascreatedinmathmode.
@boxes=$digested->unlist;Returnsalistoftheboxescontainedin$digested.
ItisalsodenedfortheBoxesandWhatsit(whichjustreturnthemselves)sotheycanstand-inforaList.
$string=$digested->toString;Returnsastringrepresentingthis$digested.
$string=$digested->revert;RevertstheboxtothelistofTokensthatcreated(orcouldhavecreated)it.
$string=$digested->getLocator;Getanobjectdescribingthelocationintheoriginalsourcethatgaveriseto$digested.
$digested->beAbsorbed($document);$digestedshouldgetitselfabsorbedintothe$documentinwhateverwayisapppropriate.
$string=$box->getString;Returnsthestringpartofthe$box.
LaTeXML::Core::ListRepresentslistsofdigestedobjects;extendsLaTeXML::Core::Box.
LaTeXML::Core::CommentRepresentationsofdigestedobjects.
DescriptionLaTeXML::Core::Commentisarepresentationofdigestedobjects.
ItextendsLaTeXML::Common::Object.
LaTeXML::Core::WhatsitRepresentationsofdigestedobjects.
142APPENDIXC.
MODULESDescriptionrepresentsadigestedobjectthatcangeneratearbitraryelementsintheXMLDocument.
ItextendsLaTeXML::Core::Box.
MethodsNotethatthefontisstoredinthedatapropertiesunder'font'.
$defn=$whatsit->getDefinition;ReturnstheLaTeXML::Core::Definitionresponsibleforcreating$whatsit.
$value=$whatsit->getProperty($key);Returnsthevalueassociatedwith$keyinthe$whatsit'spropertylist.
$whatsit->setProperty($key,$value);Setsthe$valueassociatedwiththe$keyinthe$whatsit'spropertylist.
$props=$whatsit->getProperties();ReturnsthehashofpropertiesstoredonthisWhatsit.
(Notethatthishashismodiable).
$props=$whatsit->setProperties(%keysvalues);Setsseveralproperties,likesetProperty.
$list=$whatsit->getArg($n);Returnsthe$n-thargument(startingfrom1)forthis$whatsit.
@args=$whatsit->getArgs;Returnsthelistofargumentsforthis$whatsit.
$whatsit->setArgs(@args);Setsthelistofargumentsforthis$whatsitto@args(eachargshouldbeaLaTeXML::Core::List).
$list=$whatsit->getBody;Returnthebodyforthis$whatsit.
Thisisonlydenedforenvironmentsortop-levelmathformula.
Thebodyisstoredinthepropertiesunder'body'.
$whatsit->setBody(@body);Setsthebodyofthe$whatsittotheboxesin@body.
Thelast$boxin@bodyisassumedtorepresentthe'trailer',thatistheresultoftheinvocationthatclosedtheenvironmentormath.
Itisstoredseparatelyinthepropertiesunder'trailer'.
$list=$whatsit->getTrailer;Returnthetrailerforthis$whatsit.
SeesetBody.
C.
2.
COREMODULES143LaTeXML::Core::AlignmentRepresentationofalignedstructuresDescriptionThismoduledenesalignedstructures.
Itneedsmoredocumentation.
ItextendsLaTeXML::Common::Object.
LaTeXML::Core::KeyValsKey-ValuePairsinLaTeXMLDescriptionProvidesaparserandrepresentationofkeyvalpairsLaTeXML::Core::KeyValsrepresentsparametershandledbyLaTeX'skeyvalpackage.
ItextendsLaTeXML::Common::Object.
AccessorsGetKeyVal($arg,$key)Accessthevalueassociatedwithagivenkey.
Thisisusefulwithinconstructorstoaccessthevalueassociatedwith$keyintheargument$arg.
Exampleusageinacopnstructor:GetKeyVals($arg)Accesstheentirehash.
Canbeusedinaconstructorlike:Canuseinconstructor:Constructors>CreatesanewKeyValsobjectwiththegivenparameters.
Allargumentsareoptionalandthesimpleswayofcallingthismethodismy$keyvals=LaTeXML::Core::KeyVals->new().
prexisthegivenprexallkey-valuepairsoperateinanddefaultsto'KV'.
Ifgiven,prexshouldbeastring.
keysetsshouldbealistofkeysetstondkeysinsideof.
Ifgiven,itshouldeitherbereferencetoalistofstringsoracomma-seperatedstring.
Thisargumentdefaultsto'anonymous'.
Furthermore,theKeyValsconstructoracceptsavarietyofoptionsthatcanbeusedtocustomizeitsbehaviour.
ThesearesetAll,setInternals,skip,skipMissing,hookMissing,open,close,punctandassign.
144APPENDIXC.
MODULESsetAllisaagthat,ifset,ensuresthatkeyswillbesetinallexistingkeysets,instadofonlyintherstone.
setInternalsisaagthat,ifset,ensuresthatcertain'xkeyval'packageinternalsaresetduringkeydigestion.
skipshouldbealistofkeystobeskippedwhendigestingthekeysofthisobject.
skipMissingallowsonewayofhandlingkeysduringkeydigestionthathavenotbeenexplictiltydeclaredusingDefKeyorrelatedfunctionality.
Ifsettoundefor0,anerroristhrownupontryingtosetsuchakey,ifsetto1theyareignored.
Alternatively,thiscanbesettoakeymacrowhichisthenextendedtocontainacomman-separatedlistoftheundenedkeys.
hookMissingallowstocallaspecicmacroifasinglekeyisunknownduringkeydigestion.
Theoptionsopen,close,punctandassignoptionallycontainthetokensusedfortherespectivemeanings.
KeyValsAccessors(intendedforinternalusage)my$prefix=$keyvals->getPrefix()ReturnsthePrexproperty.
my@keysets=$keyvals->getKeySets()ReturnstheKeySetsproperty.
my$setall=$keyvals->getSetAll()ReturnstheSetAllproperty.
my$setinternals=$keyvals->getSetInternals()ReturnstheSetInternalsproperty.
my@skip=$keyvals->getSkip()ReturnstheSkipproperty.
my$skipmissing=$keyvals->getSkipMissing()ReturnstheSkipMissingproperty.
my$hookmissing=$keyvals->getHookMissing()ReturnstheHookMissingproperty.
my@tuples=$keyvals->getTuples()ReturnstheTuplespropertyrepresenting$keyvals->setTuples(@tuples)Setsthetupleswhichshouldbealistofve-tuples(arrayreferences)represent-ingthekey-valuepairsthisKeyValsobjectisseededwith.
SeethegetTuplesfunctionondetailsofthestructureofthislist.
rebuildiscalledautomaticallytopopulatetheothercaches.
Typically,thetuplesissetbyreadFrom.
C.
2.
COREMODULES145my@cachedpairs=$keyvals->getCachedPairs()ReturnstheCachedPairsproperty.
my%cachedhash=$keyvals->getCachedHash()ReturnstheCachedHashproperty.
ResolutiontoKeySetsmy@keysets=$keyvals->resolveKeyValFor($key)FindsallKeyValobjectsthatshouldbeusedforinteractingwiththegivenkey.
Mayreturnundefifnomatchingkeysetsarefound.
Usetheparameterskeysets,setAllandskipMissingtocustomizetheexactbehaviourofthisfunction.
my$canResolveKeyVal=$keyvals->canResolveKeyValFor($key)ChecksifthisKeyValsobjectcanresolveaKeyValforkey.
IgnoressetAllandskipMissingparameters.
my$keyval=$keyvals->getPrimaryKeyValOf($key,@keysets)GetsasingleKeyValparametertobeusedforinteractingaasinglekey,giventhatitresolvestokeysets.
AlwaysreturnsasingleKeyValobject,evenifnokeysetsarefound.
Changingcontainedvalues$keyvals->addValue($key,$value,$useDefault,$noRebuild)Addsthegivenvalueforkeyattheendofthegivenlistofvaluesandrebuildsallinternalcaches.
IftheuseDefaultagisset,thespecicvalueisignored,andthedefaultissetinstead.
IfthisfunctioniscalledmultipletimesthenoRebuildoptionshouldbegiventopreventconstantrebuildingandtherebuildfunctionshouldbecalledmanuallycalled.
$keyvals->setValue($key,$value,$useDefault)Setsthevalueofkeytovalue,optionallyusingthedefaultifuseDefaultisset.
Notethatifvalueisareferencetoanarray,thekeyisinsertedmultipletimes.
Ifvalueisundef,thevaluesisdeleted.
$keyvals->rebuild($skip)Rebuildstheinternalcachesofkey-valuemappingandlistofpairsfromfrommainlistoftuples.
Ifskipisgiven,allvaluesforthegivenkeyareomitted,andthegivenkeyisdeleted.
146APPENDIXC.
MODULESParsingvaluesfromagullet$keyvals->readFrom($gullet,$until,%options)ReadsasetofKeyValsfromgullet,upuntiltheuntiltoken,andupdatesthestateofthisKeyValsobjectaccordingly.
Furthermore,thismethodssupportsseveraloptions.
WhenthesilenceMissingoptionisset,missingkeyswillbecompletelyignoredwhenreadingkeys,thatistheydonotgetrecordedintotheKeyValsobjectandnowarningsorerrorswillbethrown.
$keyvals->readKeyWordFrom($gullet,$until)Readsasinglekeywordfromgullet.
Intendedforinternaluseonly.
KeyValsAccessorsmy$value=$keyvals->getValue($key);Returnavalueassociatedwith$key.
@values=$keyvals->getValues($key);Returnthelistofallvaluesassociatedwith$key.
%keyvals=$keyvals->getKeyVals;Returnthehashreferencecontainingthekeysandvaluesboundinthe$keyval.
Eachvalueinthehashmaybeasinglevalueoralistifthekeyisrepeated.
@keyvals=$keyvals->getPairs;Returnthealternatingkeysandvaluesboundinthe$keyval.
Notethatthismaycontainmultipleentriesforagivenkey,iftheywererepeated.
%hash=$keyvals->getHash;Returnthehashreferencecontainingthekeysandvaluesboundinthe$keyval.
Notethatwillonlycontainthelastvalueforagivenkey,iftheywererepeated.
$haskey=$keyvals->hasKey($key);ChecksiftheKeyValsobjectcontainsavaluefor$key.
ValueRelatedReversion$expansion=$keyvals->setKeysExpansion;ExpandthisKeyValsintoasetoftokensfordigestingkeys.
$keyvals=$keyvals->beDigested($stomach);ReturnanewLaTeXML::Core::KeyValsobjectwithbothkeysandvaluesdigested.
C.
2.
COREMODULES147$reversion=$keyvals->revert();RevertthisobjectintoasetoftokensrepresentingtheoriginalsequenceofTo-kensthatwasusedtobereaditfromthegullet.
$str=$keyvals->toString();Turnsthisobjectintoakey=valuecommaseperatedstring.
LaTeXML::Core::MuDimensionRepresentationofmathdimensions;extendsLaTeXML::Common::Dimension.
Exportedfunctions$mudimension=MuDimension($dim);CreatesaMuDimensionobject;similartoDimension.
LaTeXML::Core::MuGlueRepresentationofmathglue;extendsLaTeXML::Common::Glue.
Exportedfunctions$glue=MuGlue($gluespec);$glue=MuGlue($sp,$plus,$pfill,$minus,$mfill);CreatesaMuGlueobject,similartoGlue.
LaTeXML::Core::PairRepresentationofpairsofnumericalthingsDescriptionrepresentspairsofnumericalthings,coordinatesorsuch.
Candidateforremoval!
Exportedfunctions$pair=Pair($num1,$num2);Createsanobjectrepresentingapairofnumbers;NotapartofTeX,butusefulforgraphicalobjects.
Thetwocomponentscanbeanynumericalobject.
LaTeXML::Core::PairListRepresentationoflistsofpairsofnumericalthings148APPENDIXC.
MODULESDescriptionrepresentslistsofpairsofnumericalthings,coordinatesorsuch.
Candidateforre-moval!
Exportedfunctions$pair=PairList(@pairs);Createsanobjectrepresentingalistofpairsofnumbers;NotapartofTeX,butusefulforgraphicalobjects.
LaTeXML::Core::DefinitionControlsequencedenitions.
DescriptionThisabstractclassrepresentsthevariousexecutablescorrespondingtocontrolse-quences.
SeeLaTeXML::Packageforthemostconvenientmeanstocreatethem.
ItextendsLaTeXML::Common::Object.
Methods$token=$defn->getCS;Returnsthe(main)tokenthatisboundtothisdenition.
$string=$defn->getCSName;Returnsthestringformofthetokenboundtothisdenition,takingintoaccountanyaliasforthisdenition.
$defn->readArguments($gullet);Readstheargumentsforthis$defnfromthe$gullet,returningalistofLaTeXML::Core::Tokens.
$parameters=$defn->getParameters;ReturntheLaTeXML::Core::Parametersobjectrepresentingtheformalparametersofthedenition.
@tokens=$defn->invocation(@args);Returnthetokensthatwouldinvokethegivendenitionwiththeprovidedargu-ments.
ThisisusedtorecreatetheTeXcode(orit'sequivalent).
$defn->invoke;Invoketheactionofthe$defn.
Forexpandabledenitions,thisisdoneintheGullet,andreturnsalistofLaTeXML::Core::Tokens.
Forprimitives,itiscarriedoutintheStomach,andreturnsalistofLaTeXML::Core::Boxes.
C.
2.
COREMODULES149Foraconstructor,itisalsocarriedoutbytheStomach,andreturnsaLaTeXML::Core::Whatsit.
Thatwhatsitwillberesponsibleforconstruct-ingtheXMLdocumentfragment,whentheLaTeXML::Core::Documentinvokes$whatsit-beAbsorbed($document);>.
PrimitivesandConstructorsalsosupportbeforeandafterdaemons,listsofsub-routinesthatareexecutedbeforeandafterdigestion.
Thesecanbeusefulforchangingmodes,etc.
SeealsoLaTeXML::Core::Definition::Expandable,LaTeXML::Core::Definition::Conditional,LaTeXML::Core::Definition::Primitive,LaTeXML::Core::Definition::Register,LaTeXML::Core::Definition::CharDefandLaTeXML::Core::Definition::Constructor.
LaTeXML::Core::Definition::CharDefControlsequencedenitionsforchardefs.
DescriptionRepresentationasafurtherspecializedRegisterforchardef.
SeeLaTeXML::Packageforthemostconvenientmeanstocreatethem.
ItextendsLaTeXML::Core::Definition::Register.
LaTeXML::Core::Definition::ConditionalConditionalsControlsequencedenitions.
DescriptionTheserepresentthecontrolsequencesforconditionals,aswellas\else,\orand\fi.
SeeLaTeXML::Packageforthemostconvenientmeanstocreatethem.
ItextendsLaTeXML::Core::Definition::Expandable.
LaTeXML::Core::Definition::ConstructorControlsequencedenitions.
DescriptionThisclassrepresentscontrolsequencesthatcontributearbitraryXMLfragmentstothedocumenttree.
Duringdigestion,aLaTeXML::Core::Definition::ConstuctorrecordstheargumentsusedintheinvocationtoproduceaLaTeXML::Core::Whatsit.
TheresultingLaTeXML::Core::Whatsit(usually)generatesanXMLdocu-mentfragmentwhenabsorbedbyaninstanceofLaTeXML::Core::Document.
Additionally,aLaTeXML::Core::Definition::Constructormayhavebe-foreDigestandafterDigestdaemonsdenedwhichareexecutedforsideeffect,orforaddingadditionalboxestotheoutput.
150APPENDIXC.
MODULESItextendsLaTeXML::Core::Definition.
Moredocumentationneeded,butseeLaTeXML::Packageforthemainuseraccesstothese.
MoreaboutConstructorsAconstructorhasasit'sreplacementasubroutineorastringpatternrepresentingtheXMLfragmentitshouldgenerate.
Inthecaseofastringpattern,thepatterniscompiledintoasubroutineonrstusagebytheinter-nalclassLaTeXML::Core::Definition::ConstructorCompiler.
Likeprimitives,constructorsmayhavebeforeDigestandafterDigest.
LaTeXML::Core::Definition::ExpandableExpandableControlsequencedenitions.
DescriptionTheserepresentmacrosandotherexpandablecontrolsequencesthatarecarriedoutintheGulletduringexpansion.
TheresultsofinvokinganLaTeXML::Core::Definition::ExpandableshouldbealistofLaTeXML::Core::Tokens.
SeeLaTeXML::PackageforthemostconvenientmeanstocreateExpandables.
ItextendsLaTeXML::Core::Definition.
LaTeXML::Core::Definition::PrimitivePrimitiveControlsequencedenitions.
DescriptionTheserepresentprimitivecontrolsequencesthatareconverteddirectlytoBoxesorListscontainingbasicUnicodecontent,ratherthanstructuredXML,orthoseexecutedforsideeffectduringdigestionintheLaTeXML::Core::Stomach,changingtheLaTeXML::Core::State.
TheresultsofinvokingaLaTeXML::Core::Definition::Primitive,ifany,shouldbealistofdigesteditems(LaTeXML::Core::Box,LaTeXML::Core::ListorLaTeXML::Core::Whatsit).
ItextendsLaTeXML::Core::Definition.
Primitivedenitionsmayhavelistsofdaemonsubroutines,beforeDigestandafterDigest,thatareexecutedbefore(andbeforetheargumentsareread)andafterdigestion.
Theseshouldeitherendwithreturn;,(),orreturnalistofdigestedobjects(LaTeXML::Core::Box,etc)thatwillbecontributedtothecurrentlist.
LaTeXML::Core::Definition::RegisterControlsequencedenitionsforRegisters.
C.
2.
COREMODULES151DescriptionThesearesetupasaspeciallizedprimitivewithagetterandsettertoaccessandstorevaluesintheStomach.
SeeLaTeXML::Packageforthemostconvenientmeanstocreatethem.
ItextendsLaTeXML::Core::Definition::Primitive.
RegistersgenerallystoresomevalueinthecurrentLaTeXML::Core::State,butarenotrequiredto.
LikeTeX'sregisters,whentheyaredigested,theyexpectanoptional=,andthenavalueoftheappropriatetype.
Registerdenitionssupporttheseadditionalmethods:Methods$value=$register->valueOf(@args);Returnthevalueassociatedwiththeregister,byinvokingit'sgetterfunction.
Theadditionalargsareusedbysomeregisterstoindexintoaset,suchastheindexto\count.
$register->setValue($value,@args);Assignavaluetotheregister,byinvokingit'ssetterfunction.
LaTeXML::Core::ParameterAformalparameterDescriptionProvidesarepresentationforasingleformalparameterofLaTeXML::Core::Definitions:ItextendsLaTeXML::Common::Object.
SeealsoLaTeXML::Core::Parameters.
LaTeXML::Core::ParametersFormalparameters.
DescriptionProvidesarepresentationfortheformalparametersofLaTeXML::Core::Definitions:ItextendsLaTeXML::Common::Object.
152APPENDIXC.
MODULESMethods@parameters=$parameters->getParameters;ReturnthelistofLaTeXML::Core::Parametercontainedin$parameters.
@tokens=$parameters->revertArguments(@args);ReturnalistofLaTeXML::Core::Tokenthatwouldrepresenttheargu-mentssuchthattheycanbeparsedbytheGullet.
@args=$parameters->readArguments($gullet,$fordefn);Readtheargumentsaccordingtothis$parametersfromthe$gullet.
Thistakesintoaccountanyspecialformsofarguments,suchasoptional,delimited,etc.
@args=$parameters->readArgumentsAndDigest($stomach,$fordefn);Readsanddigeststheargumentsaccordingtothis$parameters,insequence.
thismethodisusedbyConstructors.
SeealsoLaTeXML::Core::Parameter.
C.
3UtilityModulesDocumentationLaTeXML::Util::PathnamePortablepathnameandle-systemutilitiesDescriptionThismodulecombinesthefunctionalityFile::SpecandFile::Basenametogiveacon-sistentsetoflenameutilitiesforLaTeXML.
Apathnameisrepresentedbyasimplestring.
PathnameManipulations$path=pathnamemake(%peices);Constructsapathnamefromthekeywordsinpiecesdir:directoryname:thelename(possiblywithextension)type:thelenameextension($dir,$name,$type)=pathnamesplit($path);Splitsthepathname$pathintothecomponents:directory,nameandtype.
$path=pathnamecanonical($path);Canonicallizesthepathname$pathbysimplifyingrepeatedslashes,dotsrep-resentingthecurrentorparentdirectory,etc.
C.
3.
UTILITYMODULES153$dir=pathnamedirectory($path);Returnsthedirectorycomponentofthepathname$path.
$name=pathnamename($path);Returnsthenamecomponentofthepathname$path.
$type=pathnametype($path);Returnsthetypecomponentofthepathname$path.
$path=pathnameconcat($dir,$file);Returnsthepathnameresultingfromconcatenatingthedirectory$dirandle-name$file.
$boole=pathnameisabsolute($path);Returnswhetherthepathname$pathappearstobeanabsolutepathname.
$boole=pathnameisurl($path);Returnswhetherthepathname$pathappearstobeaurl,ratherthanlocalle.
$boole=pathnameisliteraldata($path);Returnswhetherthepathname$pathisactuallyablobofliteraldata,withaleading"literal:"protocol.
$boole=pathnameisraw($path);CheckifpathnameindicatesarawTeXsourceordenitionle.
$boole=pathnameisreloadable($path);CheckforpathnameexceptionswherethesameTeXdenitionlecanbemean-ingfullyreloaded.
Forexample,babel.
sty".
ldf"les$rel=pathnameiscontained($path,$base);Checkswhether$pathisunderneaththedirectory$base;ifsoitreturnsthepathname$pathrelativeto$base;otherwisereturnsundef.
$path=pathnamerelative($path,$base);If$pathisanabsolute,non-URLpathname,returnsthepathnamerelativetothedirectory$base,otherwisesimplyreturnsthecanonicalformof$path.
$path=pathnameabsolute($path,$base);Returnstheabsolutepathnameresultingfrominterpretting$pathrelativetothedirectory$base.
If$pathisalreadyabsolute,itisreturnedunchanged.
$relativeurl=pathnametourl($path);Createsalocal,relativeURLforagivenpathname,alsoensuringproperpathseparatorsonnon-Unixsystems.
154APPENDIXC.
MODULESFileSystemOperations$modtime=pathnametimestamp($path);Returnsthemodicationtimeofthelenamedby$path,orundefiftheledoesnotexist.
$path=pathnamecwd();Returnsthecurrentworkingdirectory.
$dir=pathnamemkdir($dir);Createsthedirectory$dirandallmissingancestors.
Itreturns$dirifsuc-cessful,elseundef.
$dest=pathnamecopy($source,$dest);Copiesthele$sourceto$destifneeded;ie.
if$destismissingorolderthan$source.
Itpreservesthetimestampof$source.
$path=pathnamefind($name,%options);Findstherstlenamed$namethatexistsandthatmatchesthespecicationinthekeywords%options.
Anabsolutepathnameisreturned.
If$nameisnotalreadyanabsolutepathname,thentheoptionpathsdeter-minesdirectoriestorecursivelysearch.
Itshouldbealistofpathnames,anyrelativepathsareinterpretedrelativetothecurrentdirectory.
Ifpathsisomit-ted,thenthecurrentdirectoryissearched.
Iftheoptioninstallationsubdirisgiven,itindicates,inadditiontotheabove,adirectoryrelativetotheLaTeXMLinstallationdirectorytosearch.
Thisallowslesincludedwiththedistributiontobefound.
Thetypesoptionspeciesalistofletypestosearchfor.
Ifnotsupplied,thenthelenamemustmatchexactly.
Thetype*matchesanyextension.
@paths=pathnamefindall($name,%options);Likepathnamefind,butreturnsallmatching(absolute)pathsthatexist.
$path=pathnamekpsewhich(@names);Attempttondacandidatenameviatheexternalkpsewhichcapabilityofthesystem'sTeXtoolchain.
Ifkpsewhichisnotavailable,ortheleisnotfound,returnsaPerlundenedvalue.
LaTeXML::Util::WWWAuxiliariesforweb-scalabilityofLaTeXML'sIOSynopsismy$response=auth_get($url,$authlist);C.
3.
UTILITYMODULES155DescriptionUtilitiesforenablinggeneralinteractionwiththeWorldWideWebinLaTeXML'sIn-put/Output.
Stillindevelopment,morefunctionalityisexpectedatalaterstage.
Methodsmy$response=authget($url,$authlist);Givenanauthenticationlist,attemptsagetrequestonagivenURL($url)andreturnsthe$response.
Ifnoauthenticationispossibleautomatically,theroutinepromptstheuserforcredentials.
LaTeXML::Util::PackSmartpackingandunpackingofTeXarchivesDescriptionThismoduleprovidesanAPIandconveniencemethodsfor:1.
UnpackingZiparchiveswhichcontainaTeXmanuscript.
2.
PackingthelesofaLaTeXMLmanuscriptintoasinglearchive3.
Extractingembeddablefragments,aswellassingleformulasfromLaTeXMLdocumentsAlluser-levelmethodsareunconditionallyexportedbydefault.
Methods$maintexsource=unpacksource($archive,$extractiondirectory);Unpacksagiven$archiveintothe$extractiondirectory.
Next,performaheuris-ticanalysistodetermine,andreturn,themainleoftheTeXmanuscript.
Ifthemainlecannotbedetermined,the$extractiondirectoryisremovedandundefisreturned.
Inthisregard,weimplementasimpliedformofthelogicinTeX::AutoTeXandparticularlyarXiv::FileGuess@packeddocuments=packcollection(collection=>\@documents,whatsout=>'math|fragment|Packsacollectionofdocumentsusingthepackingmethodspeciedviathe'whatsout'option.
If'fragment'or'math'arechosen,eachinputdocumentistransformedintoanembeddablefragmentorasingleformula,respectively.
If'archive'ischose,allinputdocumentsarewrittenintoanarchiveinthespec-ied'siteDirectory'.
Thenameofthearchiveisprovidedbythe'destination'propertyoftherstprovided$documentobject.
EachdocumentisexpectedtobeaLaTeXML::Post::Documentobject.
156APPENDIXC.
MODULESC.
4PreprocessingModulesDocumentationLaTeXML::Pre::BibTeXImplementsaBibTeXparserforLaTeXML.
DescriptionLaTeXML::Pre::BibTeXservesasalow-levelparserofBibTeXdatabaseles.
ItparsesandstoresaLaTeXML::Pre::BibTeX::Entryforeachentryintothecur-rentSTATE.
BibTeXstringmacrosaresubstitutedintotheeldvalues,butnootherprocessingofthedataisdone.
SeeLaTeXML::Package::BibTeX.
pool.
ltxmlforhowfurtherprocessingiscarriedout,andcanbecustomized.
CreatingaBibTeXmy$bib=LaTeXML::Pre::BibTeX->newFromFile($bibname);CreatesaLaTeXML::Pre::BibTeXobjectrepresentingabibliographyfromaBibTeXdatabasele.
my$bib=LaTeXML::Pre::BibTeX->newFromString($string);CreatesaLaTeXML::Pre::BibTeXobjectrepresentingabibliographyfromastringcontainingtheBibTeXdata.
Methods$string=$bib->toTeX;ReturnsastringcontainingtheTeXcodetobedigestedbyaLaTeXMLobjecttoprocessthebibliography.
Thestringcontainsall@PREAMBLEdataandinvocationsof\\ProcessBibTeXEntry{$key}foreachbiblio-graphicentry.
The$keycanbeusedtolookupthedatafrom$STATEasLookupValue('BIBITEM@'.
$key).
SeeBibTeX.
poolforhowtheprocessingiscarriedout.
BibEntryobjectsTherepresentationofaBibTeXentry.
$type=$bibentry->getType;Returnsastringnamingtheentrytypeoftheentry(Noaliasingisdonehere).
$key=$bibentry->getKey;Returnsthebibliographickeyfortheentry.
@fields=$bibentry->getFields;Returnsalistofpairs[$name,$value]representingallelds,intheorderdened,fortheentry.
Boththe$nameand$valuearestrings.
Fieldnamesmayberepeated,iftheyareinthebibliography.
C.
5.
POSTPROCESSINGMODULES157$value=$bibentry->getField($name);Returnsthevalue(orundef)associatedwiththethegiveneldname.
Iftheeldwasrepeatedinthebibliography,onlythelastoneisreturned.
C.
5PostprocessingModulesDocumentationLaTeXML::PostPostprocessingdriver.
DescriptionLaTeXML::Postisthedriverforvariouspostprocessingoperations.
Ithasacom-plicatedsetofoptionsthatI'lldocumentshortly.
LaTeXML::Post::MathMLPost-ProcessingmodulesforconvertingmathtoMathML.
SynopsisLaTeXML::Post::MathMListheabstractbaseclassfortheMathMLPostproces-sor;LaTeXML::Post::MathML::PresentationandLaTeXML::Post::MathML::ContentconvertXMathtoeitherPresentationorContentMathML,orwiththatformatastheprinciplebranchforParallelmarkup.
DescriptionTheconversioniscarriedoutprimarlybyatreewalkoftheXMathexpression;appro-priatehandlersareselectedandcalleddependingontheoperatorsandformsencoun-tered.
Handlerscanbedenedonapplicationsofoperators,orontokens;whenatokenisapplied,it'sapplicationhandlertakesprecedenceoverit'stokenhandlerDefMathML($key,$presentation,$content);Denespresentationandcontenthandlersfor$key.
$keyisoftheformTYPE:ROLE:MEANING,whereTYPE:isoneeitherCorC(orC)ROLE:isagrammaticalrole(onXMathtokens)MEANING:isthemeaningattribute(onXMathtokens)Anyofthesecanbetomatchanyroleormeaning;matchesofbotharepreferred,thenmatchofmeaningorrole,orneither.
Thesubroutinehandlersforpresentationandcontentaregivenby$presentationand$content,respectively.
Eithercanbeundef,inwhichcasesomeothermatch-inghandlerwillbeinvoked.
158APPENDIXC.
MODULESForTokenhandlers,theargumentspassedarethetokennode;forApplyhandler,theargumentspassedaretheoperatornodeandanyarguments.
However,itlookslikesomeTOKENhandlersarebeingdenedtotake$content,%attributesbeingthestringcontentofthetoken,andthetoken'sattributes!
PresentationConversionUtilties$mmlpost->pmmltop($node,$style);Thisisthetop-levelconverterappliedtoanXMathnode.
Itestablishesalocalcontextforfont,style,size,etc.
ItgenerallydoesthebulkoftheworkforaPresentationMathML'stranslateNode,althoughthelatterwrapstheactualm:mathelementaroundit.
(styleisdisplayortext).
pmml($node),pmmlsmaller($node),pmmlscriptsizsize($node)ConvertstheXMath$nodetoPresentationMathML.
Thelattertwoareusedwhenthecontextcallsforsmaller(eg.
fractionparts)orscriptsize(egsuborsuperscript)sizeorstyle,sothatthesizeencodedwithin$nodewillbeproperlyaccountedfor.
pmmlmi($node,%attributes),pmmlmn($node,%attributes),pmmlmo($node,%attributTheseareTokenhandlers,tocreatem:mi,m:mnandm:moelements,respec-tively.
Whencalledasahandler,theywillbesuppliedonlywithanXMathnode(typicallyanXMTok).
Forconvenientreuse,thesefunctionsmayalsobecalledona'virtual'token:with$nodebeingastring(thatwouldhavebeenthetextcontentoftheXMTok),andthe%attributesthatwouldhavebeenthetoken'sattributes.
pmmlinfix($op,@args),pmmlscript($op,@args),pmmlbigop($op,@args)TheseareApplyhandlers,forhandlinggeneralinx,suborsuperscript,orbigop(eg.
summations)constructs.
Theyarecalledwiththeoperatortoken,followedbythearguments;allareXMathelements.
pmmlrow(@items)Thiswrapsanm:mrowaroundthealreadyconverted@itemsifneeed;Thatis,ifthereisonlyasingleitemitisreturnedwithoutthem:mrow.
pmmlunrow($pmml)ThisperverseutilitytakessomethingthathasalreadybeenconvertedtoPresen-tationMathML.
Iftheargumentisanm:mrow,itreturnsalistofthemathmlelementswithinthatrow,otherwiseitreturnsalistcontainingthesingleelement$pmml.
pmmlparenthesize($item,$open,$close)Thisutilityparenthesizesthe(alreadyconvertedMathML)$itemwiththestringdelimiters$openand$close.
Theseareconvertedtoanm:mrowwithm:moforthefences,unlesstheusemfencedswitchisset,inwhichcasem:mfencedisused.
C.
5.
POSTPROCESSINGMODULES159pmmlpunctuate($separators,@items)Thisutilitycreatesanm:mrowbyinterjectingthepunctuationbetweensuceessiveitemsinthelistofalreadyconverted@items.
Iftherearemorethanonecharacterin$separatorstherstisusedbetweentherstpair,thenextbetweenthenextpair;iftheseparatorsisexhausted,thelastisrepeatedbetweenremainingpairs.
$separatorsdefaultsto(repeated)comma.
ContentConversionUtilties$mmlpost-cmmltop($node);>Thisisthetop-levelconverterappliedtoanXMathnode.
Itestablishesalocalcontextforfont,style,size,etc(wereitneeded).
ItgenerallydoesthebulkoftheworkforaContentMathML'stranslateNode,althoughthelatterwrapstheactualm:mathelementaroundit.
cmml($node)ConvertstheXMath$nodetoContentMathML.
cmmlleaf($token)ConvertstheXMathtokentoanm:ci,m:cnorm:csymbol,underappropri-atecircumstances.
cmmldecoratedSymbol($item)Similartocmmlleaf,butusedwhenanoperatorisitself,apparently,anappli-cation.
Thisconverts$itemtoPresentationMathMLtouseforthecontentofthem:ci.
cmmlnot($arg)Constructthenotoftheargument$arg.
cmmlsynthnot($op,@args)Synthesizeanoperatorbyapplyingm:nottoanotheroperator($op)appliedtoits@args(XMathelementsthatwillbeconvertedtoContentMathML).
Thisisusefultodeneahandlerfor,eg.
,cintermsofc.
cmmlsynthcomplement($op,@args)Synthesizeanoperatorbyapplyingacomplementaryoperator($op)tothereverseofits@args(XMathelementsthatwillbeconvertedtoContentMathML).
Thisisusefultodeneahandlerfor,eg.
superset-of-or-equalsusingm:subset.
cmmlorcompose($operators,@args)Synthesizeanoperatorthatstandsfortheorofseveralotheroperators(eg.
c)bycomposingitofthe160APPENDIXC.
MODULESm:orofapplyingeachofm:lessandm:approxtothearguments.
Therstoperatorisappliedtotheconvertedarguments,whiletherestareappliedtom:shareelementsreferringtothepreviousones.
cmmlshare($node)ConvertstheXMath$nodetoContentMathML,afterassuringthatithasanid,sothatitcanbeshared.
cmmlshared($node)Generatesam:shareelementrefertingto$node,whichshouldhaveanid(suchasaftercallingcmmlshare).
MathProcessors,Generally.
WeshouldprobablyformalizetheideaofaMathProcessorasanabstractclass,butletthisdescriptionprovideastartingoverview.
AMathProcessorfollowstheAPIofLaTeXML::Postprocessors,byhandlingprocess,whichin-vokesprocessNodeonallMathnodes;ThatlatterinsertstheresultofeithertranslateNodeortranslateParallel,appliedtotheXMathrepresentation,intotheMathnode.
ParalleltranslationisdonewheneveradditionalMathProcessorshavebeenspeci-ed,viathesetParallelmethod;thesearesimplyotherMathProcessorsfollowingthesameAPI.
AppendixDLATEXMLSchemaThedocumenttypeusedbyLATEXMLismodularinthesensethatitiscomposedofseveralmodulesthatdenedifferentsetsofelementsrelatedto,eg.
,inlinecontent,blockcontent,mathandhigh-leveldocumentstructure.
Thisallowsthepossibilityofmixingmodelsorextensionbypredeningcertainparameterentities.
D.
1ModuleLaTeXMLModuleLaTeXML-commonincluded.
ModuleLaTeXML-inlineincluded.
ModuleLaTeXML-blockincluded.
ModuleLaTeXML-miscincluded.
ModuleLaTeXML-metaincluded.
ModuleLaTeXML-paraincluded.
ModuleLaTeXML-mathincluded.
ModuleLaTeXML-tabularincluded.
ModuleLaTeXML-pictureincluded.
ModuleLaTeXML-structureincluded.
ModuleLaTeXML-bibincluded.
PatternInline.
modelCombinedmodelforinlinecontent.
Content:(text|Inline.
class|Misc.
class|Meta.
class)*Expansion:((text|Inline.
class|Misc.
class|Meta.
class)*)161162APPENDIXD.
SCHEMAUsedby:acknowledgementsmodel,anchormodel,bib-datamodel,bib-datemodel,bib-editionmodel,bib-extractmodel,bib-identiermodel,bib-keymodel,bib-languagemodel,bib-linksmodel,bib-notemodel,bib-organizationmodel,bib-partmodel,bib-placemodel,bib-publishermodel,bib-reviewmodel,bib-statusmodel,bib-subtitlemodel,bib-titlemodel,bib-typemodel,bib-urlmodel,bibrefphrasemodel,citemodel,classicationmodel,constraintmodel,contactmodel,datemodel,delmodel,emphmodel,givennamemodel,glossaryphrasemodel,glossaryrefmodel,indexphrasemodel,indexrefsmodel,indexseemodel,keywordsmodel,lineagemodel,pmodel,personnamemodel,refmodel,submodel,subtitlemodel,supmodel,surnamemodel,tagmodel,textmodel,verbatimmodel,acknowledgementsmodel,anchormodel,bib-datamodel,bib-datemodel,bib-editionmodel,bib-extractmodel,bib-identiermodel,bib-keymodel,bib-languagemodel,bib-linksmodel,bib-notemodel,bib-organizationmodel,bib-partmodel,bib-placemodel,bib-publishermodel,bib-reviewmodel,bib-statusmodel,bib-subtitlemodel,bib-titlemodel,bib-typemodel,bib-urlmodel,bibrefphrasemodel,citemodel,classicationmodel,constraintmodel,contactmodel,datemodel,delmodel,emphmodel,givennamemodel,glossaryphrasemodel,glossaryrefmodel,indexphrasemodel,indexrefsmodel,indexseemodel,keywordsmodel,lineagemodel,pmodel,personnamemodel,refmodel,submodel,subtitlemodel,supmodel,surnamemodel,tagmodel,textmodel,verbatimmodelPatternBlock.
modelCombinedmodelforphysicalblock-levelcontent.
Content:(Block.
class|Misc.
class|Meta.
class)*Expansion:((Block.
class|Misc.
class|Meta.
class)*)Usedby:abstractmodel,blockmodel,guremodel,oatmodel,inline-blockmodel,paramodel,quotemodel,tablemodel,abstractmodel,blockmodel,guremodel,oatmodel,inline-blockmodel,paramodel,quotemodel,tablemodelPatternFlow.
modelCombinedmodelforgeneralowcontainingbothinlineandblocklevelcontent.
Content:(text|Inline.
class|Block.
class|Misc.
class|Meta.
class)*Expansion:((text|Inline.
class|Block.
class|Misc.
class|Meta.
class)*)Usedby:bibblockmodel,notemodel,rdfmodel,tdmodel,bibblockmodel,notemodel,rdfmodel,tdmodelPatternPara.
modelCombinedmodelforlogicalblock-levelcontext.
D.
2.
MODULELATEXML-COMMON163Content:(Para.
class|Meta.
class)*Expansion:((Para.
class|Meta.
class)*)Usedby:appendix.
body.
class,bibliography.
body.
class,chapter.
body.
class,document.
body.
class,glossary.
body.
class,index.
body.
class,inline-paramodel,itemmodel,paragraph.
body.
class,part.
body.
class,proofmodel,section.
body.
class,sidebar.
body.
class,slide.
body.
class,subparagraph.
body.
class,subsection.
body.
class,subsubsection.
body.
class,theoremmodel,appendix.
body.
class,bibliography.
body.
class,chapter.
body.
class,document.
body.
class,glossary.
body.
class,index.
body.
class,inline-paramodel,itemmodel,paragraph.
body.
class,part.
body.
class,proofmodel,section.
body.
class,sidebar.
body.
class,slide.
body.
class,subparagraph.
body.
class,subsection.
body.
class,subsubsection.
body.
class,theoremmodelStart==documentD.
2ModuleLaTeXML-commonPatternInline.
classAllstrictlyinlineelements.
Expansion:(combination|choice|combination|group|text|emph|del|sub|sup|glossaryref|rule|anchor|ref|cite|bibref|Math)Usedby:Flow.
model,Inline.
model,XMTextmodel,captionmodel,clippathmodel,gmodel,inline-itemmodel,listinglinemodel,picturemodel,titlemodel,toccaptionmodel,toctitlemodel,Flow.
model,Inline.
model,XMTextmodel,captionmodel,clippathmodel,gmodel,inline-itemmodel,listinglinemodel,picturemodel,titlemodel,toccaptionmodel,toctitlemodelPatternBlock.
classAll'physical'blockelements.
Aphysicalblockistypicallydisplayedasablock,butmaynotconstituteacompletelogicalunit.
Expansion:(combination|group|p|equation|equationgroup|quote|block|listing|itemize|enumerate|description|pagination)Usedby:Block.
model,Flow.
model,titlepagemodel,Block.
model,Flow.
model,titlepagemodelPatternMisc.
classAdditionalmiscellaneouselementsthatcanappearinbothinlineandblockcontexts.
Expansion:(combination|choice|combination|choice|combination|choice|combination|choice|combination|group164APPENDIXD.
SCHEMA|inline-itemize|inline-enumerate|inline-description|inline-block|verbatim|break|graphics|svg|rawhtml|rawliteral|inline-para|tabular|picture)Usedby:Block.
model,Flow.
model,Inline.
model,XMTextmodel,captionmodel,clippathmodel,creatormodel,equationmodel,gmodel,inline-itemmodel,listinglinemodel,picturemodel,titlemodel,toccaptionmodel,toctitlemodel,Block.
model,Flow.
model,Inline.
model,XMTextmodel,captionmodel,clippathmodel,creatormodel,equationmodel,gmodel,inline-itemmodel,listinglinemodel,picturemodel,titlemodel,toccaptionmodel,toctitlemodelPatternPara.
classAlllogicalblocklevelelements.
Alogicalblocktypicallycontainsoneormorephysicalblockelements.
Forexample,acommonsituationmightbep,equation,p,wheretheentiresequencecomprisesasinglesentence.
Expansion:(combination|choice|combination|group|para|theorem|proof|gure|table|oat|pagination|TOC)Usedby:BackMatter.
class,Para.
model,BackMatter.
class,Para.
modelPatternMeta.
classAllmetadataelements,typicallyrepresentinghiddendata.
Expansion:(combination|group|note|declare|indexmark|glossarydenition|rdf|ERROR|resource|navigation)Usedby:BackMatter.
class,Block.
model,Flow.
model,Inline.
model,Para.
model,captionmodel,clippathmodel,documentmodel,equationmodel,equationgroupmodel,gmodel,inline-itemmodel,listinglinemodel,picturemodel,titlemodel,toccaptionmodel,toctitlemodel,BackMatter.
class,Block.
model,Flow.
model,Inline.
model,Para.
model,captionmodel,clippathmodel,documentmodel,equationmodel,equationgroupmodel,gmodel,inline-itemmodel,listinglinemodel,picturemodel,titlemodel,toccaptionmodel,toctitlemodelPatternLength.
typeThetypeforattributesspecifyingalength.
Shouldbeanumberfollowedbyalength,typicallypx.
NOTE:Tobenarrowedlater.
Content:textExpansion:(text)Usedby:Fontable.
attributes,Positionable.
attributes,Transformable.
attributes,XMArrayattributes,equationgroupattributes,itemattributes,tabularattributes,tdattributes,Fontable.
attributes,Positionable.
attributes,Transformable.
attributes,XMArrayattributes,equationgroupattributes,itemattributes,tabularattributes,tdattributesD.
2.
MODULELATEXML-COMMON165PatternColor.
typeThetypeforattributesspecifyingacolor.
NOTE:Tobenarrowedlater.
Content:textExpansion:(text)PatternCommon.
attributesAttributessharedbyALLelements.
Attributes:RDF.
attributesAttributeclass=NMTOKENSaspaceseparatedlistoftokens,asinCSS.
Theclasscanbeusedtoadddifferentiatedifferentinstancesofelementswithoutintroducingnewelementdeclarations.
However,thisgenerallyshouldn'tbeusedfordeepsemanticdistinctions.
ThisattributeiscarriedovertoHTMLandcanbeusedforCSSselection.
[NotethatthedefaultXSLTstylesheetsforhtmlandxhtmladdthelatexmlelementnamestotheclassofhtmlelementsformoreconvenienceinusingCSS.
]Attributecssstyle=textCSSstylingrules.
ThesewillonlybeeffectivewhenthetargetsystemsupportsCSS.
Attributexml:lang=textLanguageattributeUsedby:ERRORattributes,MathBranchattributes,MathForkattributes,Mathattributes,Sectional.
attributes,TOCattributes,XMAppattributes,XMArgattributes,XMArrayattributes,XMCellattributes,XMDualattributes,XMHintattributes,XMRefattributes,XMRowattributes,XMTextattributes,XMTokattributes,XMWrapattributes,XMathattributes,abstractattributes,acknowledgementsattributes,anchorattributes,arcattributes,bezierattributes,bib-dataattributes,bib-dateattributes,bib-editionattributes,bib-extractattributes,bib-identierattributes,bib-keyattributes,bib-languageattributes,bib-linksattributes,bib-nameattributes,bib-noteattributes,bib-organizationattributes,bib-partattributes,bib-placeattributes,bib-publisherattributes,bib-relatedattributes,bib-reviewattributes,bib-statusattributes,bib-subtitleattributes,bib-titleattributes,bib-typeattributes,bib-urlattributes,bibentryattributes,bibitemattributes,biblistattributes,bibrefattributes,bibrefphraseattributes,blockattributes,breakattributes,captionattributes,circleattributes,citeattributes,classicationattributes,clipattributes,clippathattributes,contactattributes,creatorattributes,curveattributes,dateattributes,delattributes,descriptionattributes,dotsattributes,ellipseattributes,emphattributes,enumerateattributes,equationattributes,equationgroupattributes,gureattributes,166APPENDIXD.
SCHEMAoatattributes,gattributes,glossarydenitionattributes,glossaryentryattributes,glossarylistattributes,glossaryphraseattributes,glossaryrefattributes,graphicsattributes,gridattributes,indexentryattributes,indexlistattributes,indexmarkattributes,indexphraseattributes,indexrefsattributes,indexseeattributes,inline-blockattributes,inline-descriptionattributes,inline-enumerateattributes,inline-itemattributes,inline-itemizeattributes,inline-paraattributes,itemattributes,itemizeattributes,keywordsattributes,lineattributes,listingattributes,listinglineattributes,navigationattributes,noteattributes,pattributes,paginationattributes,paraattributes,parabolaattributes,pathattributes,personnameattributes,pictureattributes,polygonattributes,proofattributes,quoteattributes,rdfattributes,rectattributes,refattributes,resourceattributes,ruleattributes,subattributes,subtitleattributes,supattributes,tableattributes,tabularattributes,tagattributes,tbodyattributes,tdattributes,textattributes,tfootattributes,theadattributes,theoremattributes,titleattributes,toccaptionattributes,tocentryattributes,toclistattributes,toctitleattributes,trattributes,verbatimattributes,wedgeattributes,ERRORattributes,MathBranchattributes,MathForkattributes,Mathattributes,Sectional.
attributes,TOCattributes,XMAppattributes,XMArgattributes,XMArrayattributes,XMCellattributes,XMDualattributes,XMHintattributes,XMRefattributes,XMRowattributes,XMTextattributes,XMTokattributes,XMWrapattributes,XMathattributes,abstractattributes,acknowledgementsattributes,anchorattributes,arcattributes,bezierattributes,bib-dataattributes,bib-dateattributes,bib-editionattributes,bib-extractattributes,bib-identierattributes,bib-keyattributes,bib-languageattributes,bib-linksattributes,bib-nameattributes,bib-noteattributes,bib-organizationattributes,bib-partattributes,bib-placeattributes,bib-publisherattributes,bib-relatedattributes,bib-reviewattributes,bib-statusattributes,bib-subtitleattributes,bib-titleattributes,bib-typeattributes,bib-urlattributes,bibentryattributes,bibitemattributes,biblistattributes,bibrefattributes,bibrefphraseattributes,blockattributes,breakattributes,captionattributes,circleattributes,citeattributes,classicationattributes,clipattributes,clippathattributes,contactattributes,creatorattributes,curveattributes,dateattributes,delattributes,descriptionattributes,dotsattributes,ellipseattributes,emphattributes,enumerateattributes,equationattributes,equationgroupattributes,gureattributes,oatattributes,gattributes,glossarydenitionattributes,glossaryentryattributes,glossarylistattributes,glossaryphraseattributes,glossaryrefattributes,D.
2.
MODULELATEXML-COMMON167graphicsattributes,gridattributes,indexentryattributes,indexlistattributes,indexmarkattributes,indexphraseattributes,indexrefsattributes,indexseeattributes,inline-blockattributes,inline-descriptionattributes,inline-enumerateattributes,inline-itemattributes,inline-itemizeattributes,inline-paraattributes,itemattributes,itemizeattributes,keywordsattributes,lineattributes,listingattributes,listinglineattributes,navigationattributes,noteattributes,pattributes,paginationattributes,paraattributes,parabolaattributes,pathattributes,personnameattributes,pictureattributes,polygonattributes,proofattributes,quoteattributes,rdfattributes,rectattributes,refattributes,resourceattributes,ruleattributes,subattributes,subtitleattributes,supattributes,tableattributes,tabularattributes,tagattributes,tbodyattributes,tdattributes,textattributes,tfootattributes,theadattributes,theoremattributes,titleattributes,toccaptionattributes,tocentryattributes,toclistattributes,toctitleattributes,trattributes,verbatimattributes,wedgeattributesPatternID.
attributesAttributesforelementsthatcanbecross-referencedfrominsideoroutsidethedocument.
Attributexml:id=IDtheuniqueidentieroftheelement,usuallygeneratedautomaticallybythelatexml.
Attributefragid=texta"fragmentidentier"derivedfromthexml:idrelativetoapagesplitfromthecompletedocument.
Thisisusedinternallyandmaygoawaysomeday.
Usedby:ERRORattributes,Labelled.
attributes,Mathattributes,XMAppattributes,XMArgattributes,XMArrayattributes,XMCellattributes,XMDualattributes,XMHintattributes,XMRefattributes,XMRowattributes,XMTextattributes,XMTokattributes,XMWrapattributes,XMathattributes,anchorattributes,bibentryattributes,bibitemattributes,blockattributes,declareattributes,delattributes,descriptionattributes,emphattributes,enumerateattributes,glossaryentryattributes,glossarylistattributes,graphicsattributes,indexentryattributes,indexlistattributes,inline-blockattributes,inline-descriptionattributes,inline-enumerateattributes,inline-itemizeattributes,inline-paraattributes,itemizeattributes,pattributes,paraattributes,pictureattributes,quoteattributes,subattributes,supattributes,tabularattributes,tdattributes,textattributes,trattributes,verbatimattributes,ERRORattributes,Labelled.
attributes,Mathattributes,XMAppattributes,XMArgattributes,XMArrayattributes,XMCellattributes,168APPENDIXD.
SCHEMAXMDualattributes,XMHintattributes,XMRefattributes,XMRowattributes,XMTextattributes,XMTokattributes,XMWrapattributes,XMathattributes,anchorattributes,bibentryattributes,bibitemattributes,blockattributes,declareattributes,delattributes,descriptionattributes,emphattributes,enumerateattributes,glossaryentryattributes,glossarylistattributes,graphicsattributes,indexentryattributes,indexlistattributes,inline-blockattributes,inline-descriptionattributes,inline-enumerateattributes,inline-itemizeattributes,inline-paraattributes,itemizeattributes,pattributes,paraattributes,pictureattributes,quoteattributes,subattributes,supattributes,tabularattributes,tdattributes,textattributes,trattributes,verbatimattributesPatternIDREF.
attributesAttributesforelementsthatcancross-referenceotherelements.
Attributeidref=IDREFtheidentierofthereferred-toelement.
Usedby:Refable.
attributes,XMRefattributes,bibrefattributes,glossaryphraseattributes,Refable.
attributes,XMRefattributes,bibrefattributes,glossaryphraseattributesPatternListable.
attributesAttributesforitemsthatcanbeputintolists,likeindex,tableofcontents.
Attributeinlist=textRecordswhichlists,suchastoc=tableofcontents,.
.
.
,thisobjectcouldbelistedin.
Spaceseparatedsetoftoc,lof,lot,etc.
Usedby:Labelled.
attributes,bibrefattributes,citeattributes,glossarydenitionattributes,glossaryrefattributes,indexmarkattributes,Labelled.
attributes,bibrefattributes,citeattributes,glossarydenitionattributes,glossaryrefattributes,indexmarkattributesPatternListing.
attributesAttributesforitemsthatcreatelists,likeindex,tableofcontents.
Attributelists=textRecordswhichlists,suchastoc(=tableofcontents),thisobjectshouldcreatealistof.
Spaceseparatedsetoftoc,lof,lot,etc.
Usedby:bibliographyattributes,glossaryattributes,indexattributes,bibliographyattributes,glossaryattributes,indexattributesPatternLabelled.
attributesAttributesforelementsthatcanbelabelledfromwithinLaTeX.
Theseattributesdealwithassigningalabelandgeneratingcrossreferences.
Thelabelmigratestoanxml:idandhrefandtheelementcanserveasahypertexttarget.
D.
2.
MODULELATEXML-COMMON169Attributes:ID.
attributes,Listable.
attributesAttributelabels=textRecordsthevariouslabelsthatLaTeXusesforcrossreferencing.
(notethat\labelcanassociatemorethanonelabelwithanobject!
)Itconsistsofspaceseparatedlabelsfortheelement.
The\labelmacroprovidesthelabelprexedbyLABEL:;Spacesinalabelarereplacedbyunderscore.
Othermechanisms(likeacro)mightuseotherprexes(butID:isreserved!
)Usedby:Sectional.
attributes,equationattributes,equationgroupattributes,gureattributes,oatattributes,inline-itemattributes,itemattributes,listingattributes,listinglineattributes,noteattributes,proofattributes,tableattributes,theoremattributes,Sectional.
attributes,equationattributes,equationgroupattributes,gureattributes,oatattributes,inline-itemattributes,itemattributes,listingattributes,listinglineattributes,noteattributes,proofattributes,tableattributes,theoremattributesPatternRefable.
attributesAttributesforelementsthatcanbereferredtofromwithinLaTeX.
Suchelementsmayserveasthestartingpointofahypertextlink.
Thereferencecanbemadeusinglabel,xml:idorhref;theseattributeswillbeconverted,asneeded,fromtheformertothelatter.
Attributes:IDREF.
attributesAttributelabelref=textreferencetoaLaTeXlabelledobject;SeethelabelsattributeofLabelled.
attributes.
Attributehref=textreferencetoanarbitraryurl.
Usedby:bib-identierattributes,bib-reviewattributes,bib-urlattributes,contactattributes,glossaryrefattributes,personnameattributes,refattributes,bib-identierattributes,bib-reviewattributes,bib-urlattributes,contactattributes,glossaryrefattributes,personnameattributes,refattributesPatternFontable.
attributesAttributesforelementsthatcontain(indirectly)textwhosefontcanbespecied.
Attributefont=textIndicatesthefonttouse.
Itconsistsofaspaceseparatedsequenceofvaluesrepresentingthefamily(serif,sansserif,math,typewriter,caligraphic,fraktur,script,.
.
.
),series(medium,bold,.
.
.
),andshape(upright,italic,slanted,smallcaps,.
.
.
).
Onlythevaluesdifferingfromthecurrentcontextaregiven.
Eachcomponentisopen-ended,forextensibility;itisthusunclear170APPENDIXD.
SCHEMAwhetherunknownvaluesspecifyfamily,seriesorshape.
Inpostprocessing,thesevaluesarecarriedtotheclassattribute,andcanthusbeeffectedbyCSS.
Attributefontsize=Length.
typeIndicatesthetextsizetouse,asalength,asinCSS.
Normally,thisshouldbeapercentagevaluerelativetothecontainingelement.
Usedby:XMTokattributes,captionattributes,delattributes,emphattributes,glossaryrefattributes,refattributes,textattributes,titleattributes,verbatimattributes,XMTokattributes,captionattributes,delattributes,emphattributes,glossaryrefattributes,refattributes,textattributes,titleattributes,verbatimattributesPatternColorable.
attributesAttributesforelementsthatdrawsomething,textorotherwise,thatcanbecolored.
Attributecolor=textthecolortouse(forforegroundmaterial);anyCSScompatiblecolorspecication.
Inpostprocessing,thesevaluesarecarriedtotheclassattribute,andcanthusbeeffectedbyCSS.
Attributeopacity=oattheopacityofforegroundmaterial;anumberbetween0and1.
Usedby:XMAppattributes,XMTokattributes,captionattributes,delattributes,emphattributes,glossaryrefattributes,refattributes,ruleattributes,textattributes,titleattributes,verbatimattributes,XMAppattributes,XMTokattributes,captionattributes,delattributes,emphattributes,glossaryrefattributes,refattributes,ruleattributes,textattributes,titleattributes,verbatimattributesPatternBackgroundable.
attributesAttributesforelementsthattakeupspaceandmakesensetohaveabackgroundcolor.
Thisisindependentofthecolorsofanythingsthatitmaydraw.
Attributebackgroundcolor=textthecolortouseforthebackgroundoftheelement;anyCSScompatiblecolorspecication.
Inpostprocessing,thesevaluesarecarriedtotheclassattribute,andcanthusbeeffectedbyCSS;thebackgroundwillpresumablycorrespondtoaboundingrectangle,butisdeterminedbytheCSSrenderingengine.
Usedby:Mathattributes,Sectional.
attributes,XMAppattributes,XMCellattributes,XMRowattributes,XMTextattributes,XMTokattributes,XMWrapattributes,blockattributes,captionattributes,constraintattributes,delattributes,descriptionattributes,emphattributes,enumerateattributes,equationattributes,equationgroupattributes,gureattributes,D.
2.
MODULELATEXML-COMMON171oatattributes,glossaryrefattributes,inline-blockattributes,inline-descriptionattributes,inline-enumerateattributes,inline-itemattributes,inline-itemizeattributes,inline-paraattributes,itemattributes,itemizeattributes,listingattributes,pattributes,paraattributes,proofattributes,quoteattributes,refattributes,tableattributes,tabularattributes,tagattributes,tbodyattributes,tdattributes,textattributes,tfootattributes,theadattributes,theoremattributes,titleattributes,trattributes,verbatimattributes,Mathattributes,Sectional.
attributes,XMAppattributes,XMCellattributes,XMRowattributes,XMTextattributes,XMTokattributes,XMWrapattributes,blockattributes,captionattributes,constraintattributes,delattributes,descriptionattributes,emphattributes,enumerateattributes,equationattributes,equationgroupattributes,gureattributes,oatattributes,glossaryrefattributes,inline-blockattributes,inline-descriptionattributes,inline-enumerateattributes,inline-itemattributes,inline-itemizeattributes,inline-paraattributes,itemattributes,itemizeattributes,listingattributes,pattributes,paraattributes,proofattributes,quoteattributes,refattributes,tableattributes,tabularattributes,tagattributes,tbodyattributes,tdattributes,textattributes,tfootattributes,theadattributes,theoremattributes,titleattributes,trattributes,verbatimattributesPatternPositionable.
attributesAttributessharedbylow-level,genericinlineandblockelementsthatcanbesizedorshifted.
Attributewidth=Length.
typethedesiredwidthoftheboxAttributeheight=Length.
typethedesiredheightoftheboxAttributedepth=Length.
typethedesireddepthoftheboxAttributexoffset=Length.
typehorizontalshiftthepositionofthebox.
Attributeyoffset=Length.
typeverticalshiftthepositionofthebox.
Attributealign=(left|center|right|justified)alignmentofmaterialwithinthebox.
Attributevattach=(top|middle|bottom|baseline)specieswhichlineoftheboxisalignedtothebaselineofthecontainingobject.
Thedefaultisbaseline.
Attributeoat=(right|left|text)thehorizontaloatingplacementparameterthatdetermineswheretheobjectisdisplayed.
172APPENDIXD.
SCHEMAAttributeframed=(rectangle|underline|text)thekindofframeoroutlineforthebox.
Attributeframecolor=textthecoloroftheframeoroutlieforthebox.
Usedby:XMath.
attributes,blockattributes,gureattributes,oatattributes,inline-blockattributes,inline-paraattributes,listingattributes,pattributes,paraattributes,ruleattributes,tableattributes,textattributes,XMath.
attributes,blockattributes,gureattributes,oatattributes,inline-blockattributes,inline-paraattributes,listingattributes,pattributes,paraattributes,ruleattributes,tableattributes,textattributesPatternTransformable.
attributesAttributessharedby(hopefullyfew)elementsthatcanbetransformed.
SuchelementsshouldalsohavePositionable.
attributes.
Transformationorderofanindividualelementisassumedtobetranslate,scale,rotate;wrapelementstoachievedifferentorders.
Attributesinnerwidth,innerheightandinnerdepthdescribethesizeofthecontentsoftheelementbeforetransformation;TheresultsizewouldbeencodedinPositional.
attributes.
Attributextranslate=Length.
typehorizontalshiftthepositionoftheinnerelement.
Attributeytranslate=Length.
typeverticalshiftthepositionoftheinnerelement.
Attributexscale=texthorizontalscalingoftheinnerelement.
Attributeyscale=textverticalscalignoftheinnerelement.
Attributeangle=texttherotationangle,counter-clockwise,indegrees.
Attributeinnerwidth=Length.
typetheexpectedwidthofthecontentsoftheinnerelementAttributeinnerheight=Length.
typetheexpectedheightofthecontentsoftheinnerelementAttributeinnerdepth=Length.
typetheexpecteddepthofthecontentsoftheinnerelementUsedby:gureattributes,oatattributes,inline-blockattributes,tableattributes,gureattributes,oatattributes,inline-blockattributes,tableattributesPatternImageable.
attributesAttributesforelementsthatmaybeconvertedtoimageformduringpostprocessing,suchasmath,graphics,pictures,etc.
Notethattheseattributesaregenerallynotlledinuntilpostprocessing,butthattheycouldbeinitD.
2.
MODULELATEXML-COMMON173Attributeimagesrc=anyURIthele,possiblygeneratedfromotherdata.
Attributeimagewidth=nonNegativeIntegerthewidthinpixelsofimagesrc.
Attributeimageheight=nonNegativeIntegertheheightinpixelsofimagesrc.
Notethat,unlikeTEX,thisisthetotalheight,includingthedepth(ifany).
Attributeimagedepth=integerthedepthinpixelsofimagesrc,beingthelocationofthebaselineofthecontentshownintheimage.
Whendisplayedinilne,animagewithapositivedepthshouldbeshifteddownrelativetothebaselineofneighboringmaterial.
Attributedescription=textadescriptionoftheimageUsedby:Mathattributes,graphicsattributes,pictureattributes,Mathattributes,graphicsattributes,pictureattributesPatternRDF.
attributesAttributesforRDFa(ResourceDescriptionFramework),followingRDFaCore1.
1http://www.
w3.
org/TR/rdfa-syntax/.
Thefollowingdescriptionsgiveashortoverviewoftheusageoftheattributes,butseethespecicationforthecompletedetails,whicharesometimescomplex.
Attributevocab=textindicatesthedefaultvocabulary(generallyshouldbemanagedbyLaTeXMLandonlyappearonrootnode)Attributeprex=textspeciesamappingbetweenCURIEprexesandIRI(URI).
(generallyshouldbemanagedbyLaTeXMLandonlyappearonrootnode)Attributeabout=textindicatesthesubjectforpredicatesappearingonthesameordescendantnodes.
Attributeaboutlabelref=textgivesthelabelforthedocumentelementthatservesasthesubject;itwillbeconvertedtoaboutidrefandaboutduringpost-processing.
Attributeaboutidref=textgivestheidforthedocumentelementthatservesasthesubject;itwillbeconvertedtoaboutduringpost-processing.
Attributeresource=textindicatesthesubjectforpredicatesappearingondescendantnodes,andalsoindicatestheobjectforpredicateswhenpropertyappearsonthesamenode,orwhenrelorrevappearsonanancestor.
174APPENDIXD.
SCHEMAAttributeresourcelabelref=textgivesthelabelforthedocumentelementthatservesastheresourceobject;itwillbeconvertedtoresourceidrefandresourceduringpost-processing.
Attributeresourceidref=textgivestheidforthedocumentelementthatservesastheresourceobject;itwillbeconvertedtoresourceduringpost-processing.
Attributeproperty=textindicatesthepredicateandassertsthatthesubjectisrelatedbythatpredicatetotheobject.
Thesubjectisdeterminedbyoneofaboutonsamenode,resourceortypeofonanancestornode,orbythedocumentroot.
Theobjectisdeterminedbyoneofresource,href,contentortypeofonthesamenode,orbythetextcontentofthenode.
Attributerel=textindicatesthepredicateexactlyaspropertyexceptthatitcanassertmultipleRDFtripleswheretheobjectsarethenearestdescendentresources.
Attributerev=textindicatesthepredicateexactlyasrelexceptthatitindicatesthereverserelationship(withsubjectandobjectswapped).
Attributetypeof=textindicatesthetypeoftheresourceandthusimplicitlyassertsarelationthattheobjecthasthegiventype.
Additionally,ifnoresourcewasgivenonthesamenode,indicatesananonymoussubjectandorobjectexactlyasresourceAttributedatatype=textindicatesthedatatypeofthetargetresource;Attributecontent=textindicatesthecontentofthepropertytobeusedastheobject,tobeusedinsteadofthecontentoftheelementitself;Usedby:Common.
attributes,Common.
attributesPatternData.
attributesAttributesforrawdatastorageAttributedata=textthedataitselfAttributedatamimetype=texttheMIMEtypeofthedataAttributedataencoding=texttheencodingofthedata(eitherempty,base64,or)Usedby:gureattributes,oatattributes,listingattributes,proofattributes,tableattributes,gureattributes,oatattributes,listingattributes,proofattributes,tableattributesD.
3.
MODULELATEXML-INLINE175D.
3ModuleLaTeXML-inlineAddtoInline.
classTheinlinemoduledenesbasicinlineelementsusedthroughout.
|=(text|emph|del|sub|sup|glossaryref|rule|anchor|ref|cite|bibref)ElementtextGeneralcontainerforstyledtext.
Attributescoveravarietyofstylingandpositionshiftingproperties.
Usedby:Inline.
class,MathForkmodel,declaremodel,equationmodel,Inline.
class,MathForkmodel,declaremodel,equationmodelPatterntextattributesAttributesfortext.
Attributes:Common.
attributes,ID.
attributes,Positionable.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesPatterntextmodelContentmodelfortext.
Content:Inline.
modelExpansion:(Inline.
model)ElementemphEmphasizedtext.
Usedby:Inline.
class,Inline.
classPatternemphattributesAttributesforemph.
Attributes:Common.
attributes,ID.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesPatternemphmodelContentmodelforemph.
Content:Inline.
modelExpansion:(Inline.
model)ElementdelDeletedtext.
Usedby:Inline.
class,Inline.
classPatterndelattributesAttributesfordel.
Attributes:Common.
attributes,ID.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesPatterndelmodelContentmodelfordel.
Content:Inline.
modelExpansion:(Inline.
model)176APPENDIXD.
SCHEMAElementsubTextualsubscripttext.
Usedby:Inline.
class,Inline.
classPatternsubattributesAttributesforsub.
Attributes:Common.
attributes,ID.
attributesPatternsubmodelContentmodelforsub.
Content:Inline.
modelExpansion:(Inline.
model)ElementsupTextualsuperscripttext.
Usedby:Inline.
class,Inline.
classPatternsupattributesAttributesforsup.
Attributes:Common.
attributes,ID.
attributesPatternsupmodelContentmodelforsup.
Content:Inline.
modelExpansion:(Inline.
model)ElementglossaryrefRepresentstheusageofatermfromaglossary.
Usedby:Inline.
class,Inline.
classPatternglossaryrefattributesAttributesforglossaryref.
Attributes:Common.
attributes,Refable.
attributes,Listable.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesAttributekey=textshouldbeusedtoidentierusedfortheglossaryref.
Attributetitle=textgivesaexpandedformoftheglossaryref(unused),Attributeshow=textapatternencodinghowthetextcontentshouldbelledinduringpostprocessing,ifitisempty.
Itconsistsofthewordstype(standingfortheobjecttype,eg.
Ch.
),refnum,typerefnumandtitleortoctitle(fortheshortformofthetitle)mixedwitharbitrarycharacters.
PatternglossaryrefmodelContentmodelforglossaryref.
Content:Inline.
modelExpansion:(Inline.
model)ElementruleARule.
D.
3.
MODULELATEXML-INLINE177Usedby:Inline.
class,Inline.
classPatternruleattributesAttributesforrule.
Attributes:Common.
attributes,Positionable.
attributes,Colorable.
attributesPatternrulemodelContentmodelforrule.
Content:emptyExpansion:()ElementrefAhyperlinkreferencetosomeotherobject.
WhenconvertedtoHTML,thecontentwouldbethecontentoftheanchor.
Thedestinationcanbespeciedbyoneoftheattributeslabelref,idreforhref;Missingeldswillusuallybelledinduringpostprocessing,basedondataextractedfromthedocument(s).
Usedby:Inline.
class,navigationmodel,tocentrymodel,Inline.
class,navigationmodel,tocentrymodelPatternrefattributesAttributesforref.
Attributes:Common.
attributes,Refable.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesAttributeshow=textapatternencodinghowthetextcontentshouldbelledinduringpostprocessing,ifitisempty.
Itconsistsofthewordstype(standingfortheobjecttype,eg.
Ch.
),refnumandtitle(includingtypeandrefnum)ortoctitle(fortheshortformofthetitle)mixedwitharbitrarycharacters.
Attributetitle=textgivesalongerformdescriptionofthetarget,thiswouldtypicallyappearasatooltipinHTML.
Typicallylledinbypostprocessor.
PatternrefmodelContentmodelforref.
Content:Inline.
modelExpansion:(Inline.
model)ElementanchorInlineanchor.
Usedby:Inline.
class,Inline.
classPatternanchorattributesAttributesforanchor.
Attributes:Common.
attributes,ID.
attributesPatternanchormodelContentmodelforanchor.
178APPENDIXD.
SCHEMAContent:Inline.
modelExpansion:(Inline.
model)ElementciteAcontainerforabibliographiccitation.
Themodelisinlinetoallowarbitrarycommentsbeforeandaftertheexpectedbibref(s)whicharethespeciccitation.
Usedby:Inline.
class,Inline.
classPatternciteattributesAttributesforcite.
Attributes:Common.
attributes,Listable.
attributesPatterncitemodelContentmodelforcite.
Content:Inline.
modelExpansion:(Inline.
model)ElementbibrefAbibliographiccitationreferingtoaspecicbibliographicitem.
Postprocessingwillturnthisintoanreffortheactuallink.
Usedby:Inline.
class,Inline.
classPatternbibrefattributesAttributesforbibref.
Attributes:Common.
attributes,IDREF.
attributes,Listable.
attributesAttributebibrefs=textacommaseparatedlistofbibliographickeys.
(Seethekeyattributeofbibitemandbibentry)Attributeshow=textapatternencodinghowthetextcontent(ofanemptybibref)willbelledin.
Consistsofstringsauthor,fullauthor,year,numberandtitle(tobereplacedbydatafromthebibliographicitem)mixedwitharbitrarycharacters.
Attributeseparator=textseparatorbetweenformattedreferencesAttributeyyseparator=textseparatorbetweenformattedyearswhenduplicateauthorsarecombined.
PatternbibrefmodelContentmodelforbibref.
Content:bibrefphrase*Expansion:(bibrefphrase*)ElementbibrefphraseAprecedingorfollowingphraseusedincomposingabibliographicreference,suchaslistingpagesorchapter.
Usedby:bibrefmodel,bibrefmodelD.
4.
MODULELATEXML-BLOCK179PatternbibrefphraseattributesAttributesforbibrefphraseAttributes:Common.
attributesPatternbibrefphrasemodelContentmodelforbibrefphraseContent:Inline.
modelExpansion:(Inline.
model)D.
4ModuleLaTeXML-blockAddtoBlock.
classTheblockmoduledenesthefollowing'physical'blockelements.
|=(p|equation|equationgroup|quote|block|listing|itemize|enumerate|description|pagination)AddtoMisc.
classTheseareinlineformsoflogicallists(theyareincludedinMiscsincethathasbeenthegeneralstrategy)|=(inline-itemize|inline-enumerate|inline-description)PatternEquationMeta.
classAdditionalMetadatathatcanbepresentinequations.
Content:constraintExpansion:(constraint)Usedby:equationmodel,equationgroupmodel,equationmodel,equationgroupmodelElementpAphysicalparagraph.
Usedby:Block.
class,equationgroupmodel,Block.
class,equationgroupmodelPatternpattributesAttributesforp.
Attributes:Common.
attributes,ID.
attributes,Positionable.
attributes,Backgroundable.
attributesPatternpmodelContentmodelforp.
Content:Inline.
modelExpansion:(Inline.
model)ElementconstraintAconstraintuponanequation.
Usedby:EquationMeta.
class,EquationMeta.
classPatternconstraintattributesAttributesforconstraint.
180APPENDIXD.
SCHEMAAttributes:Backgroundable.
attributesAttributehidden=booleanPatternconstraintmodelContentmodelforconstraint.
Content:Inline.
modelExpansion:(Inline.
model)ElementequationAnEquation.
ThemodelisjustInlinewhichincludesMath,themainexpectedingredient.
However,otherthingscanendupindisplaymath,too,soweuseInline.
Notethattabularishereonlybecauseit'sacommon,ifmisguided,idiom;theprocessorwillliftsuchelementsoutofmath,whenpossibleUsedby:Block.
class,equationgroupmodel,listinglinemodel,Block.
class,equationgroupmodel,listinglinemodelPatternequationattributesAttributesforequation.
Attributes:Common.
attributes,Labelled.
attributes,Backgroundable.
attributesPatternequationmodelContentmodelforequation.
Content:(tags|Math|MathFork|text|Misc.
class|Meta.
class|EquationMeta.
class)*Expansion:((tags|Math|MathFork|text|Misc.
class|Meta.
class|EquationMeta.
class)*)ElementequationgroupAgroupofequations,perhapsaligned(Thoughthisisnowhererecorded).
Usedby:Block.
class,equationgroupmodel,listinglinemodel,Block.
class,equationgroupmodel,listinglinemodelPatternequationgroupattributesAttributesforequationgroup.
Attributes:Common.
attributes,Labelled.
attributes,Backgroundable.
attributesAttributerowsep=Length.
typethespacingbetweenrows(equations,intertext,.
.
.
)PatternequationgroupmodelContentmodelforequationgroup.
Content:(tags|equationgroup|equation|p|Meta.
class|EquationMeta.
class)*Expansion:((tags|equationgroup|equation|p|Meta.
class|EquationMeta.
class)*)D.
4.
MODULELATEXML-BLOCK181ElementMathForkAwrapperforMaththatprovidesalternative,buttypicallylesssemanticallymeaningful,formattedrepresentations.
Therstchildisthemeaningfulform,theextrachildrenprovideformattedforms,forexamplebeingtablerowsorcellsarisingfromaneqnarray.
Usedby:equationmodel,equationmodelPatternMathForkattributesAttributesforMathFork.
Attributes:Common.
attributesPatternMathForkmodelContentmodelforMathFork.
Content:(Math|text),MathBranch*Expansion:((Math|text),MathBranch*)ElementMathBranchAcontainerforanalternativelyformattedmathrepresentation.
Usedby:MathForkmodel,MathForkmodelPatternMathBranchattributesAttributesforMathBranch.
Attributes:Common.
attributesAttributeformat=textPatternMathBranchmodelContentmodelforMathBranch.
Content:(Math|tr|td)*Expansion:((Math|tr|td)*)ElementquoteAquotation.
Usedby:Block.
class,Block.
classPatternquoteattributesAttributesforquote.
Attributes:Common.
attributes,ID.
attributes,Backgroundable.
attributesAttributerole=textThekindofquotation;couldbesomethinglikeverse,ortranslationPatternquotemodelContentmodelforquote.
Content:Block.
modelExpansion:(Block.
model)ElementblockAgenericblock(fallback).
Usedby:Block.
class,Block.
classPatternblockattributesAttributesforblock.
182APPENDIXD.
SCHEMAAttributes:Common.
attributes,ID.
attributes,Positionable.
attributes,Backgroundable.
attributesPatternblockmodelContentmodelforblock.
Content:Block.
modelExpansion:(Block.
model)ElementlistingAnListing,(withoutcaption:seeoat)Usedby:Block.
class,Block.
classPatternlistingattributesAttributesforlisting.
Attributes:Common.
attributes,Labelled.
attributes,Positionable.
attributes,Backgroundable.
attributes,Data.
attributesPatternlistingmodelContentmodelforlisting.
Content:listingline*Expansion:(listingline*)ElementlistinglinealineinalistingUsedby:listingmodel,listingmodelPatternlistinglineattributesAttributesforlistinglineAttributes:Common.
attributes,Labelled.
attributesPatternlistinglinemodelContentmodelforlistingline;Inline.
modelplusequationsContent:tags,(text|Inline.
class|Misc.
class|Meta.
class|equation|equationgroup)*Expansion:(tags,(text|Inline.
class|Misc.
class|Meta.
class|equation|equationgroup)*)ElementitemizeAnitemizedlist.
Usedby:Block.
class,Block.
classPatternitemizeattributesAttributesforitemize.
Attributes:Common.
attributes,ID.
attributes,Backgroundable.
attributesPatternitemizemodelContentmodelforitemize.
Content:item*Expansion:(item*)ElementenumerateAnenumeratedlist.
D.
4.
MODULELATEXML-BLOCK183Usedby:Block.
class,Block.
classPatternenumerateattributesAttributesforenumerate.
Attributes:Common.
attributes,ID.
attributes,Backgroundable.
attributesPatternenumeratemodelContentmodelforenumerate.
Content:item*Expansion:(item*)ElementdescriptionAdescriptionlist.
Theitemswithinareexpectedtohaveatagwhichrepresentsthetermbeingdescribedineachitem.
Usedby:Block.
class,Block.
classPatterndescriptionattributesAttributesfordescription.
Attributes:Common.
attributes,ID.
attributes,Backgroundable.
attributesPatterndescriptionmodelContentmodelfordescription.
Content:item*Expansion:(item*)ElementitemAnitemwithinalist(itemize,enumerateordescription).
Usedby:descriptionmodel,enumeratemodel,itemizemodel,descriptionmodel,enumeratemodel,itemizemodelPatternitemattributesAttributesforitem.
Attributes:Common.
attributes,Labelled.
attributes,Backgroundable.
attributesAttributeitemsep=Length.
typetheverticalspacingbetweenitemsPatternitemmodelContentmodelforitem.
Content:tags,Para.
modelExpansion:(tags,Para.
model)Elementinline-itemizeAninlineformofitemizedlist.
Usedby:Misc.
class,Misc.
classPatterninline-itemizeattributesAttributesforinline-itemize.
Attributes:Common.
attributes,ID.
attributes,Backgroundable.
attributesPatterninline-itemizemodelContentmodelforinline-itemize.
184APPENDIXD.
SCHEMAContent:inline-item*Expansion:(inline-item*)Elementinline-enumerateAninlineformofenumeratedlist.
Usedby:Misc.
class,Misc.
classPatterninline-enumerateattributesAttributesforinline-enumerate.
Attributes:Common.
attributes,ID.
attributes,Backgroundable.
attributesPatterninline-enumeratemodelContentmodelforinline-enumerate.
Content:inline-item*Expansion:(inline-item*)Elementinline-descriptionAninlineformofdescriptionlist.
Theinline-itemswithinareexpectedtohaveatagswhichrepresentsthetermbeingdescribedineachinline-item.
Usedby:Misc.
class,Misc.
classPatterninline-descriptionattributesAttributesforinline-description.
Attributes:Common.
attributes,ID.
attributes,Backgroundable.
attributesPatterninline-descriptionmodelContentmodelforinline-description.
Content:inline-item*Expansion:(inline-item*)Elementinline-itemAnitemwithinaninlinelist(inline-itemize,inline-enumerateorinline-description).
Usedby:inline-descriptionmodel,inline-enumeratemodel,inline-itemizemodel,inline-descriptionmodel,inline-enumeratemodel,inline-itemizemodelPatterninline-itemattributesAttributesforitem.
Attributes:Common.
attributes,Labelled.
attributes,Backgroundable.
attributesPatterninline-itemmodelContentmodelforinline-item.
Content:tags,(Inline.
class|Misc.
class|Meta.
class)*Expansion:(tags,(Inline.
class|Misc.
class|Meta.
class)*)ElementtagsAcontainerforoneormoretags.
Atmostonewillhavenorole,whichwouldbethedefaultdisplay.
Othertagwillhavetheroleattributeforuseinspecialformsofreferencing.
D.
4.
MODULELATEXML-BLOCK185Usedby:SectionalFrontMatter.
class,bibitemmodel,declaremodel,equationmodel,equationgroupmodel,guremodel,oatmodel,inline-itemmodel,itemmodel,listinglinemodel,notemodel,proofmodel,tablemodel,theoremmodel,SectionalFrontMatter.
class,bibitemmodel,declaremodel,equationmodel,equationgroupmodel,guremodel,oatmodel,inline-itemmodel,itemmodel,listinglinemodel,notemodel,proofmodel,tablemodel,theoremmodelPatterntagsmodelContent:tag+Expansion:(tag+)ElementtagAtagwithinanitemindicatingthetermorbulletforagivenitem.
Usedby:captionmodel,tagsmodel,titlemodel,toccaptionmodel,toctitlemodel,captionmodel,tagsmodel,titlemodel,toccaptionmodel,toctitlemodelPatterntagattributesAttributesfortag.
Attributes:Common.
attributes,Backgroundable.
attributesAttributerole=textspeciesthepurposethistagisusedfor:novalueisdefaultdisplayAttributeopen=textspeciesanopendelimitersusedtodisplaythetag.
Attributeclose=textspeciesanclosedelimitersusedtodisplaythetag.
PatterntagmodelContentmodelfortag.
Content:Inline.
modelExpansion:(Inline.
model)ElementpaginationApagebreakorrelatedpaginationinformation.
Usedby:Block.
class,Para.
class,Block.
class,Para.
classPatternpaginationattributesAttributesforpagination.
Attributes:Common.
attributesAttributerole=textwhatkindofpaginationPatternpaginationmodelContentmodelforpagination.
Content:emptyExpansion:()186APPENDIXD.
SCHEMAD.
5ModuleLaTeXML-miscAddtoMisc.
classMiscellaneous(Misc)elementsare(typically)visibleelementswhichdon'thaveclearinlineorblockcharacter;theycanappearinbothinlineandblockcontexts.
|=(inline-block|verbatim|break|graphics|svg|rawhtml|rawliteral)Elementinline-blockAninlineblock.
Actually,canappearininlineorblockmode,buttypesetsitscontentsasablock.
Usedby:Misc.
class,Misc.
classPatterninline-blockattributesAttributesforinline-block.
Attributes:Common.
attributes,ID.
attributes,Positionable.
attributes,Transformable.
attributes,Backgroundable.
attributesPatterninline-blockmodelContentmodelforinline-block.
Content:Block.
modelExpansion:(Block.
model)ElementverbatimVerbatimcontentUsedby:Misc.
class,Misc.
classPatternverbatimattributesAttributesforverbatim.
Attributes:Common.
attributes,ID.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesPatternverbatimmodelContentmodelforverbatim.
Content:Inline.
modelExpansion:(Inline.
model)ElementbreakAforcedlinebreak.
Usedby:Misc.
class,Misc.
classPatternbreakattributesAttributesforbreak.
Attributes:Common.
attributesPatternbreakmodelContentmodelforbreak.
Content:emptyExpansion:()ElementgraphicsAgraphicalinsertionofanexternalle.
D.
5.
MODULELATEXML-MISC187Usedby:Misc.
class,Misc.
classPatterngraphicsattributesAttributesforgraphics.
Attributes:Common.
attributes,ID.
attributes,Imageable.
attributesAttributegraphic=textthepathtothegraphicsle.
Thisisthe(oftenminimallyspecied)pathtoagraphicsleomittingthetypeextension.
Onceresolvedtoaspecicimagele,theimagesrc(fromImageable.
attributes)isused.
Attributecandidates=textacommaseparatedlistofcandidategraphicslesthatcouldbeusedtoforgraphic.
Apost-processororapplicationmaychoosefromthese,ormaymakeitsownselectionorsynthesistoimplementthegraphicforagiventarget.
Attributeoptions=textanencodingofthescalingandpositioningoptionstobeusedinprocessingthegraphic.
PatterngraphicsmodelContentmodelforgraphics.
Content:emptyExpansion:()PatternsvgContent:Modulesvg:svg11(overridden)included.
Expansion:(Modulesvg:svg11(overridden)included.
)Usedby:Misc.
class,Picture.
class,Misc.
class,Picture.
classElementxhtml:*Content:(AttributeANY=text|text|xhtml:*)*Usedby:rawhtml,xhtml:*ElementrawhtmlAcontainerforarbitrarymarkupinthexhtmlnamespace(notcurrentlyvalidatedagainstanyparticularhtmlschema)Content:xhtml:**Usedby:Misc.
class,Misc.
class188APPENDIXD.
SCHEMAElementrawliteralAcontainerforevenmorearbitrarydirectiveslikejsp,php,etcDoesn'tcreateanelement,butanopenanglebracketfollowedbyopenthenthetextcontent,followedbyacloseanglebracketfollowedbyclose.
Attributeopen=textAttributeclose=textContent:textUsedby:Misc.
class,Misc.
classD.
6ModuleLaTeXML-metaAddtoMeta.
classMetaelementsaregenerallyhidden;theycanappearinbothinlineandblockcontexts.
|=(note|declare|indexmark|glossarydenition|rdf|ERROR|resource|navigation)ElementnoteMetadatathatcoversseveral'outofband'annotations.
It'scontentallowsbothinlineandblock-levelcontent.
Usedby:Meta.
class,Meta.
classPatternnoteattributesAttributesfornote.
Attributes:Common.
attributes,Labelled.
attributesAttributemark=textindicatesthedesiredvisiblemarkertobelinkedtothenote.
Attributerole=(footnote|text)indicatesthekindofnotePatternnotemodelContentmodelfornote.
Content:tags,Flow.
modelExpansion:(tags,Flow.
model)Elementdeclaredeclarerecordsdeclarativemathematicalinformation.
Usedby:Meta.
class,Meta.
classPatterndeclareattributesAttributesfordeclare.
Attributes:ID.
attributesAttributetype=textthetypeofdeclarationAttributedeniens=textthethingbeingdened(ifglobal),elsemusthavexml:idD.
6.
MODULELATEXML-META189Attributesortkey=textthesortkeyforusecreatingnotationindicesPatterndeclaremodelContentmodelfordeclareContent:tags,textExpansion:(tags,text)ElementindexmarkMetadatatorecordanindexingposition.
Thecontentisasequenceofindexphrase,eachrepresentingalevelinamultilevelindexingentry.
Usedby:Meta.
class,Meta.
classPatternindexmarkattributesAttributesforindexmark.
Attributes:Common.
attributes,Listable.
attributesAttributeseealso=textaattenedform(likekey)ofanotherindexmark,usedtocrossreference.
Attributestyle=textNOTE:describethis.
PatternindexmarkmodelContentmodelforindexmark.
Content:indexphrase*,indexsee*Expansion:(indexphrase*,indexsee*)ElementindexphraseAphrasewithinanindexmarkUsedby:indexentrymodel,indexmarkmodel,indexentrymodel,indexmarkmodelPatternindexphraseattributesAttributesforindexphrase.
Attributes:Common.
attributesAttributekey=textaattenedformofthephraseforgeneratinganID.
PatternindexphrasemodelContentmodelforindexphrase.
Content:Inline.
modelExpansion:(Inline.
model)ElementindexseeAsee-alsophrasewithinanindexmarkUsedby:indexmarkmodel,indexmarkmodelPatternindexseeattributesAttributesforindexsee.
Attributes:Common.
attributes190APPENDIXD.
SCHEMAAttributekey=textaattenedformofthephraseforgeneratinganID.
Attributename=textanamefortheseephrase,suchas"seealso".
PatternindexseemodelContentmodelforindexsee.
Content:Inline.
modelExpansion:(Inline.
model)ElementglossarydenitionAdenitionwithinanglossaryentryUsedby:Meta.
class,Meta.
classPatternglossarydenitionattributesAttributesforglossarydenition.
Attributes:Common.
attributes,Listable.
attributesAttributekey=textaattenedformofthedenitionforgeneratinganID.
PatternglossarydenitionmodelContentmodelforglossarydenition.
Content:glossaryphrase*Expansion:(glossaryphrase*)ElementglossaryphraseAphrasebeingclariedwithinanglossaryentryUsedby:glossarydenitionmodel,glossaryentrymodel,glossarydenitionmodel,glossaryentrymodelPatternglossaryphraseattributesAttributesforglossaryphrase.
Attributes:Common.
attributes,IDREF.
attributesAttributekey=textaattenedformofthephraseforgeneratinganID.
Attributerole=textakeywordnamingtheformatofthisphrase(tomatchshowinglossaryref).
PatternglossaryphrasemodelContentmodelforglossaryphrase.
Content:Inline.
modelExpansion:(Inline.
model)ElementrdfAcontainerforRDFannotations.
(Seedocumentstructureforrdf-prexesattribute)Usedby:Meta.
class,Meta.
classD.
6.
MODULELATEXML-META191PatternrdfattributesAttributesforrdfAttributes:Common.
attributesPatternrdfmodelContentmodelforrdfContent:Flow.
modelExpansion:(Flow.
model)ElementERRORerrorobjectforundenedcontrolsequences,orwhateverUsedby:Meta.
class,XMath.
class,Meta.
class,XMath.
classPatternERRORattributesAttributesforERROR.
Attributes:Common.
attributes,ID.
attributesPatternERRORmodelContentmodelforERROR.
Content:text*Expansion:(text*)ElementresourcearesourceforuseinfurtherprocessingsuchasjavascriptorCSSUsedby:Meta.
class,Meta.
classPatternresourceattributesAttributesforresource.
Attributes:Common.
attributesAttributesrc=textthesourceurltotheresourceAttributetype=textthemimetypeoftheresourceAttributemedia=textthemediaforwhichthisresourceisapplicable(inthesenseofCSS).
PatternresourcemodelContent:text*Expansion:(text*)ElementnavigationRecordsnavigationcross-referencinginformation,orservesasacontainerforpagenavigationalblocks.
Usedby:Meta.
class,Meta.
classPatternnavigationattributesAttributesfornavigation.
Attributes:Common.
attributes192APPENDIXD.
SCHEMAPatternnavigationmodelContentmodelfornavigation.
Ainline-parachildshouldhaveattributeclassbeingoneofltxpagenavbar,ltxpageheaderorltxpagefooteranditscontentswillbeusedtocreatethosecomponentsofwebpages.
Lackingthose,aTOCrequestsatableofcontentsinthenavigationbar.
PageheadersandfooterswillbesynthesizedfromLinksfromthecurrentpageordocumenttorelatedones;thesearerepresentedbyrefelementswithrelbeingup,down,previous,next,andsoforth.
top-levelelements,presumablyblock-level,Content:(ref|TOC|inline-para)*Expansion:((ref|TOC|inline-para)*)D.
7ModuleLaTeXML-paraAddtoPara.
classThismoduledenesthefollowing'logical'blockelements.
|=(para|theorem|proof|gure|table|oat|pagination)AddtoMisc.
classAdditionally,itdenesthesemiscellaneouselementsthatcanappearinbothinlineandblockcontexts.
|=inline-paraElementparaALogicalparagraph.
Ithasanid,butnotalabel.
Usedby:Para.
class,Para.
classPatternparaattributesAttributesforpara.
Attributes:Common.
attributes,ID.
attributes,Positionable.
attributes,Backgroundable.
attributesPatternparamodelContentmodelforpara.
Content:Block.
modelExpansion:(Block.
model)Elementinline-paraAninlinepara.
Actually,canappearininlineorblockmode,buttypesetsitscontentsaspara.
Usedby:Misc.
class,navigationmodel,Misc.
class,navigationmodelPatterninline-paraattributesAttributesforinline-para.
Attributes:Common.
attributes,ID.
attributes,Positionable.
attributes,Backgroundable.
attributesPatterninline-paramodelContentmodelforinline-para.
Content:Para.
modelD.
7.
MODULELATEXML-PARA193Expansion:(Para.
model)ElementtheoremAtheoremorsimilarobject.
Theclassattributecanbeusedtodistinguishdifferentkindsoftheorem.
Usedby:Para.
class,Para.
classPatterntheoremattributesAttributesfortheorem.
Attributes:Common.
attributes,Labelled.
attributes,Backgroundable.
attributesPatterntheoremmodelContentmodelfortheorem.
Content:tags,title,Para.
modelExpansion:(tags,title,Para.
model)ElementproofAprooforsimilarobject.
Theclassattributecanbeusedtodistinguishdifferentkindsofproof.
Usedby:Para.
class,Para.
classPatternproofattributesAttributesforproof.
Attributes:Common.
attributes,Labelled.
attributes,Backgroundable.
attributes,Data.
attributesPatternproofmodelContentmodelforproof.
Content:tags,title,Para.
modelExpansion:(tags,title,Para.
model)PatternCaption.
classThesearetheadditionalelementsrepresentinggureandtablecaptions.
NOTE:Couldtitlesensiblybereusedhere,insteadOr,shouldcaptionbeusedfortheoremandproofContent:(caption|toccaption)Expansion:((caption|toccaption))Usedby:guremodel,oatmodel,tablemodel,guremodel,oatmodel,tablemodelElementgureAgure,possiblycaptioned.
Usedby:Para.
class,guremodel,oatmodel,tablemodel,Para.
class,guremodel,oatmodel,tablemodelPatterngureattributesAttributesforgure.
Attributes:Common.
attributes,Labelled.
attributes,Positionable.
attributes,Transformable.
attributes,Backgroundable.
attributes,Data.
attributes194APPENDIXD.
SCHEMAAttributeplacement=texttheverticaloatingplacementparameterthatdetermineswheretheobjectisdisplayed.
PatternguremodelContentmodelforgure;allownestedgures,etcfor"sub"oats.
Content:(tags|gure|table|oat|Block.
model|Caption.
class)*Expansion:((tags|gure|table|oat|Block.
model|Caption.
class)*)ElementtableATable,possiblycaptioned.
Thisisnotnecessarilyatabular.
Usedby:Para.
class,guremodel,oatmodel,tablemodel,Para.
class,guremodel,oatmodel,tablemodelPatterntableattributesAttributesfortable.
Attributes:Common.
attributes,Labelled.
attributes,Positionable.
attributes,Transformable.
attributes,Backgroundable.
attributes,Data.
attributesAttributeplacement=texttheverticaloatingplacementparameterthatdetermineswheretheobjectisdisplayed.
PatterntablemodelContentmodelfortable.
Content:(tags|table|gure|oat|Block.
model|Caption.
class)*Expansion:((tags|table|gure|oat|Block.
model|Caption.
class)*)ElementoatAgenericoat,possiblycaptioned,somethingotherthanatableorgureUsedby:Para.
class,guremodel,oatmodel,tablemodel,Para.
class,guremodel,oatmodel,tablemodelPatternoatattributesAttributesforoat.
Attributes:Common.
attributes,Labelled.
attributes,Positionable.
attributes,Transformable.
attributes,Backgroundable.
attributes,Data.
attributesAttributerole=textThekindofoat;couldbesomethinglikealisting,orsomeotherthingAttributeplacement=texttheverticaloatingplacementparameterthatdetermineswheretheobjectisdisplayed.
D.
8.
MODULELATEXML-MATH195PatternoatmodelContentmodelforoat.
Content:(tags|oat|gure|table|Block.
model|Caption.
class)*Expansion:((tags|oat|gure|table|Block.
model|Caption.
class)*)ElementcaptionAcaptionforatableorgure.
Usedby:Caption.
class,Caption.
classPatterncaptionattributesAttributesforcaption.
Attributes:Common.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesPatterncaptionmodelContentmodelforcaption,basicallyInline.
modelwithtagincluded(normally,butnotnecessarily,tagwouldcomerst).
Content:(tag|text|Inline.
class|Misc.
class|Meta.
class)*Expansion:((tag|text|Inline.
class|Misc.
class|Meta.
class)*)ElementtoccaptionAshortformoftableorgurecaption,usedforlistsofguresorsimilar.
Usedby:Caption.
class,Caption.
classPatterntoccaptionattributesAttributesfortoccaption.
Attributes:Common.
attributesPatterntoccaptionmodelContentmodelfortoccaption.
Content:(tag|text|Inline.
class|Misc.
class|Meta.
class)*Expansion:((tag|text|Inline.
class|Misc.
class|Meta.
class)*)D.
8ModuleLaTeXML-mathAddtoInline.
classThemathmoduledenesLaTeXML'sinternalrepresentationofmathematicalcontent,includingthebasicmathcontainerMath.
Thiselementisconsideredinline,asitwillbecontainedwithinsomeotherblock-levelelement,eg.
equationfordisplay-math.
|=MathPatternMath.
classThisclassdenesthecontentoftheMathelement.
Additionally,itcouldcontainMathMLorOpenMath,afterpostprocessing.
Content:XMathExpansion:(XMath)196APPENDIXD.
SCHEMAUsedby:Mathmodel,MathmodelPatternXMath.
classTheseelementscomprisetheinternalmathrepresentation,beingthecontentoftheXMathelement.
Content:(XMApp|XMTok|XMRef|XMHint|XMArg|XMWrap|XMDual|XMText|XMArray|ERROR)Expansion:((XMApp|XMTok|XMRef|XMHint|XMArg|XMWrap|XMDual|XMText|XMArray|ERROR))Usedby:XMAppmodel,XMArgmodel,XMCellmodel,XMDualmodel,XMWrapmodel,XMathmodel,XMAppmodel,XMArgmodel,XMCellmodel,XMDualmodel,XMWrapmodel,XMathmodelElementMathOutercontainerforallmath.
ThisholdstheinternalXMathrepresentation,aswellasimagedataandotherrepresentations.
Usedby:Inline.
class,MathBranchmodel,MathForkmodel,equationmodel,Inline.
class,MathBranchmodel,MathForkmodel,equationmodelPatternMathattributesAttributesforMath.
Attributes:Common.
attributes,Imageable.
attributes,ID.
attributes,Backgroundable.
attributesAttributemode=(display|inline)displayorinlinemode.
Attributetex=textreconstructionoftheTEXthatgeneratedthemath.
Attributecontent-tex=textmoresemanticversionoftex.
Attributetext=textatextiedrepresentationofthemath.
Attributelexemes=textpreservedgrammar-nearlexemesforexporttoexternalappsPatternMathmodelContentmodelforMath.
Content:Math.
class*Expansion:(Math.
class*)PatternXMath.
attributesCommonattributesforthevariousXMathelements.
Attributes:Positionable.
attributesAttributerole=textTherolethatthisitemplaysintheGrammar.
D.
8.
MODULELATEXML-MATH197Attributeenclose=textanenclosestyletoenclosetheobjectwithlegitimatevaluesbeingthoseofMathML'smenclosenotations;Attributelpadding=textleft,orleading,(presumablynon-semantic)paddingspace.
Attributerpadding=textright,ortrailing,(presumablynon-semantic)paddingspace.
Attributename=textThenameofthetoken,typicallythecontrolsequencethatcreatedit.
Attributemeaning=textAmoresemanticnamecorrespondingtotheintendedmeaning,suchastheOpenMathname.
Attributeomcd=textTheOpenMathCDforwhichmeaningisasymbol.
Attributescriptpos=textAnencodingofthepositionofsub/superscriptsBeforeparsing,ittakestwoforms.
Onabasetokenorelement,itisoneof(pre—mid—post),indicatingwhereanyscriptcanbeplaced.
Onascripttoken,itisanintegerlevel.
Afterparsing,theconcatenationismovedtothesub—super-script"operator".
AttributepossibleFunction=textanannotationplacedbytheparserwhenitsuspectsthistokenmaybeusedasafunction.
Attributedeclid=textanidtowherethedeclarationofthisobjectisgiven,preferablythexml:idofanltx:declareAttributehref=textreferencetoanarbitraryurl.
Usedby:XMAppattributes,XMArgattributes,XMArrayattributes,XMDualattributes,XMHintattributes,XMRefattributes,XMTextattributes,XMTokattributes,XMWrapattributes,XMAppattributes,XMArgattributes,XMArrayattributes,XMDualattributes,XMHintattributes,XMRefattributes,XMTextattributes,XMTokattributes,XMWrapattributesElementXMathInternalrepresentationofmathematics.
Usedby:Math.
class,Math.
classPatternXMathattributesAttributesforXMath.
Attributes:Common.
attributes,ID.
attributes198APPENDIXD.
SCHEMAPatternXMathmodelContentmodelforXMath.
Content:XMath.
class*Expansion:(XMath.
class*)ElementXMTokGeneralmathematicaltoken.
Usedby:XMath.
class,XMath.
classPatternXMTokattributesAttributesforXMTok.
Attributes:Common.
attributes,XMath.
attributes,ID.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesAttributethickness=textAthicknessusedfordrawinganylineswhicharepartofpresentingthetoken,suchasthefractionlineforthefractionoperator.
Attributestretchy=booleanWhetherornotthesymbolshouldbestretchy.
ThissharesMathML'sambiguityabouthorizontalversusverticalstretchiness.
Whennotset,defaultstowhateverMathML'soperatordictionarysays.
Attributemathstyle=(display|text|script|scriptscript)Themathstyleusedfordisplayingtheapplicationofthistokenwhenitrepresentssomesortoffraction,variable-sizedoperatororstackofexpressions(notethatthisappliestobinomialsorotherstacksofexpressionsaswellasfractions).
ValuesofdisplayortextcorrespondtoTEX'sdisplaystyleortextstyle,whileinlineindicatesthestackshouldbearrangedhorizontally(thelayoutmaydependontheoperator).
PatternXMTokmodelContentmodelforXMTok.
Content:text*Expansion:(text*)ElementXMAppGeneralizedapplicationofafunction,operator,whatever(therstchild)toarguments(theremainingchildren).
TheattributesareasubsetofthoseforXMTok.
Usedby:XMath.
class,XMath.
classPatternXMAppattributesAttributesforXMApp.
Attributes:Common.
attributes,XMath.
attributes,ID.
attributes,Colorable.
attributes,Backgroundable.
attributesPatternXMAppmodelContentmodelforXMApp.
Content:XMath.
class*D.
8.
MODULELATEXML-MATH199Expansion:(XMath.
class*)ElementXMDualParallelmarkupofcontent(rstchild)andpresentation(secondchild)ofamathematicalobject.
Typically,theargumentsaresharedbetweenthetwobranches:theyappearinthecontentbranch,withid's,andXMRefisusedinthepresentationbranchUsedby:XMath.
class,XMath.
classPatternXMDualattributesAttributesforXMDual.
Attributes:Common.
attributes,XMath.
attributes,ID.
attributesPatternXMDualmodelContentmodelforXMDual.
Content:XMath.
class,XMath.
classExpansion:(XMath.
class,XMath.
class)ElementXMHintVariouslayouthints,usuallyspacing,generallyignoredinparsing.
TheattributesareasubsetofthoseforXMTok.
Usedby:XMath.
class,XMath.
classPatternXMHintattributesAttributesforXMHint.
Attributes:Common.
attributes,XMath.
attributes,ID.
attributesPatternXMHintmodelContentmodelforXMHint.
Content:emptyExpansion:()ElementXMTextTextappearingwithinmath.
Usedby:XMath.
class,XMath.
classPatternXMTextattributesAttributesforXMText.
Attributes:Common.
attributes,XMath.
attributes,Backgroundable.
attributes,ID.
attributesPatternXMTextmodelContentmodelforXMText.
Content:(text|Inline.
class|Misc.
class)*Expansion:((text|Inline.
class|Misc.
class)*)ElementXMWrapWrapperforasequenceoftokensusedtoasserttheroleofthecontentsinitsparent.
Thiselementgenerallydisappearsafterparsing.
TheattributesareasubsetofthoseforXMTok.
Usedby:XMath.
class,XMath.
class200APPENDIXD.
SCHEMAPatternXMWrapattributesAttributesforXMWrap.
Attributes:Common.
attributes,XMath.
attributes,Backgroundable.
attributes,ID.
attributesAttributerule=textThegrammaticalrulethatshouldapplytothecontainedsequenceAttributestyle=textPatternXMWrapmodelContentmodelforXMWrap.
Content:XMath.
class*Expansion:(XMath.
class*)ElementXMArgWrapperforanargumenttoastructuredmacro.
Itimpliesthatitscontentcanbeparsedindependentlyofitsparent,andthusgenerallydisappearsafterparsing.
Usedby:XMath.
class,XMath.
classPatternXMArgattributesAttributesforXMArg.
Attributes:Common.
attributes,XMath.
attributes,ID.
attributesAttributerule=textThegrammaticalrulethatshouldapplytothecontainedsequencePatternXMArgmodelContentmodelforXMArg.
Content:XMath.
class*Expansion:(XMath.
class*)ElementXMRefStructuresharingelementtypicallyusedinthepresentationbranchofanXMDualtorefertotheargumentspresentinthecontentbranch.
Usedby:XMath.
class,XMath.
classPatternXMRefattributesAttributesforXMRef.
Attributes:Common.
attributes,XMath.
attributes,ID.
attributes,IDREF.
attributesPatternXMRefmodelContentmodelforXMRef.
Content:emptyExpansion:()ElementXMArrayMathArray/Alignmentstructure.
Usedby:XMath.
class,XMath.
classPatternXMArrayattributesAttributesforXMArray.
D.
8.
MODULELATEXML-MATH201Attributes:Common.
attributes,XMath.
attributes,ID.
attributesAttributerowsep=Length.
typethespacingbetweenrowsAttributecolsep=Length.
typethespacingbetweencolumnsPatternXMArraymodelContentmodelforXMArray.
Content:XMRow*Expansion:(XMRow*)ElementXMRowArowinamathalignment.
Usedby:XMArraymodel,XMArraymodelPatternXMRowattributesAttributesforXMRow.
Attributes:Common.
attributes,Backgroundable.
attributes,ID.
attributesPatternXMRowmodelContentmodelforXMRow.
Content:XMCell*Expansion:(XMCell*)ElementXMCellAcellinarowofamathalignment.
Usedby:XMRowmodel,XMRowmodelPatternXMCellattributesAttributesforXMCell.
Attributes:Common.
attributes,Backgroundable.
attributes,ID.
attributesAttributecolspan=nonNegativeIntegerindicateshowmanycolumnsthiscellspansorcovers.
Attributerowspan=nonNegativeIntegerindicateshowmanyrowsthiscellspansorcovers.
Attributealign=textspeciesthealignmentofthecontent.
Attributewidth=textspeciesthedesiredwidthforthecolumn.
Attributeborder=textrecordsasequenceoftortt,rorrr,borbbandlorllforbordersordoubledbordersonanysideofthecell.
Attributethead=(column|columnrow|row)whetherthiscellcorrespondstoatableroworcolumnheadingorbothPatternXMCellmodelContentmodelforXMCell.
Content:XMath.
class*Expansion:(XMath.
class*)202APPENDIXD.
SCHEMAD.
9ModuleLaTeXML-tabularAddtoMisc.
classThismoduledenesthebasictabular,oralignment,structure.
ItisroughlyparalleltotheHTMLmodel.
|=tabularElementtabularAnalignmentstructurecorrespondingtotabularorvarioussimilarforms.
ThemodelisbasicallyacopyofHTML4'stable.
Usedby:Misc.
class,Misc.
classPatterntabularattributesAttributesfortabular.
Attributes:Common.
attributes,Backgroundable.
attributes,ID.
attributesAttributevattach=(top|middle|bottom)whichrow'sbaselinealignswiththecontainer'sbaseline.
Attributewidth=Length.
typethedesiredwidthofthetabular.
Attributerowsep=Length.
typethespacingbetweenrowsAttributecolsep=Length.
typethespacingbetweencolumnsPatterntabularmodelContentmodelfortabular.
Content:(thead|tfoot|tbody|tr)*Expansion:((thead|tfoot|tbody|tr)*)ElementtheadAcontainerforasetofrowsthatcorrespondtotheheaderofthetabular.
Usedby:tabularmodel,tabularmodelPatterntheadattributesAttributesforthead.
Attributes:Common.
attributes,Backgroundable.
attributesPatterntheadmodelContentmodelforthead.
Content:tr*Expansion:(tr*)ElementtfootAcontainerforasetofrowsthatcorrespondtothefooterofthetabular.
Usedby:tabularmodel,tabularmodelPatterntfootattributesAttributesfortfoot.
D.
9.
MODULELATEXML-TABULAR203Attributes:Common.
attributes,Backgroundable.
attributesPatterntfootmodelContentmodelfortfoot.
Content:tr*Expansion:(tr*)ElementtbodyAcontainerforasetofrowscorrespondingtothebodyofthetabular.
Usedby:tabularmodel,tabularmodelPatterntbodyattributesAttributesfortbody.
Attributes:Common.
attributes,Backgroundable.
attributesPatterntbodymodelContentmodelfortbody.
Content:tr*Expansion:(tr*)ElementtrArowofatabular.
Usedby:MathBranchmodel,tabularmodel,tbodymodel,tfootmodel,theadmodel,MathBranchmodel,tabularmodel,tbodymodel,tfootmodel,theadmodelPatterntrattributesAttributesfortr.
Attributes:Common.
attributes,Backgroundable.
attributes,ID.
attributesPatterntrmodelContentmodelfortr.
Content:td*Expansion:(td*)ElementtdAcellinarowofatabular.
Usedby:MathBranchmodel,trmodel,MathBranchmodel,trmodelPatterntdattributesAttributesfortd.
Attributes:Common.
attributes,Backgroundable.
attributes,ID.
attributesAttributecolspan=nonNegativeIntegerindicateshowmanycolumnsthiscellspansorcovers.
Attributerowspan=nonNegativeIntegerindicateshowmanyrowsthiscellspansorcovers.
Attributealign=(left|right|center|justify|text)speciesthehorizontalalignmentofthecontent.
Theallowedvaluesareopen-endedtoaccomodatechar:.
typealignments.
204APPENDIXD.
SCHEMAAttributewidth=Length.
typespeciesthedesiredwidthforthecolumn.
Attributevattach=(top|middle|bottom)howthecellcontentsalignswiththerow'sbaseline.
Attributeborder=textrecordsasequenceoftortt,rorrr,borbbandlorllforbordersordoubledbordersonanysideofthecell.
Attributethead=(column|columnrow|row)whetherthiscellcorrespondstoatableroworcolumnheadingorboth(whetherinheadorfoot).
PatterntdmodelContentmodelfortd.
Content:Flow.
modelExpansion:(Flow.
model)D.
10ModuleLaTeXML-pictureAddtoMisc.
classThismoduledenesapictureenvironment,roughlyasubsetofSVG.
NOTE:EventuallywewilldropthesesubsetelementsandincorporateSVGitself.
|=picturePatternPicture.
classContent:(g|rect|line|circle|path|arc|wedge|ellipse|polygon|bezier|parabola|curve|dots|grid|clip|svg)Expansion:((g|rect|line|circle|path|arc|wedge|ellipse|polygon|bezier|parabola|curve|dots|grid|clip|svg))Usedby:clippathmodel,gmodel,picturemodel,clippathmodel,gmodel,picturemodelPatternPicture.
attributesTheseattributescorrespondroughlytoSVG,butneeddocumentation.
Attributex=textAttributey=textAttributer=textAttributerx=textAttributery=textAttributewidth=textAttributeheight=textD.
10.
MODULELATEXML-PICTURE205Attributell=textAttributestroke=textAttributestroke-width=textAttributestroke-dasharray=textAttributetransform=textAttributeterminators=textAttributearrowlength=textAttributepoints=textAttributeshowpoints=textAttributedisplayedpoints=textAttributearc=textAttributeangle1=textAttributeangle2=textAttributearcsepA=textAttributearcsepB=textAttributecurvature=textUsedby:arcattributes,bezierattributes,circleattributes,clipattributes,clippathattributes,curveattributes,dotsattributes,ellipseattributes,gattributes,gridattributes,lineattributes,parabolaattributes,pathattributes,pictureattributes,polygonattributes,rectattributes,wedgeattributes,arcattributes,bezierattributes,circleattributes,clipattributes,clippathattributes,curveattributes,dotsattributes,ellipseattributes,gattributes,gridattributes,lineattributes,parabolaattributes,pathattributes,pictureattributes,polygonattributes,rectattributes,wedgeattributesPatternPictureGroup.
attributesTheseattributescorrespondroughlytoSVG,butneeddocumentation.
Attributepos=textAttributeframed=booleanAttributeframetype=(rect|circle|oval)Attributellframe=booleanAttributeboxsep=textAttributeshadowbox=booleanAttributedoubleline=booleanUsedby:gattributes,gattributesElementpictureApictureenvironment.
206APPENDIXD.
SCHEMAUsedby:Misc.
class,Misc.
classPatternpictureattributesAttributesforpicture.
Attributes:Common.
attributes,ID.
attributes,Picture.
attributes,Imageable.
attributesAttributeclip=booleanAttributebaseline=textAttributeunitlength=textAttributexunitlength=textAttributeyunitlength=textAttributetex=textAttributecontent-tex=textPatternpicturemodelContentmodelforpicture.
Content:(Picture.
class|Inline.
class|Misc.
class|Meta.
class)*Expansion:((Picture.
class|Inline.
class|Misc.
class|Meta.
class)*)ElementgAgraphicalgrouping;thecontentisinheritsbythetransformations,positioningandotherproperties.
Usedby:Picture.
class,Picture.
classPatterngattributesAttributesforg.
Attributes:Common.
attributes,Picture.
attributes,PictureGroup.
attributesPatterngmodelContentmodelforg.
Content:(Picture.
class|Inline.
class|Misc.
class|Meta.
class)*Expansion:((Picture.
class|Inline.
class|Misc.
class|Meta.
class)*)ElementrectArectanglewithinapicture.
Usedby:Picture.
class,Picture.
classPatternrectattributesAttributesforrect.
Attributes:Common.
attributes,Picture.
attributesPatternrectmodelContentmodelforrect.
Content:emptyExpansion:()ElementlineAlinewithinapicture.
D.
10.
MODULELATEXML-PICTURE207Usedby:Picture.
class,Picture.
classPatternlineattributesAttributesforline.
Attributes:Common.
attributes,Picture.
attributesPatternlinemodelContentmodelforline.
Content:emptyExpansion:()ElementpolygonApolygonwithinapicture.
Usedby:Picture.
class,Picture.
classPatternpolygonattributesAttributesforpolygon.
Attributes:Common.
attributes,Picture.
attributesPatternpolygonmodelContentmodelforpolygon.
Content:emptyExpansion:()ElementwedgeAwedgewithinapicture.
Usedby:Picture.
class,Picture.
classPatternwedgeattributesAttributesforwedge.
Attributes:Common.
attributes,Picture.
attributesPatternwedgemodelContentmodelforwedge.
Content:emptyExpansion:()ElementarcAnarcwithinapicture.
Usedby:Picture.
class,Picture.
classPatternarcattributesAttributesforarc.
Attributes:Common.
attributes,Picture.
attributesPatternarcmodelContentmodelforarc.
Content:emptyExpansion:()ElementcircleAcirclewithinapicture.
Usedby:Picture.
class,Picture.
class208APPENDIXD.
SCHEMAPatterncircleattributesAttributesforcircle.
Attributes:Common.
attributes,Picture.
attributesPatterncirclemodelContentmodelforcircle.
Content:emptyExpansion:()ElementellipseAnellipsewithinapicture.
Usedby:Picture.
class,Picture.
classPatternellipseattributesAttributesforellipse.
Attributes:Common.
attributes,Picture.
attributesPatternellipsemodelContentmodelforellipse.
Content:emptyExpansion:()ElementpathApathwithinapicture.
Usedby:Picture.
class,Picture.
classPatternpathattributesAttributesforpath.
Attributes:Common.
attributes,Picture.
attributesPatternpathmodelContentmodelforpath.
Content:emptyExpansion:()ElementbezierAbeziercurvewithinapicture.
Usedby:Picture.
class,Picture.
classPatternbezierattributesAttributesforbezier.
Attributes:Common.
attributes,Picture.
attributesPatternbeziermodelContentmodelforbezier.
Content:emptyExpansion:()ElementcurveAcurvewithinapicture.
Usedby:Picture.
class,Picture.
classPatterncurveattributesAttributesforcurve.
D.
10.
MODULELATEXML-PICTURE209Attributes:Common.
attributes,Picture.
attributesPatterncurvemodelContentmodelforcurve.
Content:emptyExpansion:()ElementparabolaAparabolacurvewithinapicture.
Usedby:Picture.
class,Picture.
classPatternparabolaattributesAttributesforparabola.
Attributes:Common.
attributes,Picture.
attributesPatternparabolamodelContentmodelforparabola.
Content:emptyExpansion:()ElementdotsAsequenceofdots()withinapicture.
Usedby:Picture.
class,Picture.
classPatterndotsattributesAttributesfordots.
Attributes:Common.
attributes,Picture.
attributesAttributedotstyle=textAttributedotsize=textAttributedotscale=textPatterndotsmodelContentmodelfordots.
Content:emptyExpansion:()ElementgridAgridwithinapicture.
Usedby:Picture.
class,Picture.
classPatterngridattributesAttributesforgrid.
Attributes:Common.
attributes,Picture.
attributesPatterngridmodelContentmodelforgrid.
Content:emptyExpansion:()ElementclipEstablishesaclippingregionwithinapicture.
210APPENDIXD.
SCHEMAUsedby:Picture.
class,Picture.
classPatternclipattributesAttributesforclip.
Attributes:Common.
attributes,Picture.
attributesPatternclipmodelContentmodelforclip.
Content:clippath*Expansion:(clippath*)ElementclippathEstablishesaclippingregionwithinapicture.
Usedby:clipmodel,clipmodelPatternclippathattributesAttributesforclippath.
Attributes:Common.
attributes,Picture.
attributesPatternclippathmodelContentmodelforclippath.
Content:(Picture.
class|Inline.
class|Misc.
class|Meta.
class)*Expansion:((Picture.
class|Inline.
class|Misc.
class|Meta.
class)*)D.
11ModuleLaTeXML-structureElementdocumentThedocumentroot.
Patterndocument.
body.
classThecontentallowableasthemainbodyofthedocument.
Content:(Para.
model|paragraph|subsubsection|subsection|section|chapter|part|slide|sidebar)Expansion:((Para.
model|paragraph|subsubsection|subsection|section|chapter|part|slide|sidebar))Usedby:documentmodel,documentmodelPatterndocumentattributesAttributesfordocument.
Attributes:Sectional.
attributesPatterndocumentmodelContentmodelfordocument.
Content:(FrontMatter.
class|SectionalFrontMatter.
class|Meta.
class|titlepage)*,(document.
body.
class|BackMatter.
class)*Expansion:((FrontMatter.
class|SectionalFrontMatter.
class|Meta.
class|titlepage)*,(document.
body.
class|BackMatter.
class)*)D.
11.
MODULELATEXML-STRUCTURE211ElementpartApartwithinadocument.
Usedby:document.
body.
class,document.
body.
classPatternpart.
body.
classThecontentallowableasthemainbodyofapart.
Content:(Para.
model|subparagraph|paragraph|subsubsection|subsection|section|chapter|slide|sidebar)Expansion:((Para.
model|subparagraph|paragraph|subsubsection|subsection|section|chapter|slide|sidebar))Usedby:partmodel,partmodelPatternpartattributesAttributesforpart.
Attributes:Sectional.
attributesPatternpartmodelContentmodelforpart.
Content:SectionalFrontMatter.
class*,(part.
body.
class|BackMatter.
class)*Expansion:(SectionalFrontMatter.
class*,(part.
body.
class|BackMatter.
class)*)ElementchapterAChapterwithinadocument.
Usedby:document.
body.
class,part.
body.
class,document.
body.
class,part.
body.
classPatternchapter.
body.
classThecontentallowableasthemainbodyofachapter.
Content:(Para.
model|subparagraph|paragraph|subsubsection|subsection|section|slide|sidebar)Expansion:((Para.
model|subparagraph|paragraph|subsubsection|subsection|section|slide|sidebar))Usedby:chaptermodel,chaptermodelPatternchapterattributesAttributesforchapter.
Attributes:Sectional.
attributesPatternchaptermodelContentmodelforchapter.
Content:SectionalFrontMatter.
class*,(chapter.
body.
class|BackMatter.
class)*Expansion:(SectionalFrontMatter.
class*,(chapter.
body.
class|BackMatter.
class)*)ElementsectionASectionwithinadocument.
212APPENDIXD.
SCHEMAUsedby:appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
class,appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
classPatternsection.
body.
classThecontentallowableasthemainbodyofasection.
Content:(Para.
model|subparagraph|paragraph|subsubsection|subsection|slide|sidebar)Expansion:((Para.
model|subparagraph|paragraph|subsubsection|subsection|slide|sidebar))Usedby:sectionmodel,sectionmodelPatternsectionattributesAttributesforsection.
Attributes:Sectional.
attributesPatternsectionmodelContentmodelforsection.
Content:SectionalFrontMatter.
class*,(section.
body.
class|BackMatter.
class)*Expansion:(SectionalFrontMatter.
class*,(section.
body.
class|BackMatter.
class)*)ElementsubsectionASubsectionwithinadocument.
Usedby:appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
class,section.
body.
class,appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
class,section.
body.
classPatternsubsection.
body.
classThecontentallowableasthemainbodyofasubsection.
Content:(Para.
model|subparagraph|paragraph|subsubsection|slide|sidebar)Expansion:((Para.
model|subparagraph|paragraph|subsubsection|slide|sidebar))Usedby:subsectionmodel,subsectionmodelPatternsubsectionattributesAttributesforsubsection.
Attributes:Sectional.
attributesPatternsubsectionmodelContentmodelforsubsection.
Content:SectionalFrontMatter.
class*,(subsection.
body.
class|BackMatter.
class)*D.
11.
MODULELATEXML-STRUCTURE213Expansion:(SectionalFrontMatter.
class*,(subsection.
body.
class|BackMatter.
class)*)ElementsubsubsectionASubsubsectionwithinadocument.
Usedby:appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
class,section.
body.
class,subsection.
body.
class,appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
class,section.
body.
class,subsection.
body.
classPatternsubsubsection.
body.
classThecontentallowableasthemainbodyofasubsubsection.
Content:(Para.
model|subparagraph|paragraph|slide|sidebar)Expansion:((Para.
model|subparagraph|paragraph|slide|sidebar))Usedby:subsubsectionmodel,subsubsectionmodelPatternsubsubsectionattributesAttributesforsubsubsection.
Attributes:Sectional.
attributesPatternsubsubsectionmodelContentmodelforsubsubsection.
Content:SectionalFrontMatter.
class*,(subsubsection.
body.
class|BackMatter.
class)*Expansion:(SectionalFrontMatter.
class*,(subsubsection.
body.
class|BackMatter.
class)*)ElementparagraphAParagraphwithinadocument.
Thiscorrespondstoa'formal'marked,possiblylabelledLaTeXParagraph,indistinctionfromanunlabelledlogicalparagraph.
Usedby:appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
class,section.
body.
class,subsection.
body.
class,subsubsection.
body.
class,appendix.
body.
class,chapter.
body.
class,document.
body.
class,part.
body.
class,section.
body.
class,subsection.
body.
class,subsubsection.
body.
classPatternparagraph.
body.
classThecontentallowableasthemainbodyofaparagraph.
Content:(Para.
model|subparagraph|slide|sidebar)Expansion:((Para.
model|subparagraph|slide|sidebar))Usedby:paragraphmodel,paragraphmodelPatternparagraphattributesAttributesforparagraph.
Attributes:Sectional.
attributes214APPENDIXD.
SCHEMAPatternparagraphmodelContentmodelforparagraph.
Content:SectionalFrontMatter.
class*,(paragraph.
body.
class|BackMatter.
class)*Expansion:(SectionalFrontMatter.
class*,(paragraph.
body.
class|BackMatter.
class)*)ElementsubparagraphASubparagraphwithinadocument.
Usedby:appendix.
body.
class,chapter.
body.
class,paragraph.
body.
class,part.
body.
class,section.
body.
class,subsection.
body.
class,subsubsection.
body.
class,appendix.
body.
class,chapter.
body.
class,paragraph.
body.
class,part.
body.
class,section.
body.
class,subsection.
body.
class,subsubsection.
body.
classPatternsubparagraph.
body.
classThecontentallowableasthemainbodyofasubparagraph.
Content:(Para.
model|slide|sidebar)Expansion:((Para.
model|slide|sidebar))Usedby:subparagraphmodel,subparagraphmodelPatternsubparagraphattributesAttributesforsubparagraph.
Attributes:Sectional.
attributesPatternsubparagraphmodelContentmodelforsubparagraph.
Content:SectionalFrontMatter.
class*,(subparagraph.
body.
class|BackMatter.
class)*Expansion:(SectionalFrontMatter.
class*,(subparagraph.
body.
class|BackMatter.
class)*)ElementslideASlidewithinaslideshow.
Themodelcurrentlydoesn'tenforcethis,buttheideaisthataslideshowdocumentcancontainsectionheadings,butallrealcontentshouldbeconnedtoslides.
Usedby:appendix.
body.
class,chapter.
body.
class,document.
body.
class,paragraph.
body.
class,part.
body.
class,section.
body.
class,subparagraph.
body.
class,subsection.
body.
class,subsubsection.
body.
class,appendix.
body.
class,chapter.
body.
class,document.
body.
class,paragraph.
body.
class,part.
body.
class,section.
body.
class,subparagraph.
body.
class,subsection.
body.
class,subsubsection.
body.
classPatternslide.
body.
classThecontentallowableasthemainbodyofaslide.
Content:Para.
modelExpansion:(Para.
model)D.
11.
MODULELATEXML-STRUCTURE215Usedby:slidemodel,slidemodelPatternslideattributesAttributesforslide.
Attributes:Sectional.
attributesPatternslidemodelContentmodelforslide.
Content:SectionalFrontMatter.
class*,(slide.
body.
class|BackMatter.
class)*Expansion:(SectionalFrontMatter.
class*,(slide.
body.
class|BackMatter.
class)*)ElementsidebarASidebar;ashortsection-likeobjectthatoatsoutsidethemainow.
Usedby:appendix.
body.
class,chapter.
body.
class,document.
body.
class,paragraph.
body.
class,part.
body.
class,section.
body.
class,subparagraph.
body.
class,subsection.
body.
class,subsubsection.
body.
class,appendix.
body.
class,chapter.
body.
class,document.
body.
class,paragraph.
body.
class,part.
body.
class,section.
body.
class,subparagraph.
body.
class,subsection.
body.
class,subsubsection.
body.
classPatternsidebar.
body.
classThecontentallowableasthemainbodyofasidebar.
Content:Para.
modelExpansion:(Para.
model)Usedby:sidebarmodel,sidebarmodelPatternsidebarattributesAttributesforsidebar.
Attributes:Sectional.
attributesPatternsidebarmodelContentmodelforsidebar.
Content:(FrontMatter.
class|SectionalFrontMatter.
class)*,(sidebar.
body.
class|BackMatter.
class)*Expansion:((FrontMatter.
class|SectionalFrontMatter.
class)*,(sidebar.
body.
class|BackMatter.
class)*)ElementappendixAnAppendixwithinadocument.
Usedby:BackMatter.
class,BackMatter.
classPatternappendix.
body.
classThecontentallowableasthemainbodyofachapter.
Content:(Para.
model|subparagraph|paragraph|subsubsection|subsection|section|slide|sidebar)216APPENDIXD.
SCHEMAExpansion:((Para.
model|subparagraph|paragraph|subsubsection|subsection|section|slide|sidebar))Usedby:appendixmodel,appendixmodelPatternappendixattributesAttributesforappendix.
Attributes:Sectional.
attributesPatternappendixmodelContentmodelforappendix.
Content:SectionalFrontMatter.
class*,appendix.
body.
class*Expansion:(SectionalFrontMatter.
class*,appendix.
body.
class*)ElementbibliographyABibliographywithinadocument.
Usedby:BackMatter.
class,BackMatter.
classPatternbibliography.
body.
classThecontentallowableasthemainbodyofachapter.
Content:(Para.
model|biblist)Expansion:((Para.
model|biblist))Usedby:bibliographymodel,bibliographymodelPatternbibliographyattributesAttributesforbibliography.
Attributes:Sectional.
attributes,Listing.
attributesAttributeles=textthelistofbiblesusedtocreatethebibliography.
Attributebibstyle=textthebibliographicstyletobeusedtoformatthebibliography(presumablyaBibTeXbstlename)Attributecitestyle=textthecitationstyletobeusedwhencitingitemsfromthebibliographyAttributesort=booleanwhetherthebibliographicitemsshouldbesortedorinorderofcitation.
PatternbibliographymodelContentmodelforbibliography.
Content:FrontMatter.
class*,SectionalFrontMatter.
class*,bibliography.
body.
class*Expansion:(FrontMatter.
class*,SectionalFrontMatter.
class*,bibliography.
body.
class*)ElementindexAnIndexwithinadocument.
Usedby:BackMatter.
class,BackMatter.
classD.
11.
MODULELATEXML-STRUCTURE217Patternindex.
body.
classThecontentallowableasthemainbodyofachapter.
Content:(Para.
model|indexlist)Expansion:((Para.
model|indexlist))Usedby:indexmodel,indexmodelPatternindexattributesAttributesforindex.
Attributes:Sectional.
attributes,Listing.
attributesAttributerole=textThekindofindex(obsolete)PatternindexmodelContentmodelforindex.
Content:SectionalFrontMatter.
class*,index.
body.
class*Expansion:(SectionalFrontMatter.
class*,index.
body.
class*)ElementindexlistAheirarchicalindexstructuretypicallygeneratedduringpostprocessingfromthecollectionofindexmarkinthedocument(ordocumentcollection).
Usedby:index.
body.
class,indexentrymodel,index.
body.
class,indexentrymodelPatternindexlistattributesAttributesforindexlist.
Attributes:Common.
attributes,ID.
attributesPatternindexlistmodelContentmodelforindexlist.
Content:indexentry*Expansion:(indexentry*)ElementindexentryAnentryinanindexlistconsistingofaphrase,referencestopointsinthedocumentwherethephrasewasfound,andpossiblyanestedindexlistrepresentedindexlevelsbelowthisone.
Usedby:indexlistmodel,indexlistmodelPatternindexentryattributesAttributesforindexentry.
Attributes:Common.
attributes,ID.
attributesPatternindexentrymodelContentmodelforindexentry.
Content:indexphrase,indexrefs,indexlistExpansion:(indexphrase,indexrefs,indexlist)ElementindexrefsAcontainerforthereferences(ref)towhereanindexphrasewasencounteredinthedocument.
ThemodelisInlinetoallowarbitrarytext,inadditiontotheexpectedref's.
218APPENDIXD.
SCHEMAUsedby:glossaryentrymodel,indexentrymodel,glossaryentrymodel,indexentrymodelPatternindexrefsattributesAttributesforindexrefs.
Attributes:Common.
attributesPatternindexrefsmodelContentmodelforindexrefs.
Content:Inline.
modelExpansion:(Inline.
model)ElementglossaryAnGlossarywithinadocument.
Usedby:BackMatter.
class,BackMatter.
classPatternglossary.
body.
classThecontentallowableasthemainbodyofachapter.
Content:(Para.
model|glossarylist)Expansion:((Para.
model|glossarylist))Usedby:glossarymodel,glossarymodelPatternglossaryattributesAttributesforglossary.
Attributes:Sectional.
attributes,Listing.
attributesAttributerole=textThekindofglossaryPatternglossarymodelContentmodelforglossary.
Content:SectionalFrontMatter.
class*,glossary.
body.
class*Expansion:(SectionalFrontMatter.
class*,glossary.
body.
class*)ElementglossarylistAglossarylisttypicallygeneratedduringpostprocessingfromthecollectionofglossaryphrase'sinthedocument(ordocumentcollection).
Usedby:glossary.
body.
class,glossary.
body.
classPatternglossarylistattributesAttributesforglossarylist.
Attributes:Common.
attributes,ID.
attributesPatternglossarylistmodelContentmodelforglossarylist.
Themodelallowslooseglossaryphrase'sfordatadenitions,buttheyarenotdisplayedaspartofthelist.
Content:glossaryentry*Expansion:(glossaryentry*)D.
11.
MODULELATEXML-STRUCTURE219ElementglossaryentryAnentryinanglossarylistconsistingofaphrase,(oneormore,presumablyinincreasingdetail),possiblyadenition,andreferencestopointsinthedocumentwherethephrasewasfound.
Usedby:glossarylistmodel,glossarylistmodelPatternglossaryentryattributesAttributesforglossaryentry.
Attributes:Common.
attributes,ID.
attributesAttributerole=textThekindofglossaryAttributekey=textaattenedformofthephraseforgeneratinganID.
PatternglossaryentrymodelContentmodelforglossaryentry.
Content:glossaryphrase*,indexrefsExpansion:(glossaryphrase*,indexrefs)ElementtitleThetitleofadocument,sectionorsimilardocumentstructurecontainer.
Usedby:SectionalFrontMatter.
class,TOCmodel,proofmodel,theoremmodel,SectionalFrontMatter.
class,TOCmodel,proofmodel,theoremmodelPatterntitleattributesAttributesfortitle.
Attributes:Common.
attributes,Fontable.
attributes,Colorable.
attributes,Backgroundable.
attributesPatterntitlemodelContentmodelfortitle,basicallyInline.
modelwithtagincluded(normally,butnotnecessarily,tagwouldcomerst).
Content:(tag|text|Inline.
class|Misc.
class|Meta.
class)*Expansion:((tag|text|Inline.
class|Misc.
class|Meta.
class)*)ElementtoctitleTheshortformofatitle,foruseintablesofcontentsorsimilar.
Usedby:SectionalFrontMatter.
class,SectionalFrontMatter.
classPatterntoctitleattributesAttributesfortoctitle.
Attributes:Common.
attributesPatterntoctitlemodelContentmodelfortoctitle.
Content:(tag|text|Inline.
class|Misc.
class|Meta.
class)*Expansion:((tag|text|Inline.
class|Misc.
class|Meta.
class)*)220APPENDIXD.
SCHEMAElementsubtitleAsubtitle,orsecondarytitle.
Usedby:FrontMatter.
class,FrontMatter.
classPatternsubtitleattributesAttributesforsubtitle.
Attributes:Common.
attributesPatternsubtitlemodelContentmodelforsubtitle.
Content:Inline.
modelExpansion:(Inline.
model)ElementcreatorGeneralizeddocumentcreator.
Usedby:SectionalFrontMatter.
class,SectionalFrontMatter.
classPatternPerson.
classThecontentallowedinauthors,editors,etc.
Content:(personname|contact)Expansion:((personname|contact))Usedby:creatormodel,creatormodelPatterncreatorattributesAttributesforcreator.
Attributes:Common.
attributes,FrontMatter.
attributesAttributerole=(author|editor|translator|contributor|translator|text)indicatestheroleofthepersonincreatingthedocment.
Commonlyusefulvaluesarespecied,butisopen-endedtosupportextension.
Attributebefore=textspeciesopeningtexttodisplaybeforethiscreatorinaformattedtitlepage.
Thiswouldbetypicallyappearoutsidetheauthorinformation,like"and".
Attributeafter=textspeciesclosingtext,punctuationorconjunctiontodisplayafterthiscreatorinaformattedtitlepage.
PatterncreatormodelContentmodelforcreator.
Content:(Person.
class|Misc.
class)*Expansion:((Person.
class|Misc.
class)*)ElementpersonnameAperson'sname.
Usedby:Person.
class,Person.
classPatternpersonnameattributesAttributesforpersonname.
D.
11.
MODULELATEXML-STRUCTURE221Attributes:Common.
attributes,Refable.
attributesPatternpersonnamemodelContentmodelforpersonname.
Content:Inline.
modelExpansion:(Inline.
model)ElementcontactGeneralizedcontactinformationforadocumentcreator.
Notethatthiselementcanberepeatedtogivedifferenttypesofcontactinformation(usingrole)forthesamecreator.
Usedby:Person.
class,Person.
classPatterncontactattributesAttributesforcontact.
Attributes:Common.
attributes,FrontMatter.
attributes,Refable.
attributesAttributerole=(affiliation|address|currentaddress|email|url|thanks|dedicatory|text)indicatesthetypeofcontactinformationcontained.
Commonlyusefulvaluesarespecied,butisopen-endedtosupportextension.
PatterncontactmodelContentmodelforcontact.
Content:Inline.
modelExpansion:(Inline.
model)ElementdateGeneralizeddocumentdate.
Notethatthiselementcanberepeatedtogivethedatesofdifferentevents(usingrole)forthesamedocument.
Usedby:FrontMatter.
class,FrontMatter.
classPatterndateattributesAttributesfordate.
Attributes:Common.
attributes,FrontMatter.
attributesAttributerole=(creation|conversion|posted|received|revised|accepted|text)indicatestherelevanceofthedatetothedocument.
Commonlyusefulvaluesarespecied,butisopen-endedtosupportextension.
PatterndatemodelContentmodelfordate.
Content:Inline.
modelExpansion:(Inline.
model)ElementabstractAdocumentabstract.
Usedby:FrontMatter.
class,FrontMatter.
classPatternabstractattributesAttributesforabstract.
222APPENDIXD.
SCHEMAAttributes:Common.
attributes,FrontMatter.
attributesPatternabstractmodelContentmodelforabstract.
Content:Block.
modelExpansion:(Block.
model)ElementacknowledgementsAcknowledgementsforthedocument.
Usedby:BackMatter.
class,FrontMatter.
class,BackMatter.
class,FrontMatter.
classPatternacknowledgementsattributesAttributesforacknowledgements.
Attributes:Common.
attributes,FrontMatter.
attributesPatternacknowledgementsmodelContentmodelforacknowledgements.
Content:Inline.
modelExpansion:(Inline.
model)ElementkeywordsKeywordsforthedocument.
Thecontentisfreeform.
Usedby:FrontMatter.
class,FrontMatter.
classPatternkeywordsattributesAttributesforkeywords.
Attributes:Common.
attributes,FrontMatter.
attributesPatternkeywordsmodelContentmodelforkeywords.
Content:Inline.
modelExpansion:(Inline.
model)ElementclassicationAclassicationofthedocument.
Usedby:FrontMatter.
class,FrontMatter.
classPatternclassicationattributesAttributesforclassication.
Attributes:Common.
attributes,FrontMatter.
attributesAttributescheme=textindicateswhatclassicationschemewasused.
PatternclassicationmodelContentmodelforclassication.
Content:Inline.
modelExpansion:(Inline.
model)ElementtitlepageblockofrandomstuffmarkedasatitlepageUsedby:documentmodel,documentmodelD.
11.
MODULELATEXML-STRUCTURE223PatterntitlepageattributesAttributesfortitlepage.
Attributes:Sectional.
attributesPatterntitlepagemodelContentmodelfortitlepage.
Content:(FrontMatter.
class|SectionalFrontMatter.
class|Block.
class)*Expansion:((FrontMatter.
class|SectionalFrontMatter.
class|Block.
class)*)ElementTOC(Generalized)TableOfContents,representstableofcontentsaswellaslistofgures,tables,andothersuchthings.
Thiswillgenerallybeplacedbya\tableofcontentscommandandlledinbypostprocessing.
Usedby:Para.
class,navigationmodel,Para.
class,navigationmodelPatternTOCattributesAttributesforTOC.
Attributes:Common.
attributes,FrontMatter.
attributesAttributelists=textindicatesthekindoflists;spaceseparatednamesoflistslike"toc","lof",etc.
Attributeselect=textindicateswhatkindofdocumentelementstolist,intheformofoneormoretagssuchasltx:chapterseparatedby|(suggestiveofanxpathexpression).
Attributescope=(current|global|text)indicatesthescopesetofelementstoinclude:current(default)isallincurrentdocument;globalindicatesallinthedocumentset;otherwiseanxml:idAttributeshow=textindicateswhatthingstoshowineachentryAttributeformat=(normal|short|veryshort|text)indicateshowtoformatthelistingPatternTOCmodelContentmodelforTOC.
Content:title,toclistExpansion:(title,toclist)ElementtoclistTheactualtableofcontentslist,lledin.
Usedby:TOCmodel,tocentrymodel,TOCmodel,tocentrymodelPatterntoclistattributesAttributesfortoclist.
224APPENDIXD.
SCHEMAAttributes:Common.
attributesPatterntoclistmodelContentmodelfortoclist.
Content:tocentry*Expansion:(tocentry*)ElementtocentryAnentryinatoclist.
Usedby:toclistmodel,toclistmodelPatterntocentryattributesAttributesfortocentry.
Attributes:Common.
attributesPatterntocentrymodelContentmodelfortocentry.
Content:(ref|toclist)*Expansion:((ref|toclist)*)PatternSectional.
attributesAttributessharedbyallsectionalelementsAttributes:Common.
attributes,Labelled.
attributes,Backgroundable.
attributesAttributerdf-prexes=textStoresRDFaprexesasspaceseparatedpairs,withthepairsbeingprexandurlseparatedbyacolon;thisshouldonlyappearattherootelement.
Usedby:appendixattributes,bibliographyattributes,chapterattributes,documentattributes,glossaryattributes,indexattributes,paragraphattributes,partattributes,sectionattributes,sidebarattributes,slideattributes,subparagraphattributes,subsectionattributes,subsubsectionattributes,titlepageattributes,appendixattributes,bibliographyattributes,chapterattributes,documentattributes,glossaryattributes,indexattributes,paragraphattributes,partattributes,sectionattributes,sidebarattributes,slideattributes,subparagraphattributes,subsectionattributes,subsubsectionattributes,titlepageattributesPatternFrontMatter.
attributesAttributesforotherelementsthatcanbeusedinfrontmatter.
Attributename=textRecordsthenameofthetypeofobjectthisistobeusedwhencomposingthepresentation.
Thevalueofthisattributeisoftensetbylanguagelocalizationpackages.
D.
11.
MODULELATEXML-STRUCTURE225Usedby:TOCattributes,abstractattributes,acknowledgementsattributes,classicationattributes,contactattributes,creatorattributes,dateattributes,keywordsattributes,TOCattributes,abstractattributes,acknowledgementsattributes,classicationattributes,contactattributes,creatorattributes,dateattributes,keywordsattributesPatternSectionalFrontMatter.
classThecontentallowedforthefrontmatterofeachsectionalunit,andthedocument.
Content:(tags|title|toctitle|creator)Expansion:((tags|title|toctitle|creator))Usedby:appendixmodel,bibliographymodel,chaptermodel,documentmodel,glossarymodel,indexmodel,paragraphmodel,partmodel,sectionmodel,sidebarmodel,slidemodel,subparagraphmodel,subsectionmodel,subsubsectionmodel,titlepagemodel,appendixmodel,bibliographymodel,chaptermodel,documentmodel,glossarymodel,indexmodel,paragraphmodel,partmodel,sectionmodel,sidebarmodel,slidemodel,subparagraphmodel,subsectionmodel,subsubsectionmodel,titlepagemodelPatternFrontMatter.
classThecontentallowed(inadditiontoSectionalFrontMatter.
class)forthefrontmatterofadocument.
Content:(subtitle|date|abstract|acknowledgements|keywords|classication)Expansion:((subtitle|date|abstract|acknowledgements|keywords|classication))Usedby:bibliographymodel,documentmodel,sidebarmodel,titlepagemodel,bibliographymodel,documentmodel,sidebarmodel,titlepagemodelPatternBackMatter.
classThecontentallowedatheendofadocument.
NotethatthisincludesrandomtrailingBlockandParamaterial,tosupportarticleswithguresandsimilardataappearing'atend'.
Content:(bibliography|appendix|index|glossary|acknowledgements|Para.
class|Meta.
class)Expansion:((bibliography|appendix|index|glossary|acknowledgements|Para.
class|Meta.
class))Usedby:chaptermodel,documentmodel,paragraphmodel,partmodel,sectionmodel,sidebarmodel,slidemodel,subparagraphmodel,subsectionmodel,subsubsectionmodel,chaptermodel,documentmodel,paragraphmodel,partmodel,226APPENDIXD.
SCHEMAsectionmodel,sidebarmodel,slidemodel,subparagraphmodel,subsectionmodel,subsubsectionmodelAddtoPara.
class|=TOCD.
12ModuleLaTeXML-bibElementbiblistAlistofbibliographicbibentryorbibitem.
Usedby:bibliography.
body.
class,bibliography.
body.
classPatternbiblistattributesAttributesforbiblist.
Attributes:Common.
attributesPatternbiblistmodelContentmodelforbiblist.
Content:(bibentry|bibitem)*Expansion:((bibentry|bibitem)*)ElementbibitemAformattedbibliographicitem,typicallyaswrittenexplicitinaLaTeXarticle.
ThishasgenerallylostmostofthesemanticspresentintheBibTeXdata.
Usedby:biblistmodel,biblistmodelPatternbibitemattributesAttributesforbibitem.
Attributes:Common.
attributes,ID.
attributesAttributekey=textTheuniquekeyforthisobject;thiskeyisreferencedbythebibrefsattributeofbibref.
PatternbibitemmodelContentmodelforbibitem.
Content:tags,bibblock*Expansion:(tags,bibblock*)ElementbibblockAblockofdataappearingwithinabibitem.
Usedby:bibitemmodel,bibitemmodelPatternbibblockattributesAttributesforbibblock.
Attributes:emptyPatternbibblockmodelContentmodelforbibblock.
Content:Flow.
modelD.
12.
MODULELATEXML-BIB227Expansion:(Flow.
model)ElementbibentrySemanticrepresentationofabibliographyentry,typicallyresultingfromparsingBibTeXUsedby:biblistmodel,biblistmodelPatternbibentry.
typeContent:(article|book|booklet|conference|inbook|incollection|inproceedings|manual|mastersthesis|misc|phdthesis|proceedings|techreport|unpublished|report|thesis|website|software|periodical|collection|collection.
article|proceedings.
article|text)Expansion:((article|book|booklet|conference|inbook|incollection|inproceedings|manual|mastersthesis|misc|phdthesis|proceedings|techreport|unpublished|report|thesis|website|software|periodical|collection|collection.
article|proceedings.
article|text))Usedby:bib-relatedattributes,bibentryattributes,bib-relatedattributes,bibentryattributesPatternbibentryattributesAttributesforbibentry.
Attributes:Common.
attributes,ID.
attributesAttributekey=textTheuniquekeyforthisobject;thiskeyisreferencedbythebibrefsattributeofbibref.
Attributetype=bibentry.
typeThetypeofthereferencedobject.
ThevaluesareasupersetofthosetypesrecognizedbyBibTeX,butisalsoopen-endedforextensibility.
PatternbibentrymodelContentmodelforbibentry.
Content:Bibentry.
class*Expansion:(Bibentry.
class*)Elementbib-nameNameofsomeparticipantincreatingabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-nameattributesAttributesforbib-name.
Attributes:Common.
attributesAttributerole=(author|editor|translator|text)Therolethatthisparticipantplayedincreatingtheentry.
228APPENDIXD.
SCHEMAPatternbib-namemodelContentmodelforbib-name.
Content:Bibname.
modelExpansion:(Bibname.
model)PatternBibname.
modelThecontentmodelofthebibliographicnameelds(bib-name)Content:surname,givenname,lineageExpansion:(surname,givenname,lineage)Usedby:bib-namemodel,bib-namemodelElementsurnameSurnameofaparticipant(bib-name).
Usedby:Bibname.
model,Bibname.
modelPatternsurnameattributesAttributesforsurname.
Attributes:emptyPatternsurnamemodelContentmodelforsurname.
Content:Inline.
modelExpansion:(Inline.
model)ElementgivennameGivennameofaparticipant(bib-name).
Usedby:Bibname.
model,Bibname.
modelPatterngivennameattributesAttributesforgivenname.
Attributes:emptyPatterngivennamemodelContentmodelforgivenname.
Content:Inline.
modelExpansion:(Inline.
model)ElementlineageLineageofaparticipant(bib-name),eg.
Jr.
orsimilar.
Usedby:Bibname.
model,Bibname.
modelPatternlineageattributesAttributesforlineage.
Attributes:emptyPatternlineagemodelContentmodelforlineage.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-titleTitleofabibliographicentry.
D.
12.
MODULELATEXML-BIB229Usedby:Bibentry.
class,Bibentry.
classPatternbib-titleattributesAttributesforbib-title.
Attributes:Common.
attributesPatternbib-titlemodelContentmodelforbib-title.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-subtitleSubtitleofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-subtitleattributesAttributesforbib-subtitle.
Attributes:Common.
attributesPatternbib-subtitlemodelContentmodelforbib-subtitle.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-keyUniquekeyofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-keyattributesAttributesforbib-key.
Attributes:Common.
attributesPatternbib-keymodelContentmodelforbib-key.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-typeTypeofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-typeattributesAttributesforbib-type.
Attributes:Common.
attributesPatternbib-typemodelContentmodelforbib-type.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-dateDateofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
class230APPENDIXD.
SCHEMAPatternbib-dateattributesAttributesforbib-date.
Attributes:Common.
attributesAttributerole=(publication|copyright|text)characterizeswhathappenedonthegivendatePatternbib-datemodelContentmodelforbib-date.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-publisherPublisherofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-publisherattributesAttributesforbib-publisher.
Attributes:Common.
attributesPatternbib-publishermodelContentmodelforbib-publisher.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-organizationOrganizationresponsibleforabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-organizationattributesAttributesforbib-organization.
Attributes:Common.
attributesPatternbib-organizationmodelContentmodelforbib-organization.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-placeLocationofpublisheroreventUsedby:Bibentry.
class,Bibentry.
classPatternbib-placeattributesAttributesforbib-place.
Attributes:Common.
attributesPatternbib-placemodelContentmodelforbib-place.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-relatedARelatedbibliographicobject,suchasthebookorjournalthatthecurrentitemisrelatedto.
D.
12.
MODULELATEXML-BIB231Usedby:Bibentry.
class,Bibentry.
classPatternbib-relatedattributesAttributesforbib-related.
Attributes:Common.
attributesAttributetype=bibentry.
typeThetypeofthisrelatedentry.
Attributerole=(host|event|original|text)Howthisobjectrelatestothecontainingobject.
Particularlyimportantishostwhichindicatesthattheouterobjectisapartofthisobject.
Attributebibrefs=textIfthebibrefsattributeisgiven,itisthekeyofanotherobjectinthebibliography,andthiselementshouldbeempty;otherwisetheobjectshouldbedescribedbythecontentoftheelement.
Patternbib-relatedmodelContentmodelforbib-related.
Content:Bibentry.
class*Expansion:(Bibentry.
class*)Elementbib-partDescribeshowthecurrentobjectisrelatedtoarelated(bib-related)object,inparticularpage,part,volumenumbersandsimilar.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-partattributesAttributesforbib-part.
Attributes:Common.
attributesAttributerole=(pages|part|volume|issue|number|chapter|section|paragraph|text)indicateshowthevaluepartitionsthecontainingobject.
Patternbib-partmodelContentmodelforbib-part.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-editionEditionofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-editionattributesAttributesforbib-edition.
Attributes:Common.
attributesPatternbib-editionmodelContentmodelforbib-edition.
Content:Inline.
modelExpansion:(Inline.
model)232APPENDIXD.
SCHEMAElementbib-statusStatusofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-statusattributesAttributesforbib-status.
Attributes:Common.
attributesPatternbib-statusmodelContentmodelforbib-status.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-identierSomeformofdocumentidenter.
Thecontentisdescriptive.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-identierattributesAttributesforbib-identier.
Attributes:Common.
attributes,Refable.
attributesAttributescheme=(doi|issn|isbn|mr|text)indicateswhatsortofidentieritis;itisopen-endedforextensibility.
Attributeid=texttheidentier.
Patternbib-identiermodelContentmodelforbib-identier.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-reviewReviewofabibliographicentry.
Thecontentisdescriptive.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-reviewattributesAttributesforbib-review.
Attributes:Common.
attributes,Refable.
attributesAttributescheme=(doi|issn|isbn|mr|text)indicateswhatsortofidentieritis;itisopen-endedforextensibility.
Attributeid=texttheidentier.
Patternbib-reviewmodelContentmodelforbib-review.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-linksLinkstootherthingslikepreprints,sourcecode,etc.
D.
12.
MODULELATEXML-BIB233Usedby:Bibentry.
class,Bibentry.
classPatternbib-linksattributesAttributesforbib-links.
Attributes:Common.
attributesPatternbib-linksmodelContentmodelforbib-links.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-languageLanguageofabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-languageattributesAttributesforbib-language.
Attributes:Common.
attributesPatternbib-languagemodelContentmodelforbib-language.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-urlAURLforabibliographicentry.
ThecontentisdescriptiveUsedby:Bibentry.
class,Bibentry.
classPatternbib-urlattributesAttributesforbib-url.
Attributes:Common.
attributes,Refable.
attributesPatternbib-urlmodelContentmodelforbib-url.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-extractAnextractfromthereferencedobject.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-extractattributesAttributesforbib-extract.
Attributes:Common.
attributesAttributerole=(keywords|abstract|contents|text)ClassifywhatkindofextractPatternbib-extractmodelContentmodelforbib-extract.
Content:Inline.
modelExpansion:(Inline.
model)234APPENDIXD.
SCHEMAElementbib-noteNotesaboutabibliographicentry.
Usedby:Bibentry.
class,Bibentry.
classPatternbib-noteattributesAttributesforbib-note.
Attributes:Common.
attributesAttributerole=(annotation|publication|text)ClassifythekindofnotePatternbib-notemodelContentmodelforbib-note.
Content:Inline.
modelExpansion:(Inline.
model)Elementbib-dataRandomdata,notnecessarilyeventext.
(futurequestions:shouldmodelbetextorANYmaybeshouldhaveencodingattribute).
Usedby:Bibentry.
class,Bibentry.
classPatternbib-dataattributesAttributesforbib-data.
Attributes:Common.
attributesAttributerole=textClassifytherelationshipofthedatatotheentry.
Attributetype=textClassifythetypeofthedata.
Patternbib-datamodelContentmodelforbib-data.
Content:Inline.
modelExpansion:(Inline.
model)PatternBibentry.
classContent:(bib-name|bib-title|bib-subtitle|bib-key|bib-type|bib-date|bib-publisher|bib-organization|bib-place|bib-part|bib-related|bib-edition|bib-status|bib-language|bib-url|bib-note|bib-extract|bib-identier|bib-review|bib-links|bib-data)Expansion:((bib-name|bib-title|bib-subtitle|bib-key|bib-type|bib-date|bib-publisher|bib-organization|bib-place|bib-part|bib-related|bib-edition|bib-status|bib-language|bib-url|bib-note|bib-extract|bib-identier|bib-review|bib-links|bib-data))Usedby:bib-relatedmodel,bibentrymodel,bib-relatedmodel,bibentrymodelAppendixEErrorCodesWarningandErrormessagesareprintedtoSTDERRduringtheexecutionoflatexmlandlatexmlpost.
AswithTEX,itisnotalwayspossibletoindicatewheretherealunderyingmistakeoriginated;sometimesitisonlyrealizedlateronthatsomeproblemhasoccurred,suchasamissingbrace.
Moreover,whereaserrormessagesfromTEXmaybesafelyassumedtoindicateerrorswiththesourcedocument,withLATEXMLtheymayalsoindicateLATEXML'sinabilitytogureoutwhatyouwanted,orsimplybugsinLATEXMLorthelibrarysituses.
Warningsaregenerallyinformativethatthegeneratedresultmaynotbeasgoodasitcanbe,butismostlikelyproperlyformed.
Atypicalwarningisthatthemathparserfailedtorecognizeanexpression.
Errorsgenerallyindicateamoreseriousproblemthatislikelytoleadtoamalformedresult.
Atypicalerrorwouldbeanundenedcontrolsequence.
Generally,pro-cessingcontinuessothatyoucan(hopefully)solveallerrorsatonce.
Fatalsareerrorssoseriousastomakeitunlikelythatprocessingcancontinue;thesystemislikelytobeout-of-sync,forexamplenotknowingfromwhichpointintheinputtocontinuereading.
Afatalerrorisalsogeneratedwhentoomany(typically100regularerrorshavebeenencountered.
WarningandErrormessagesareslightlystructuredtoallowunattendedprocess-ingofdocumentstoclassifythedegreeofsuccessinprocessing.
Atypicalmessagesatisesthefollowingregularexpression:severity:category:objectsummarysourcelocatordescription.
.
.
stacktracethesecondandfollowinglinesareindentedusingatab.
severityOneofInfo,Warn,ErrororFatal,indicatingtheseverityoftheprob-lem;235236APPENDIXE.
ERRORCODEScategoryclassiestheerrororwarningintoanopen-endedsetofcategoriesindicatingwhethersomethingwasexpected,orundefined;objectindicatestheoffendingobject;whatlenamewasmissing,orwhichtokenwasundened;summarygivesabriefreadablesummaryofthecondition;sourcelocatorindicateswhereinthesourcedocumenttheerroroccurred;descriptiongivesoneormorelinesofmoredetailedinformation;stacktraceoptionallygivesabrieforlongtraceofthecurrentexecutionstack.
Thetypeisfollowedbyoneormorekeywordsseparatedbycolons,thenaspace,andahumanreadableerrormessage.
Generally,thislineisfollowedbyoneormorelinesdescribingwhereinthesourcedocumenttheerroroccured(orwasdetected).
Forexample:Error:undefined:\fooThecontrolsequence\fooisundefined.
Someofthemorecommonkeywordsfollowingthemessagetypearelistedbelow,whereweassumethatargisthesecondkeyword(ifany).
ThefollowingerrorsaregenerallyduetomalformedTEXinput,incompleteLATEXMLbindings,orbindingsthatdonotproperlyaccountforthewayTEX,orthemacros,areactuallyused.
undefined:Theoperationindicatedbyarg,typicallyacontrolsequenceorotheroperation,isundened.
ignore:Indicatesthatargisbeingignored;typicallyitisaduplicateddenition,oradenitionofsomethingthatcannotberedened.
expected:Aparticulartoken,orothertypeofdataobject,indicatedbyarg,wasexpectedintheinputbutwasmissing.
unexpected:argwasnotexpectedtoappearintheinput.
notparsed:Amathematicalformulacouldnotbesuccessfullyparsed.
missingfile:theleargcouldnotbefound.
latex:AnerrorormessagegeneratedfromLATEXcode.
andthecorrespondingLATEXMLcodeshouldbeupdated.
toomanyerrors:Toomanynon-fatalerrorswereencountered,causingaFatalerrorandprogramtermination.
ThefollowingerrorsaremorelikelytobeduetoprogrammingerrorsintheLATEXMLcore,orinbindingles,orinthedocumentmodel.
misdefined:Theoperationindicatedbyarg,typicallyacontrolsequenceorotheroperation,hasnotbeendenedproperly.
237deprecated:Indicatesthatargisadeprecatedusage.
malformed:Thedocumentismalformed,orwillbemadesobyinsertargintoit.
I/O:someproblemwithinput/outputofthelearg,suchasitnotbeingreadable.
Theexacterrorisreportedintheadditionaldetails.
perl:Aperl-levelerrororwarning,notspecicallyrecognizedbyLaTeXML,wasencountered.
argwilltypicallydie,interruptorwarn.
internal:Somethingunexpectedhappened;mostlikeyaninternalcodingerrorwithinLATEXML.
238APPENDIXE.
ERRORCODESAppendixFCSSClassesWhenthetargetformatisintheHTMLfamily(XHTML,HTMLorHTML5),LATEXMLaddsvariousclassestothegeneratedhtmlelements.
Thisprovidesatrailbacktotheoriginatingmarkup,andleveragetoapplyCSSstylingtotheresults.
Recallthattheclassattributeisaspace-separatedlistofclassnames.
Thisappendixdescribestheclassnamesused.
Thebasicstrategyisthefollowing:ltxelementwithelementbeingtheLATEXMLelementnamethatgeneratedthehtmlelement.
TheseelementsreecttheoriginalTEX/LATEXmarkup,butarenotiden-tical.
SeeAppendixDfordetails.
ltxfontfontwherefontcanindicateanyofthefontcharacteristics:family:serif,sansserif,typewriter,caligraphic,fraktur,script;series:bold,medium;shape:upright,italic,slanted,smallcaps;Thesesetsareopen-ended.
ltxalignalignmentwherealignmentindicatesthealignmentofthecontentswithintheelement.
horizontally:left,right,center,justify;vertically:top,bottom,baseline,middle.
ltxborderedgesindicatessingleordoublebordersonanelementwithedgesbe-ing:t,r,b,l,tt,rr,bb,ll;thesearetypicallyusedfortablecells.
ltxrolerolereectsthedistinctusesaparticularLATEXMLelementsservewhichisindicatedbytheroleattribute.
Examplesincludecreator,for'documentcreators',wheretherolemaybeauthor,editor,translatororothers.
Thus,dependingonyourpurposesandtheexpectedmarkup,youmightchoose239240APPENDIXF.
CSSCLASSEStowriteCSSrulesforltxcreatororltxroleauthor.
Similarly,quoteisstretchedtoaccomodatetranslationorverse.
ltxtitlesectionmarksthetitlesofvarioussectionalunits.
Forexample,achap-ter'stitlewillhavetwoclasses:ltxtitleandltxtitlechapter.
ltxtheoremtypemarksvarioustypesof'theorem-like'objects,wherethetypeiswhateverwasusedin\newtheorem.
ltxfloattypemarksvarioustypesofoatingobjects,suchasmightbedenedusingthefloatpackageusing\newfloat.
ltxlstrolereectsthevariousrolesofitemswithinlistings,suchasthosecre-atedusingthelistingspackage(whosecontainingelementwouldhaveclassltxlstlisting).
Suchclassesinclude:ltxlstlanguagelang,ltxlstkeywordclass,ltxlxtline,ltxlstlinenum.
ltxbibitemindicatesvariousitemsinbibliographys,typicallygeneratedviaBIBTEX;theitemsincludekey,number,type,author,editor,year,title,author-year,edition,series,part,journal,volume,number,status,pages,language,publisher,place,status,crossref,external,citedandothers.
ltxtoclisttype,ltxtocentrytypereectsthelevelsofTableofContentslists:theycarrytheltxtoclistclass,fromtheelementusedtorepresentthem,andalsoltxtoclistsectionnamingthesectionalunitforwhichthislistappliestoassistinstyling.
AnestedTOCforachaptermightthushaveul'scarryingltxtoclistchapterandltxtoclistsection.
Addition-ally,ltxtoccompactandltxtocverycompactcanbeaddedtostylecompactandverycompactstyles(egsingleline).
Notethatthegeneratedliitemswillhaveclassltxtocentryandltxtocentrytype,forthetypeoftheentry.
ltxrefitemhypertextlinks,whetherwithinoracrossdocuments,whethercreatedfrom\refor\href,willgetltxrefand,sometimes,extraclassesap-plied.
Forexample,areferencethatendsuppointingtothecurrentpageismarkedwithltxrefself.
Cross-referencingmaterialusedtoll-inthecon-tentsofthereferenceismarked:areferencenumbergetsltxreftag;atitleltxreftitle.
ltxnotepartreectstheseparatepartsofnotes;Notethatthekindofnoteisgen-erallyreectedintheroleattribute,suchasfootnote,endnote,etc.
Thepartsareseparatedtofacilitateformatting,hovereffects,etc:outercontainsthewhole;markforthemark,ifany;contenttheactualcontentsofthenote.
typeisforanextraspanindicatingthetypeofnoteifitisunusual.
ltxpageitemreectspagelayoutcomponentscreatedduringtheXSLT;itemsinclude:main,content,header,footer,navbarlogo,columns,column1,column2.
241ltxeqnitemreectsdifferentpartsrelatedtoequationformatting:padreectspaddingtoalignequationsonthepage;eqnarrayandlefteqnarisefromLATEX'seqnarrayenvironment;gatherandalignarisefromAMSenvi-ronments;intertextarisesfromtextinjectedbetweenalignedequations.
AnyotherexplicituseoftheaddClass(class)functionorofthe\lxAddClass{class}macrofromthelatexmlpackagewilladdthegivenclassasis,withoutanyadditionalltxprex.
Twooddballitemsthatmaygetrefactoredawayare:ltxphantomandltxcentering.
Thelatterseemsslightlydistinctfromltxaligncenter.
242APPENDIXF.
CSSCLASSESIndexaboutattribute,173aboutidrefattribute,173aboutlabelrefattribute,173abstractelement,221acknowledgementselement,222afterattribute,220alignattribute,171,201,203Alignment(LaTeXML::Core::)module,143Description,143anchorelement,177angleattribute,172angle1attribute,205angle2attribute,205ANYattribute,187appendixelement,215appendix.
body.
classschemapattern,215arcattribute,205element,207arcsepAattribute,205arcsepBattribute,205arrowlengthattribute,205AssignCatcode,95AssignMapping,95AssignValue,94AtBeginDocument,87Backgroundable.
attributesschemapattern,170backgroundcolorattribute,170BackMatter.
classschemapattern,225Balanced,74BalancedParen,74baselineattribute,206beforeattribute,220bezierelement,208bib-dataelement,234bib-dateelement,229bib-editionelement,231bib-extractelement,233bib-identierelement,232bib-key243244INDEXelement,229bib-languageelement,233bib-linkselement,232bib-nameelement,227bib-noteelement,234bib-organizationelement,230bib-partelement,231bib-placeelement,230bib-publisherelement,230bib-relatedelement,230bib-reviewelement,232bib-statuselement,232bib-subtitleelement,229bib-titleelement,228bib-typeelement,229bib-urlelement,233bibblockelement,226bibentryelement,227Bibentry.
classschemapattern,234bibentry.
typeschemapattern,227bibitemelement,226bibliographyelement,216bibliography.
body.
classschemapattern,216biblistelement,226Bibname.
modelschemapattern,228bibrefelement,178bibrefphraseelement,178bibrefsattribute,178,231bibstyleattribute,216BibTeX(LaTeXML::Pre::)module,156BibEntryobjects,156CreatingaBibTeX,156Description,156Methods,156blockelement,181Block.
classschemapattern,163Block.
modelschemapattern,162borderattribute,201,204Box(LaTeXML::)architecture,16Box(LaTeXML::Core::)module,140ExportedFunctions,140Methods,141boxsepattribute,205breakelement,186candidatesattribute,187captionelement,195Caption.
classschemapattern,193chapterelement,211chapter.
body.
classschemapattern,211INDEX245CharDef(LaTeXML::Core::Definition::)module,149Description,149circleelement,207citeelement,178citestyleattribute,216classattribute,165classicationelement,222CleanID,97CleanIndexKey,97CleanLabel,97CleanURL,97clipattribute,206element,209clippathelement,210closeattribute,185,188cmy(LaTeXML::Common::Color::)module,116cmyk(LaTeXML::Common::Color::)module,116colorattribute,170Color(LaTeXML::Common::)module,115Exportedfunctions,115Methods,115Seealso,116Color.
typeschemapattern,165Colorable.
attributesschemapattern,170colsepattribute,201,202colspanattribute,201,203Comment(LaTeXML::Core::)module,141Description,141Common.
attributesschemapattern,165Conditional(LaTeXML::Core::Definition::)module,149Description,149Config(LaTeXML::Common::)module,99Daemon,ServerandClientOp-tions,113Description,100FormatOptions,107GeneralOptions,104GraphicsOptions,112MathOptions,111Methods,100OPTIONSYNOPSIS,101Options&Arguments,104Site&CrossreferencingOptions,109SourceOptions,105SYNPOSIS,99TeXConversionOptions,106constraintelement,179Constructor(LaTeXML::)architecture,17Constructor(LaTeXML::Core::Definition::)module,149Description,149MoreaboutConstructors,150contactelement,221contentattribute,174content-texattribute,196,206CounterValue,88creatorelement,220cssstyleattribute,165curvatureattribute,205curveelement,208246INDEXdataattribute,174Data.
attributesschemapattern,174dataencodingattribute,174datamimetypeattribute,174datatypeattribute,174dateelement,221declidattribute,197declareelement,188DeclareOption,87DefColumnType,93DefConditional,76DefConditionalI,76DefConstructor,79DefConstructorI,81DefEnvironment,82DefEnvironmentI,84deniensattribute,188Definition(LaTeXML::)architecture,16Definition(LaTeXML::Core::)module,148Description,148Methods,148Seealso,149DefLigature,91DefMacro,75DefMacroI,76DefMath,81DefMathI,82DefMathLigature,91DefMathRewrite,91DefParameterType,93DefPrimitive,77DefPrimitiveI,78DefRegister,78DefRegisterI,78DefRewrite,91delelement,175depthattribute,171Derived(LaTeXML::Common::Color::)module,117Synopsis,117descriptionattribute,173element,183Digest,92Digested,74Dimension,74Dimension(LaTeXML::Common::)module,118Exportedfunctions,118displayedpointsattribute,205DocType,90documentelement,210Document(LaTeXML::)architecture,17Document(LaTeXML::Core::)module,131Accessors,132ConstructionMethods,133Description,131DocumentModication,136InternalInsertionMethods,135document.
body.
classschemapattern,210dotselement,209dotscaleattribute,209dotsizeattribute,209dotstyleattribute,209doublelineattribute,205DTD(LaTeXML::Common::Model::)module,121ellipseINDEX247element,208emphelement,175encloseattribute,197enumerateelement,182equationelement,180equationgroupelement,180EquationMeta.
classschemapattern,179ERRORelement,191Error(LaTeXML::Common::)module,121Description,121ErrorReporting,122InternalFunctions,122ExecuteOptions,87Expand,92Expandable(LaTeXML::)architecture,16Expandable(LaTeXML::Core::Definition::)module,150Description,150gureelement,193lesattribute,216llattribute,205llframeattribute,205FindFile,84oatattribute,171element,194Float(LaTeXML::Common::)module,118Exportedfunctions,118Flow.
modelschemapattern,162fontattribute,169Font(LaTeXML::Common::)module,119Description,119Methods,119Fontable.
attributesschemapattern,169fontsizeattribute,170formatattribute,181,223fragidattribute,167framecolorattribute,172framedattribute,172,205frametypeattribute,205FrontMatter.
attributesschemapattern,224FrontMatter.
classschemapattern,225gelement,206GenerateID,88givennameelement,228Global(LaTeXML::)module,70Description,71Globalstate,71Synopsis,70glossaryelement,218glossary.
body.
classschemapattern,218glossarydenitionelement,190glossaryentryelement,219glossarylistelement,218glossaryphraseelement,190248INDEXglossaryrefelement,176Glue,74Glue(LaTeXML::Common::)module,119Exportedfunctions,119graphicattribute,187graphicselement,186gray(LaTeXML::Common::Color::)module,116gridelement,209Gullet(LaTeXML::)architecture,16Gullet(LaTeXML::Core::)module,126Description,127High-levelmethods,128Low-levelmethods,127ManagingInput,127Mid-levelmethods,128heightattribute,171,204hiddenattribute,180hrefattribute,169,197hsb(LaTeXML::Common::Color::)module,116idattribute,232ID.
attributesschemapattern,167idrefattribute,168IDREF.
attributesschemapattern,168IfCondition,76Imageable.
attributesschemapattern,172imagedepthattribute,173imageheightattribute,173imagesrcattribute,173imagewidthattribute,173indexelement,216index.
body.
classschemapattern,217indexentryelement,217indexlistelement,217indexmarkelement,189indexphraseelement,189indexrefselement,217indexseeelement,189inline-blockelement,186inline-descriptionelement,184inline-enumerateelement,184inline-itemelement,184inline-itemizeelement,183inline-paraelement,192Inline.
classschemapattern,163Inline.
modelschemapattern,161inlistattribute,168innerdepthattribute,172innerheightattribute,172innerwidthattribute,172INDEX249Input,85InputContent,84InputDefinitions,85InstallDefinition,95Invocation,92itemelement,183itemizeelement,182itemsepattribute,183keyattribute,176,189,190,219,226,227KeyVals(LaTeXML::Core::)module,143Accessors,143Changingcontainedvalues,145Constructors,143Description,143KeyValsAccessors,146KeyValsAccessors(intendedforinternalusage),144Parsingvaluesfromagullet,146ResolutiontoKeySets,145ValueRelatedReversion,146Keyword,74keywordselement,222Labelled.
attributesschemapattern,168labelrefattribute,169labelsattribute,169LaTeXMLarchitecture,15LaTeXMLmodule,69Description,69INTERNALROUTINES,70Methods,69Synopsis,69latexmlbasicusage,6latexmlcommand,51Options&Arguments,52Seealso,54Synopsis,51latexmlmathbasicusage,13latexmlmathcommand,62BUGS,66ConversionOptions,63Inputnotes,63Options&Arguments,63OtherOptions,64Seealso,66Synopsis,62latexmlpostbasicusage,7sitebuilding,11splitpages,11latexmlpostcommand,54FormatOptions,56GeneralOptions,56GraphicsOptions,61MathOptions,60Options&Arguments,56Seealso,62Site&CrossreferencingOptions,58SourceOptions,56Synopsis,54Length.
typeschemapattern,164Let,93lexemesattribute,196lineelement,206lineageelement,228List(LaTeXML::)architecture,16List(LaTeXML::Core::)module,141250INDEXListable.
attributesschemapattern,168listingelement,182Listing.
attributesschemapattern,168listinglineelement,182listsattribute,168,223LoadClass,86LoadPool,87LookupCatcode,95LookupDefinition,95LookupMapping,94LookupMeaning,95LookupValue,94lpaddingattribute,197markattribute,188Match,74Mathelement,196Math.
classschemapattern,195MathBranchelement,181MathForkelement,181MathML(LaTeXML::Post::)module,157ContentConversionUtilties,159DefMathML($key,$presentation,$content);,157Description,157MathProcessors,Generally.
,160PresentationConversionUtilties,158Synopsis,157MathParser(LaTeXML::)architecture,17MathParser(LaTeXML::)module,97Conveniencefunctions,98Description,97MathRepresentation,98PossibileCustomizations,98mathstyleattribute,198meaningattribute,197mediaattribute,191MergeFont,95Meta.
classschemapattern,164Misc.
classschemapattern,163modeattribute,196Model(LaTeXML::)architecture,17Model(LaTeXML::Common::)module,120Description,120DocumentType,120ModelCreation,120Modelqueries,121Namespaces,120Seealso,121Mouth(LaTeXML::)architecture,16Mouth(LaTeXML::Core::)module,126CreatingMouths,126Description,126Methods,126MuDimension(LaTeXML::Core::)module,147Exportedfunctions,147MuGlue,74MuGlue(LaTeXML::Core::)module,147Exportedfunctions,147nameattribute,190,197,224navigationelement,191NewCounter,88INDEX251noteelement,188Number,74Number(LaTeXML::Common::)module,117Exportedfunctions,117Methods,117Object(LaTeXML::Common::)module,113Description,113Genericfunctions,114Methods,114omcdattribute,197opacityattribute,170openattribute,185,188optionsattribute,187pelement,179Pack(LaTeXML::Util::)module,155Description,155Methods,155Package(LaTeXML::)module,71AccesstoState,94ArgumentReaders,93ClassandPackages,86Color,96CommonOptions,75Conditionals,76Constructors,79ControlSequences,72CountersandIDs,88Description,72DocumentModel,89DocumentRewriting,91Environments,82Fonts,95InputingContentandDenitions,84Low-levelFunctions,97Macros,75Mid-Levelsupport,92Primitives,77Prototypes,73Registers,78Seealso,97Synopsis,71paginationelement,185Pair(LaTeXML::Core::)module,147Description,147Exportedfunctions,147PairList(LaTeXML::Core::)module,147Description,148Exportedfunctions,148paraelement,192Para.
classschemapattern,164Para.
modelschemapattern,162parabolaelement,209paragraphelement,213paragraph.
body.
classschemapattern,213Parameter(LaTeXML::Core::)module,151Description,151Seealso,151Parameters(LaTeXML::Core::)module,151Description,151Methods,152Seealso,152partelement,211part.
body.
classschemapattern,211PassOptions,87pathelement,208252INDEXPathname(LaTeXML::Util::)module,152Description,152FileSystemOperations,154PathnameManipulations,152Person.
classschemapattern,220personnameelement,220pictureelement,205Picture.
attributesschemapattern,204Picture.
classschemapattern,204PictureGroup.
attributesschemapattern,205placementattribute,194Plain,74pointsattribute,205polygonelement,207PopValue,94posattribute,205Positionable.
attributesschemapattern,171possibleFunctionattribute,197Post(LaTeXML::)architecture,18Post(LaTeXML::)module,157Description,157prexattribute,173Primitive(LaTeXML::)architecture,16Primitive(LaTeXML::Core::Definition::)module,150Description,150ProcessOptions,87proofelement,193propertyattribute,174PushValue,94quoteelement,181rattribute,204rawhtmlelement,187rawliteralelement,188RawTeX,92rdfelement,190rdf-prexesattribute,224RDF.
attributesschemapattern,173ReadParameters,93rectelement,206refelement,177Refable.
attributesschemapattern,169RefStepCounter,88RefStepID,88Register(LaTeXML::Core::Definition::)module,150Description,151Methods,151RegisterDocumentNamespace,90RegisterNamespace,90relattribute,174RelaxNG(LaTeXML::Common::Model::)module,121RelaxNGSchema,90RequirePackage,86ResetCounter,88resourceattribute,173element,191resourceidrefINDEX253attribute,174resourcelabelrefattribute,174revattribute,174Rewrite(LaTeXML::)architecture,17Rewrite(LaTeXML::Core::)module,138Description,138rgb(LaTeXML::Common::Color::)module,116roleattribute,181,185,188,190,194,196,217–221,227,230,231,233,234Roman,97roman,97rowsepattribute,180,201,202rowspanattribute,201,203rpaddingattribute,197ruleattribute,200element,176rxattribute,204ryattribute,204schemeattribute,222,232scopeattribute,223scriptposattribute,197sectionelement,211section.
body.
classschemapattern,212Sectional.
attributesschemapattern,224SectionalFrontMatter.
classschemapattern,225Seealso,97seealsoattribute,189selectattribute,223Semiverbatim,74separatorattribute,178shadowboxattribute,205ShiftValue,94showattribute,176–178,223showpointsattribute,205sidebarelement,215sidebar.
body.
classschemapattern,215Skip1Space,75SkipSpaces,75slideelement,214slide.
body.
classschemapattern,214sortattribute,216sortkeyattribute,189srcattribute,191State(LaTeXML::Core::)module,123AccesstoStateandProcessing,123CategoryCodes,125Denitions,125Description,123NamedScopes,125Scoping,123Values,124StepCounter,88Stomach(LaTeXML::)architecture,16Stomach(LaTeXML::Core::)module,129254INDEXDescription,129Digestion,130Grouping,130Modes,131stretchyattribute,198strokeattribute,205stroke-dasharrayattribute,205stroke-widthattribute,205styleattribute,189,200subelement,176subparagraphelement,214subparagraph.
body.
classschemapattern,214subsectionelement,212subsection.
body.
classschemapattern,212subsubsectionelement,213subsubsection.
body.
classschemapattern,213subtitleelement,220supelement,176surnameelement,228svgschemapattern,187tableelement,194tabularelement,202Tag,89tagelement,185tagselement,184tbodyelement,203tdelement,203terminatorsattribute,205texattribute,196,206textattribute,196element,175tfootelement,202theadattribute,201,204element,202theoremelement,193thicknessattribute,198titleattribute,176,177element,219titlepageelement,222TOCelement,223toccaptionelement,195tocentryelement,224toclistelement,223toctitleelement,219Token,74Token(LaTeXML::)architecture,16Token(LaTeXML::Core::)module,138Exportedfunctions,139Methods,139Tokens(LaTeXML::)architecture,16Tokens(LaTeXML::Core::)module,140INDEX255Exportedfunctions,140Tokensmethods,140trelement,203transformattribute,205Transformable.
attributesschemapattern,172typeattribute,188,191,227,231,234typeofattribute,174Undigested,74unitlengthattribute,206UnshiftValue,94Until,74UntilBrace,74UTF,97Variable,75vattachattribute,171,202,204verbatimelement,186vocabattribute,173wedgeelement,207Whatsit(LaTeXML::)architecture,16Whatsit(LaTeXML::Core::)module,141Description,142Methods,142widthattribute,171,201,202,204WWW(LaTeXML::Util::)module,154Description,155Methods,155Synopsis,154xattribute,204xhtml:*element,187XMAppelement,198XMArgelement,200XMArrayelement,200XMathelement,197XMath.
attributesschemapattern,196XMath.
classschemapattern,196XMCellelement,201XMDualelement,199XMHintelement,199xml:idattribute,167xml:langattribute,165XMRefelement,200XMRowelement,201XMTextelement,199XMTokelement,198XMWrapelement,199xoffsetattribute,171xscaleattribute,172XToken,74xtranslateattribute,172xunitlengthattribute,206XUntil,74256INDEXyattribute,204yoffsetattribute,171yscaleattribute,172ytranslateattribute,172yunitlengthattribute,206yyseparatorattribute,178

PQS彼得巧 年中低至38折提供台湾彰化HiNet线路VPS主机 200M带宽

在六月初的时候有介绍过一次来自中国台湾的PQS彼得巧商家(在这里)。商家的特点是有提供台湾彰化HiNet线路VPS主机,起步带宽200M,从带宽速率看是不错的,不过价格也比较贵原价需要300多一个月,是不是很贵?当然懂的人可能会有需要。这次年中促销期间,商家也有提供一定的优惠。比如月付七折,年付达到38折,不过年付价格确实总价格比较高的。第一、商家优惠活动年付三八折优惠:PQS2021-618-C...

旅途云(¥48 / 月),雅安高防4核4G、洛阳BGP 2核2G

公司成立于2007年,是国内领先的互联网业务平台服务提供商。公司专注为用户提供低价高性能云计算产品,致力于云计算应用的易用性开发,并引导云计算在国内普及。目前,旅途云公司研发以及运营云服务基础设施服务平台(IaaS),面向全球客户提供基于云计算的IT解决方案与客户服务,拥有丰富的国内BGP、双线高防、香港等优质的IDC资源。点击进入:旅途云官方网商家LOGO优惠方案:CPU内存硬盘带宽/流量/防御...

触碰云高性价20.8元/月,香港云服务器,美国cn2/香港cn2线路,4核4G15M仅115.2元/月起

触碰云怎么样?触碰云是一家成立于2019年的商家。触碰云主营香港/美国 VPS服务器、独立服务器以及免备案CDN。采用的是kvm虚拟构架,硬盘Raid10,Cn2线路,去程电信CN2、移动联通直连,回程三网CN2。最低1核1G带宽1M仅20.8元/月,不过这里推荐香港4核4G15M,香港cn2 gia线路云服务器,仅115.2元/月起,性价比还是不错的。点击进入:触碰云官方网站地址触碰云优惠码:优...

mathplayer为你推荐
西部妈妈网烟台分类妈妈网 分类妈妈网的前2个字什么?同ip网站查询服务器禁PING 是不是就可以解决同IP网站查询问题www.e12.com.cn有什么好的高中学习网?www.gegeshe.com有什么好听的流行歌曲partnersonline我家Internet Explorer为什么开不起来www.toutoulu.com外链方案到底应该怎么弄呢www.147.qqq.comWWW147EEE.COM这个网站现在改哪个网址了hao.rising.cnIE主页被瑞星绑架http://hao.rising.cn//?b=84主页明明设置的是百度但打开后是瑞星导航,dpscycleDPScycle插件为什么没有猎人模块 最好详细点鹤城勿扰非诚勿扰 怀化小伙 杨荣是哪一期
net主机 阿里云os 博客主机 双11抢红包攻略 2017年黑色星期五 NetSpeeder 警告本网站 中国智能物流骨干网 怎么测试下载速度 徐正曦 免费活动 网购分享 我的世界服务器ip 什么是web服务器 游戏服务器出租 php服务器 国外网页代理 腾讯网盘 阵亡将士纪念日 带宽测试 更多