XLaTeX, a DTD/Schema Which is Very Close to LaTeX
TUG has kindly provided a discussion list for XLaTeX. To subscribe please visit page http://tug.org/mailman/listinfo/xlatex. You can also contact the author of XLaTeX at the address Yannis period Haralambous at enst dash bretagne period fr.
The namespace of XLaTeX v. 0.9, is http://omega.enstb.org/2003/xlatex.
The version of XLaTeX described below is 0.9.0 (March 21, 2005).
Global Attributes
XML attribute xml:lang is defined by the XML Specification and can be used with any XLaTeX element, to specify its language. There must be a section in the XLaTeX configuration file xlatex.conf giving the correspondance between babel options and xml:lang values.
XML attribute xmlid is an attribute of type ID as defined in the XML Specification (its value has to be a unique XML name). It can be used in any XLaTeX element and produces a \label command. Note that there is also a <label> element which produces the same LaTeX command but is not bound to type ID constraints.
XML attribute xmlref is an attribute of type IDREF as defined in the XML Specification (its value has to be taken by an attribute of type ID). It can be used in any XLaTeX element and produces a \ref command. Note that there is also a <ref> element which produces the same LaTeX command but is not bound to type IDREF constraints.
Global Document Structure
XML element <xlatex> is the root of any XLaTeX document. It takes one attribute:
- Attribute version (mandatory) giving the version of XLaTeX needed to process the document.
XML element <document> produces LaTeX environment document and if used with an class attribute, then also LaTeX command \documentclass. It takes two attributes:
- Attribute class the argument of \documentclass command;
- Attribute options the \documentclass options.
Note that when attribute class is not used, then a separate element <documentclass> is needed in the document.
XML element <documentclass> produces LaTeX command \documentclass. It is an empty elements and takes two attributes:
- Attribute name (mandatory) the argument of \documentclass command;
- Attribute options the \documentclass options.
Note that this element is not necessary if the <document> element is used with a class attribute.
XML element <usepackage> produces LaTeX command \usepackage. It is an empty element and takes two attributes:
- Attribute name (mandatory) the argument of \usepackage command;
- Attribute options the \usepackage options.
Note that this element must be placed between <documentclass> and <document> when the former is present, but can be used after <document> when used with a class attribute.
Title
XML element <maketitle> produces LaTeX command \maketitle. It is an empty element.
XML element <author> produces LaTeX command \author.
XML element <thanks> produces LaTeX command \affiliation.
XML element <and> produces LaTeX command \and. It is an empty element.
XML element <date> produces LaTeX command \date.
XML element <today> produces LaTeX command \today. It is an empty element.
XML element <title> produces LaTeX command \title.
Sectionning
XML element <chapter> produces LaTeX command \chapter. It takes two attributes:
- Attribute star producing the starred version of \chapter command. This argument takes value yes (actually any non-empty value will do);
- Attribute short producing the optional argument of \chapter command, that is the "short version" of the chapter title used in the table of contents and running heads.
XML element <section> produces LaTeX command \section. It takes two attributes:
- Attribute star producing the starred version of \section command. This argument takes value yes (actually any non-empty value will do);
- Attribute short producing the optional argument of \section command, that is the "short version" of the section title used in the table of contents and running heads.
XML element <subsection> produces LaTeX command \subsection. It takes two attributes:
- Attribute star producing the starred version of \subsection command. This argument takes value yes (actually any non-empty value will do);
- Attribute short producing the optional argument of \subsection command, that is the "short version" of the subsection title used in the table of contents and running heads.
XML element <subsubsection> produces LaTeX command \subsubsection. It takes two attributes:
- Attribute star producing the starred version of \subsubsection command. This argument takes value yes (actually any non-empty value will do);
- Attribute short producing the optional argument of \subsubsection command, that is the "short version" of the subsubsection title used in the table of contents and running heads.
XML element <paragraph> produces LaTeX command \paragraph. It takes two attributes:
- Attribute star producing the starred version of \paragraph command. This argument takes value yes (actually any non-empty value will do);
- Attribute short producing the optional argument of \paragraph command, that is the "short version" of the paragraph title used in the table of contents and running heads.
XML element <subparagraph> produces LaTeX command \subparagraph. It takes two attributes:
- Attribute star producing the starred version of \subparagraph command. This argument takes value yes (actually any non-empty value will do);
- Attribute short producing the optional argument of \subparagraph command, that is the "short version" of the subparagraph title used in the table of contents and running heads.
XML element <part> produces LaTeX command \part. It takes two attributes:
- Attribute star producing the starred version of \part command. This argument takes value yes (actually any non-empty value will do);
- Attribute short producing the optional argument of \part command, that is the "short version" of the part title used in the table of contents and running heads.
XML element <tableofcontents> produces LaTeX command \tableofcontents. It is an empty element.
Language
XML element <selectlanguage> produces LaTeX command \selectlanguage. It takes one attribute:
- Attribute name the argument of \selectlanguage command.
Note that one can also specify the language of any XLaTeX element by the global xml:lang attribute. In that case there must be a section in the XLaTeX configuration file xlatex.conf giving the correspondance between babel options and xml:lang values. In case one wants to change the language without using any specific XLaTeX element, there is also element <span> which, as in XHTML, is only used to carry attributes.
Text Blocks
XML element <span> produces no specific LaTeX command. It can carry global attributes such as xml:lang.
XML element <center> produces LaTeX environment center.
XML element <quotation> produces LaTeX environment quotation.
XML element <quote> produces LaTeX environment quote.
XML element <itemize> produces LaTeX environment itemize. It takes only <item> sub-elements.
XML element <enumerate> produces LaTeX environment enumerate. It takes only <item> sub-elements.
XML element <item> produces LaTeX command \item. It takes one attribute:
- Attribute mark producing the optional argument of \item.
Footnotes
XML element <footnote> produces LaTeX command \footnote. It takes one attribute:
- Attribute number to produce the optional argument of \footnote as in \footnote[2]{blabla}.
XML element <footnotemark> produces LaTeX command \footnotemark. It is an empty element and takes one attribute:
- Attribute number to produce the optional argument of \footnotemark as in \footnotemark[2].
XML element <footnotetext> produces LaTeX command \footnotetext. It takes one attribute:
- Attribute number to produce the optional argument of \footnotetext as in \footnotetext[2]{blabla}.
Microtypography
XML element <emph> produces LaTeX command \emph. Note that you can also use element <em> as in XHTML.
XML element <em> produces LaTeX command \emph. Note that you can also use element <emph> as in LaTeX.
XML element <textbf> produces LaTeX command \textbf. Note that you can also use element <b> as in XHTML.
Element <b>
XML element <b> produces LaTeX command \textbf. Note that you can also use element <textbf> as in LaTeX.
XML element <textit> produces LaTeX command \textit. Note that you can also use element <i> as in XHTML.
Element <i>
XML element <i> produces LaTeX command \textit. Note that you can also use element <textit> as in LaTeX.
XML element <textsf> produces LaTeX command \textsf.
XML element <texttt> produces LaTeX command \texttt. Note that you can also use element <tt> as in XHTML.
XML element <tt> produces LaTeX command \texttt. Note that you can also use element <texttt> as in LaTeX.
Cross References
XML element <label> produces LaTeX command \label. It is an empty element and takes one attribute:
- Attribute id the argument of \label command.
Note that the id is, despite its name, of type CDATA and not ID. There is the global attribute xmlid for those who wish ID type constraints.
XML element <ref> produces LaTeX command \ref. It is an empty element and takes one attribute:
- Attribute id the argument of \ref command;
- Attribute type providing the type of reference: for example, if type="page" then the command we obtain is \pageref rather than \ref.
Note that the id is, despite its name, of type CDATA and not ID or IDREF. There is the global attribute xmlref for those who wish IDREF type constraints. Note also that there is a <pageref> element producing the same results as <ref type="page">.
XML element <pageref> produces LaTeX command \pageref. It is an empty element and takes one attribute:
- Attribute id the argument of \pageref command.
Note that the id is, despite its name, of type CDATA and not ID or IDREF. There is the global attribute xmlref for those who wish IDREF type constraints.
Tables
XML element <tabular> produces LaTeX environment tabular. It takes three attributes:
- Attribute star producing the starred version of tabular environment. This argument takes value yes (actually any non-empty value will do);
- Attribute width producing the first argument of the starred version of tabular environment;
- Attribute format producing the format argument of the tabular environment. Inside the format the usual LaTeX syntax is used, for example: <tabular format="@{}|>{\bfseries}p{.5\textwidth}|@{}">;
- Attribute align producing the optional argument of tabular environment.
Inside <tabular> one uses <tab> elements to separate cells (instead of & used in LaTeX), <br> to change line (instead of \\ in LaTeX), <hline> to obtain an horizontal rule, <cline> to obtain a partial horizontal rule, <multicolumn> to obtain a multi-column cell, <multirow> to obtain a multi-row cell. Note that package array is systematically loaded and package multirow whenever a <multirow> element is used.
XML element <tab> produces an & in LaTeX. It is an empty element.
XML element <br> produces LaTeX command \\ whether in the context of a tabular environment or in a regular paragraph. It takes three attributes:
- Attribute opt producing the optional argument of \\ command;
- Attribute hline producing one or more \hline commands (the value of the attribute gives the number of \hline commands: <br hline="2"/> will produce \\\hline\hline);
- Attribute cline producing one or more \cline commands (the value of the attribute becomes argument of \cline commands, if there are more than one command needed, separate the arguments by commas: <br cline="1-3,5-7"/> will produce \\\cline{1-3}\cline{5-7}).
XML element <hline> produces LaTeX command \hline. It is an empty element.
XML element <cline> produces LaTeX command \cline. It takes one attribute:
- Attribute cells producing the argument of \cline command.
XML element <vline> produces LaTeX command \vline. It is an empty element.
XML element <multicolumn> produces LaTeX command \multicolumn. It takes two attributes:
- Attribute number producing the first argument of \multicolumn command (the number of cells);
- Attribute format producing the second argument of \multicolumn command (the format of the multi-cell);
The contents of <multicolumn> produce the third argument of \multicolumn (the contents of the cell).
XML element <multirow> produces LaTeX command \multicolumn. It takes two attributes:
- Attribute number producing the first argument of \multicolumn command (the number of lines);
- Attribute format producing the second argument of \multicolumn command (the format of the multi-cell);
The contents of <multirow> produce the third argument of \multirow (the contents of the cell). Note that the presence of <multirow> in the document automatically applied loading of the multirow package.
Processing Instructions and Related Elements
Processing Instruction <?tex ?>
XML PI <?tex ?> inserts unchanged TeX code into the document. No protection is necessary but the string ?> must be avoided. Note that the <tex> element can be used as well. Note that <?tex ?> and <?TeX ?> are distinct elements.
XML element <tex> inserts unchanged TeX code into the document. It is necessary to protect XML special characters: write < for <, > for >, & for &.
Processing Instruction <?math ?>
XML PI <?math ?> inserts unchanged TeX code into the document, enclosed in dollars. No protection is necessary but the string ?> must be avoided. Note that the <math> element can be used as well.
XML element <math> inserts unchanged TeX code into the document, enclosed in dollars. It is necessary to protect XML special characters: write < for <, > for >, & for &.
XML PI <?displaymath ?> inserts unchanged TeX code into the document, enclosed in double dollars. No protection is necessary but the string ?> must be avoided. Note that the <displaymath> element can be used as well.
XML element <displaymath> inserts unchanged TeX code into the document, enclosed in double dollars. It is necessary to protect XML special characters: write < for <, > for >, & for &.
XML PI <?special ?> inserts unchanged TeX code into the document, as argument of a \special command. No protection is necessary but the string ?> must be avoided. Note that the <special> element can be used as well.
XML element <special> inserts unchanged TeX code into the document, as argument of a \special command. It is necessary to protect XML special characters: write < for <, > for >, & for &.
Processing Instruction <?verb ?>
XML PI <?verb ?> has the same effect as using the \verb command. No protection is necessary but the string ?> must be avoided. The <verb> element can be used as well.
XML element <verb> has the same effect as using the \verb command. It is necessary to protect XML special characters: write < for <, > for >, & for &.
XML PI <?verbstar ?> has the same effect as using the \verb* command. No protection is necessary but the string ?> must be avoided. The <verbstar> element can be used as well.
XML element <verbstar> has the same effect as using the \verb* command. It is necessary to protect XML special characters: write < for <, > for >, & for &.
XML PI <?verbatim ?> inserts unchanged TeX code into the document, as contents of a verbatim environment. No protection is necessary but the string ?> must be avoided. The <verbatim> element can be used as well.
XML element <verbatim> inserts unchanged TeX code into the document, as contents of a verbatim environment. It is necessary to protect XML special characters: write < for <, > for >, & for &.
Graphics
XML element <includegraphics> produces LaTeX command \includegraphics. It is an empty element and takes seven attributes:
- Attribute star producing the starred version of \chapter command. This argument takes value yes (actually any non-empty value will do);
- Attribute bbox producing the two optional arguments of \includegraphics command containing the bounding box coordinates (example: <includegraphics bbox="115 327 477 800" src="toto.eps"/> will produce \includegraphics[115,327][477,800]{toto.eps}). Nevertheless if the standard bounding box of the EPS file is used (and the file is either in the current directory or its access path is given) then there is no need to provide bbox values since the parser will extract them from the file;
- Attribute src producing the mandatory argument of \includegraphics command (the file name);
- Attribute scale producing LaTeX command \scalebox (the value of the attribute becomes the command's first argument);
- Attribute rotate producing LaTeX command \rotatebox (the value of the attribute becomes the command's first argument);
- Attribute resizex producing LaTeX command \resizebox (the value of the attribute becomes the command's first argument);
- Attribute resizey producing LaTeX command \resizebox (the value of the attribute becomes the command's second argument);
- Attribute reflect producing LaTeX command \resizebox (the value of the attribute becomes the command's second argument).
Note that when combined, the LaTeX commands resulting from scale, rotate, resize(x|y) and reflect are produced in the order: reflect{rotate{scale{resize}}}. Note that there are also elements <scalebox>, <rotatebox>, <resizebox>, <reflectbox> producing the same results.
XML element <scalebox> produces LaTeX command \scalebox. It takes two attributes:
- Attribute amount producing the first argument of \scalebox command;
- Attribute amountY producing the optional argument of \scalebox command (vertical scale factor).
XML element <rotatebox> produces LaTeX command \rotatebox. It takes one attribute:
- Attribute amount producing the first argument of \rotatebox command.
XML element <resizebox> produces LaTeX command \resizebox. It takes two attributes:
- Attribute x producing the first argument of \resizebox command;
- Attribute y producing the second argument of \resizebox command.
Note that if one of these attributes is ommited, the value ! is produced in the LaTeX code.
XML element <reflectbox> produces LaTeX command \reflectbox.
Floats
XML element <figure> produces LaTeX environment figure. It takes one attribute:
- Attribute pos producing the argument of figure environment.
XML element <table> produces LaTeX environment table. It takes one attribute:
- Attribute pos producing the argument of table environment.
XML element <caption> produces LaTeX command \caption. It takes one attribute:
- Attribute short producing the optional argument of \caption command.
Multiple Columns
XML element <multicols> produces LaTeX environment multicols (the <multicol> package is automatically loaded). It takes one attribute:
- Attribute number producing the argument of multicols environment (the number of columns).
XML element <onecolumn> produces LaTeX command \onecolumn.
XML element <twocolumn> produces LaTeX command \twocolumn.
Miscellanea
XML element <TeX> produces TeX command \TeX. It is an empty element. Note that <?tex ?> and <?TeX ?> are distinct elements.
XML element <LaTeX> produces LaTeX command \LaTeX. It is an empty element.
XML element <XLaTeX> produces XLaTeX command \XLaTeX. It is an empty element.
XML element <MF> produces TeX command \MF. It is an empty element.
Index
XML element <index> produces LaTeX command \index. It takes three attributes:
- Attribute id producing the argument of \index command;
- Attribute sort producing the sorting key of the argument of \index command;
- Attribute name giving the name of the index file. When this attribute is used in the document then the package multind is automatically loaded.
The <index> element can be used in three ways:
- empty with attribute: <index id="horse"/> will produce \index{horse};
- non-empty without attribute: <index>horses<index> will produce \index{horses}horses;
- non-empty with attribute: <index id="horse">horses<index> will produce \index{horse}horses.
The sort attribute is used to enter sorting keys: <index id="π" sort="pi"/> will produce \index{pi@π}. To obtain sub-entries one uses the usual ! syntax: <index id="France!Finistère!Brest"/>. Note that sorting keys for sub-entries are given in the sort attribute and shuffled automatically: <index sort="alpha!beta!gamma" id="α!β!γ"/> will produce \index{alpha@α!beta@β!gamma@γ}, as required by makeindex.
XML element <printindex> produces LaTeX command \printindex. It is an empty element and takes one attribute:
- Attribute name giving the name of the index file. When this attribute is used in the document then the package multind is automatically loaded.
Bibliography
XML element <cite> produces LaTeX command \cite. It is an empty element and takes two attributes:
- Attribute key producing the argument of \cite command;
- Attribute opt producing the optional argument of \cite command.
XML element <nocite> produces LaTeX command \cite. It is an empty element and takes one attribute:
- Attribute key producing the argument of \nocite command.
XML element <bibliographystyle> produces LaTeX command \bibliographystyle. It is an empty element and takes one attribute:
- Attribute name producing the argument of \bibliographystyle command.
Note that there is also attribute style of element <bibliography> producing the same result.
XML element <bibliography> produces LaTeX command \bibliography or LaTeX environment thebibliography depending on whether attribute src is present. It is an empty element in the former case only and takes three attributes:
- Attribute src through which we obtain command \bibliography (the value of the attribute becomes the command argument);
- Attribute style through which we obtain command \bibliographystyle (the value of the attribute becomes the command argument);
- Attribute widthof which provides the first argument of environment thebibliography (the width of entry marks).
Note that there is also element <bibliographystyle> producing the same result as attribute style. In case <bibliography> is not empty, it contains sub-elements <bibitem>. If widthof is ommited, the value 999 is produced in the LaTeX code.
XML element <bibitem> produces LaTeX command \bibitem. It takes two attributes:
- Attribute key producing the argument of \bibitem command;
- Attribute label producing the optional argument of \bibitem command.
Arbitrary Commands and Environments
XML element <com> produces a LaTeX command whose name is equal to the value of (mandatory) attribute name. It takes eleven attributes:
- Attribute name: the name of the LaTeX command;
- Attribute optarg: the optional argument of the LaTeX command;
- Attribute arg1: the first argument of the LaTeX command;
- Attribute arg2: the second argument of the LaTeX command;
- Attribute arg3: the third argument of the LaTeX command;
- Attribute arg4: the fourth argument of the LaTeX command;
- Attribute arg5: the fifth argument of the LaTeX command;
- Attribute arg6: the sixth argument of the LaTeX command;
- Attribute arg7: the seventh argument of the LaTeX command;
- Attribute arg8: the eighth argument of the LaTeX command;
- Attribute arg9: the ninth argument of the LaTeX command.
Note that instead of using attributes one can also use sub-elements <optarg>, <arg1>, ..., <arg9> to obtain optional and mandatory arguments. In case both attribute argn and sub-element <argn> are present, the sub-element prevails.
XML element <env> produces a LaTeX environment whose name is equal to the value of (mandatory) attribute name. It takes eleven attributes:
- Attribute name: the name of the LaTeX environment;
- Attribute optarg: the optional argument of the LaTeX environment;
- Attribute arg1: the first argument of the LaTeX environment;
- Attribute arg2: the second argument of the LaTeX environment;
- Attribute arg3: the third argument of the LaTeX environment;
- Attribute arg4: the fourth argument of the LaTeX environment;
- Attribute arg5: the fifth argument of the LaTeX environment;
- Attribute arg6: the sixth argument of the LaTeX environment;
- Attribute arg7: the seventh argument of the LaTeX environment;
- Attribute arg8: the eighth argument of the LaTeX environment;
- Attribute arg9: the ninth argument of the LaTeX environment.
Note that contrarily to <com> you can not use sub-elements <optarg>, <arg1>, ..., <arg9> under <env>.
XML element <optarg> produces the optional argument of a LaTeX command (as sub-element of <com>). Note that there is also an optarg attribute producing the same result.
Element <argn> for n = 1,...,9
XML element <argn> produces the n-th mandatory argument of a LaTeX command (as sub-element of <com>). Note that there is also an argn attribute producing the same result.
To be provided ASAP.
To be provided ASAP.
To be provided ASAP.