This page contains the description of the following commands
\xbox,
\xdef,
\xi,
\Xi,
\xiint, \xiiint, \xiiiint,
\@xiipt,
\@xiipt,
\@xipt,
\@XKV@cc,
\xleaders,
\xleftarrow,
\XMLaddatt,
\XMLcurrentid,
\@xfontsize,
\xmlelt,
\xmlemptyelt,
\XMLgetatt,
\XMLlastid,
\xmllatex,
\XMLref,
\@xpt,
\xrightarrow,
\xscale,
\xscaley,
\xscape,
\XMLsolvecite,
\xspaceskip,
\x@tag, \@xtag,
\@xviipt,
\@xxpt,
\@xxvpt,
and environment
xmlelement.
In TeX, you can construct boxes that have a type (vertical or horizontal), and you can try to modify the size, see \vbox. In Tralics, \vbox {xx} is the same as \xbox{}{xx}. This creates an anonymous element containing xx. If you say \xbox{a}{xx}, then the box is named a. The example below shows that assignments inside the second argument are local to the group.
\xbox{foo}{\let\FOO=xA\xbox{bar}{\let\FOO=yB\FOO} C\FOO}
Translation:
<foo>A<bar>By</bar> Cx</foo>
You can say: \setbox13=\xbox{foo}{\large x}. This
will put the XML element into box 13, and you can use it later.
See \pers for an example of use.
See also the
xmlelement environment.
You can say \xdef\foo{bar}. The syntax is the same as \def, but the token list in the body is fully expanded (tokens that come from \the ot \unexpandedare not expanded).
You can put the prefix \global before \xdef, this is however useless, since \xdef is the same as \global\edef. The following example puts a brace in \foo. The \string command can be expanded, the value is the name of the command (preceded by a backslash, or whatever the value of the escape character is). Here the assignment to the escape character is local, the assignment to \foo is global.
{\escapechar=-1 \xdef\foo{\string\}}}
In Tralics, since version 2.13.1, there are eleven font sizes, named, starting with the smaller, \Tiny, \tiny, \SMALL, \Small, \small, \normalsize \large, \Large, \LARGE, \huge and \Huge. The commands \scriptsize and \footnotesize are aliases for \SMALL and \Small. The current font size can be changed by setting the integer \@xfontsize. This allows two additional sizes TINY and HUGE. The example below shows how to implement commands \larger and \smaller. Note that by default Tralics translates {\large x} and {\Large x} in the same way, but in the example below, y is in normal size.
\newcommand{\smaller}[1][1]{\larger[-#1]} \newcommand{\larger}[1][1]{% \count@\@xfontsize \advance\count@#1\relax \@xfontsize \count@} {\large x\smaller y\smaller z}{\Large w\smaller x\smaller y}
The \xi command is valid only in math mode. It generates a Greek letter: <mi>ξ</mi> (Unicode character U+3BE, ξ).
The \Xi command is valid only in math mode. It generates an uppercase Greek letter: <mi>Ξ</mi> (Unicode character U+39E, Ξ).
These are math-only commands, producing double, triple and quadruple integrals. See \iint for an alternate command. Translation is an <mo>&iint;</mo> or similar; double integral sign is Unicode U+222C, ∬, triple integral is U+222D, ∭, quadruple integral is U+2A0C, ⨌.
This command is provided by the xkeyval package.
The \xleaders commands reads a box and signals an error.
There is no difference between \xleftarrow{foo}
and \stackrel{foo}{\leftarrow}. It puts foo over an arrow
pointing to the left.
See
\stackrel. The command
accepts an optional argument placed below the arrow. Example.
$\xleftarrow{U} \xleftarrow[D]{} \xleftarrow[U]{D}$ $\xrightarrow{U} \xrightarrow[D]{} \xrightarrow[U]{P}$
Translation:
<formula type='inline'> <math xmlns='http://www.w3.org/1998/Math/MathML'> <mrow> <mover><mo>←</mo> <mi>U</mi></mover> <munder><mo>←</mo> <mi>D</mi></munder> <munderover><mo>←</mo> <mi>U</mi> <mi>D</mi></munderover> </mrow> </math> </formula> <formula type='inline'> <math xmlns='http://www.w3.org/1998/Math/MathML'> <mrow> <mover><mo>→</mo> <mi>U</mi></mover> <munder><mo>→</mo> <mi>D</mi></munder> <munderover><mo>→</mo> <mi>U</mi> <mi>P</mi></munderover> </mrow> </math> </formula>
The \XMLaddatt command takes as arguments an optional star, an optional number, an attribute name, an attribute value. It puts the attribute pair on the XML element defined by the number. If the number is not given, the current element will be used; this is the same as specifying \the\XMLcurrentid as number. If a star is used, you can overwrite an existing attribute pair. The command \XMLgetatt takes as arguments an optional number and an attribute name; its expansion is the value associated to the name of the XML element defined by the number (all characters but space are of category code 12). Example:
{\everyxbox{Vest} \setbox0=\xbox{foo}{1\xbox{bar}{2} % \XMLaddatt[\the\XMLlastid]{x}{1}\XMLaddatt[\the\XMLcurrentid]{y}{2}\XMLaddatt{y}{22}3% \edef\values{x=\XMLgetatt[\the\XMLlastid]{x}, y=\XMLgetatt{y}, z=\XMLgetatt{z}.}% \show\values} \showbox0 } {\everyxbox{West} \setbox0=\xbox{foo}{1\xbox{bar}{2} % \XMLaddatt*[\the\XMLlastid]{x}{1}\XMLaddatt*[\the\XMLcurrentid]{y}{2}\XMLaddatt*{y}{4}3% \edef\values{x=\XMLgetatt[\the\XMLlastid]{x}, y=\XMLgetatt{y}, z=\XMLgetatt{z}.}% \show\values} \showbox0 }
The following will be printed on the screen.
\values=macro: ->x=1, y=2, z=.. <foo y='2'>Vest1<bar x='1'>Vest2</bar> 3</foo> \values=macro: ->x=1, y=4, z=.. <foo y='4'>West1<bar x='1'>West2</bar> 3</foo>
The main XML element has ID number one, the bibliography has number three, the table of contents has number four, the index has number five, the glossary has number six. Never use number two.
If the attribute name is empty, the element name is used instead of the attribute value. Thus the expansion of \XMLgetatt{} is the name of the current element; and \XMLaddatt*{}{foo} changes it to foo (the star is mandatory here). In some cases no element is associated to the number. For instance, you cannot use this mechanism to get or change the bibliography name. Example
\setbox0\xbox{José}{Box is named \XMLgetatt{}\XMLaddatt*{}{bar}}
\showbox0
%prints: <bar>Box is named José</bar>
Expansion of \the\XMLcurrentid is the ID of the current XML element. This ID can be used as optional argument for the \XMLaddatt command. Using the command outside a context where a number is read yields the error Read only variable \XMLcurrentid since you cannot modify the ID of an element.
The xmlelement environment takes one argument, say X. It creates an XML element, named X, whose content is the content of the environment. As the example shows, you can add an attribute via the \AddAttToCurrent command. Moreover, each element has a unique ID, and the last unique ID allocated can be used to define the latest XML element, and \AddAttToLast modifies the attribute list of this element. In the example that follows, we explain how an apostrophe can be inserted in the attribute value (note however that Tralics does no check for the attribute name, it's up to you to make sure it is a valid name). Example:
\begin{xmlelement}{foo} \begin{xmlelement}{subelt1} texte1 \end{xmlelement} \begin{xmlelement}{subelt2} texte2 \end{xmlelement} \AddAttToLast{sb2-att}{value1} \AddAttToCurrent{foo-att}{att-value''} \end{xmlelement}
Translation
<foo foo-att='att-value'''> <subelt1> texte1 </subelt1> <subelt2 sb2-att='value1'> texte2 </subelt2>
If you try to specify twice the value of the same attribute, there are two cases: if the command is followed by a star, the old value is removed, otherwise, the new value is ignored. See example below.
\begin{xmlelement}{foo} \AddAttToCurrent{x}{1} % ignored \AddAttToCurrent{y}{2} % ok \AddAttToCurrent*{x}{3} % ok \AddAttToCurrent{y}{4} % ignored \end{xmlelement}
In this translation, you can notice lots a spaces, one space for each line that has a comment (the space before the comment is not discarded); the space at the end of the \begin line is ignored.
<p><foo x='3' y='2'> </foo> </p>
You can put a star after the name of the environment. The effect is the following. If no star is used, then horizontal mode is entered before creating the element (in the example above, the <foo> is inside a <p>). Otherwise, the element just created is typeset in vertical mode (said otherwise, in the case of bar below, the character sequence ok creates a new paragraph, hence a new element; in the case of foo no new element is created, and the meaning of `Current' does not change).
ok \begin{xmlelement*}{bar} \AddAttToCurrent{x}{1} ok % \AddAttToCurrent{x}{2} \end{xmlelement*} ok \begin{xmlelement}{foo} \AddAttToCurrent{x}{1} ok % \AddAttToCurrent{x}{2} \end{xmlelement}
Translation:
<p>ok </p> <bar x='1'><p x='2'>ok </p> </bar><p>ok <foo x='1'> ok </foo> </p>
You can say \begin{xmlelement+}...\end{xmlement+}. In this case \leavevmode is called (as in the case of \begin{xmlelement}) but translation starts in vertical mode (so that the box might start with a new paragraph).
This command returns the value of an attribute. See \XMLaddatt.
The \XMLsolvecite[xid][type]{key} command takes two optional argument and a required argument. A star is allowed after the command name. The call \bibitem[ign]{key} is the same as \par \leavevmode \xbox{bibitem}{\XMLaddatt{bib-key}{ign}} \XMLsolvecite*[][]{key}.
If the optional type is `year' or `refer', it will be replaced by an empty one (note that 'refer' is the same as 'year' only in some cases, for details see section 2.8 Bibliography of the raweb documentation). Two quantities are computed by Tralics, an eid, and a bid. The bid becomes the value of the id attribute of the element numbered eid, as in \XMLaddatt[xid]{id}{bid25}, see the description of \XMLaddatt for details; in particular the current XML element is used if the first optional argument is omitted or if its value is empty.
The bid is the same as the value of the 'target' attribute for the citation \cite[type][]{key}, (see \cite for an example). For every cite, a solvecite is required. In general, the document contains all cites, bibtex is called, and provides the \bibitem commands that solve them. If Tralics is used, it generates some \cititem and solves everything. But you can also use \XMLsolvecite directly. If you say \cite[foo][]{key}, then \XMLsolvecite*[][foo]{key} solves the entry; however, if there is no such entry to solve, then the first entry with value 'foo', whatever the type is solved. This is the expected behavior for \bibitem. If no star is given, this allows you to put a cite command after is target.
It is an error if the entry is already solved (because the cite element has a unique target) or if the element has an id (because ids are unique). In the case of a \bibitem, the element that gets an id is in general the <p> element that comes from the \leavevmode.
Example. The translation of \xbox{bibitem}{\XMLsolvecite[][foot]{toto}{key1}}. could be <bibitem id='bid0'>key1</bibitem>
The translation of \xmlelt{foo}{bar} is <foo>bar</foo>. See also \xbox whose syntax is more or less the same. However, \xmlelt starts a new paragraph, if needed, while \xbox is independent of the mode.
The translation of \xmlemptyelt{foo} is <foo/>. This command does not start a paragraph. Use \xmlelt{foo}{} or \leavevmode\xmlemptyelt{foo} if needed.
Expansion of \the\XMLlastid is the current ID, i.e. the ID of the last created XML element. This ID can be used as optional argument for the \XMLaddatt command.
This command is defined in tralics.sty as \newcommand\xmllatex[2]{#2}. Said otherwise, it takes two arguments, and ignores the first one. However Tralics ignores the second argument, and handles only the first.
In the first argument, commands are not expanded, but replaced by their names. Said otherwise, \foo is replaced by foo, this is not interesting; however \<\&\> is replaced by <&>. If you do not care, this might generate invalid XML. In the example that follows, we define a command \strok. You can apply it to the letters d, h, l, t (uppercase and lower case), the result is a character entity defined in the isolat2.ent file. We also give an example that shows how to put a double accent on a character.
\def\entity#1{\xmllatex{\}{}} \def\strok#1{\entity{#1strok}} \def\Han{Hàn Th\xmllatex{&\#x1ebf;}{\'{\^e}} Thành} \Han\ designed \xmllatex{\pdf\<TeX/\>}{}. \l\ and \strok{l}.\\ In Tralics version 2, you can say Th{\'{\^e}}
The resulting XML is the following.
<p>Hàn Thế Thành designed pdf<TeX/>. ł and ł.</p> <p noindent='true'>In Tralics version 2, you can say Thế</p>
Preview:
The effect of \XMLref[13]{foo} is to make a reference from element number 13 to the element defined by the label foo. If this element has unique ID uid27, then the effect is the same as \XMLaddatt[13]{target}{27}. The first argument is optional, and has the same meaning as in \XMLaddatt. There is no difference between \ref{foo} and \xbox{ref}{\XMLref{foo}}. Example. Consider the following piece of code. The two calls to \newlabel are taken from an auxiliary file written by LaTeX with the hyperef package. They memorise they section number and section title. thet will be used by \myref.
\def\newlabel#1#2{\newlabelxx{#1}#2} \def\newlabelxx#1#2#3#4#5#6{% \@namedef{label@value@#1}{#2}% \@namedef{label@title@#1}{#4}} \def\myref#1{\xbox{ref}{% \XMLref{#1}\@nameuse{label@title@#1}% \XMLaddatt{value}{\@nameuse{label@value@#1}}}} \newlabel{labA}{{1.1}{1}{Introduction\relax }{subsection.1.1}{}} \newlabel{labB}{{1.2}{1}{Continuation\relax }{subsection.1.2}{}}
Consider now the following lines. The commands \myref can be placed before or after the associated label (but should be placed before the \newlabel).
Text. \anchor\label{labA} \myref{labA}\myref{labB} \anchor\label{labB}
Translation
<p>Text. <anchor id-text='1' id='uid1'/> <ref target='uid1' value='1.1'>Introduction</ref> <ref target='uid2' value='1.2'>Continuation</ref> <anchor id-text='2' id='uid2'/></p>
These seven commands are used for font sizes; their expansion is respectively 10, 10.95, 12, 14.4, 17.28, 20.74 and 24.88.
There is no difference between \xrightarrow{foo}
and \stackrel{foo}{\leftarrow}. It puts foo over an arrow
pointing to the right.
See
\stackrel.
The command
accepts an optional argument placed below the arrow. See
\xleftarrow.
The \xscale command is defined by the curves package. The value is 1.0. See \arc.
The \xscaley command is defined by the curves package. The value is 0.0. See \arc.
The \xspace command looks at a token, its expansion is a space unless the space is useless, where where the expansion is empty. No space is needed if the token is an opening brace, a closing brace, a space (or a command that is made equivalent via \let to one these), or a punctuation character, one of .!,:;?/')-~. In the example that follows, the effect is to put a space between the two As, and not between the A and the exclamation point. Note that, in French, there should be a space there. On the other hand, there is a double space between the Bs, because the token that follows \xspace, namely \cmdB, is not in the list (it is not expanded by \xspace.
\def\cmdA{A\xspace} \def\cmdB{ B\xspace} \cmdA \cmdA ! \cmdB \cmdB !
You can say \xspaceskip=10pt plus 2pt minus 3pt. This explains to TeX that it should put 10pt (maybe up to 2pt more, maybe up to 3pt less) of glue between sentences. Unused by Tralics. (See scanglue for details of argument scanning). (See \spaceskip for additional details).
Internal commands used for equation numbering, see \tag.
back to home page
© INRIA 2003-2005, 2006, 2007
Last modified $Date: 2008/12/04 07:34:43 $