Tralics, a LaTeX to XML translator; Part I

# 6. Running Tralics

## 6.1. Introduction

There is a number of ways to alter the translation of your TeX document. One solution consists in using a ult file: this is a TeX file that Tralics loads automatically before the main source. The file has the same name as the main source, with a different extension, and is in the same directory.

All other configuration files are searched in a list of directories (default being confdir). There are four such types: file with extensions clt and plt are TeX files, that contains code associated to classes and packages (the u in ult stands for user, the other letters are for LaTeX and Tralics).

The file .tralics_rc is known as the default configuration file, its use is considered obsolete. Configuration files of this kind consist in a sequence of subfiles, and a rule for choosing a Type, that is, either a subfile or an external file, for instance ra2007.tcf. The suffix tcf stands for Tralics configuration file, there structure and use is explained here. The default value for the Type is the current document class. In the description of command line arguments below, some options are marked Raweb only´, this means that they are meaningful only when the Type (after removal of trailing digits) is ra.

The tcf file defines the DOCTYPE: this is the second line of the XML output; if the doctype is foo+bar.dtd, this means that the dtd file is bar.dtd and the root element is <foo>. The DOCTYPE can also be given as a command line argument or in the TeX source using a special syntax.

The tcf file may contain a sequence of assignments. Some of them control the attributes of the root element, but in general they alter the name of XML elements and attributes. These names can also be given as command line argument, or in the TeX source.

The tcf file may contain some TeX code. In fact, the file ra.tcf contains code that ought to be in ra.clt, and exists only for historical reasons.

Finally, a tcf file can contain a TitlePage block: this is a description of how commands like \maketitle can be translated using meta-data (title, author, keywords, etc) defined earlier.

## 6.2. The command line arguments

If you call Tralics without arguments, you will see something like

This is tralics 2.11.7, a LaTeX to XML translator, running on macarthur
Copyright INRIA/MIAOU/APICS 2002-2008, Jos\'e Grimm
Licensed under the CeCILL Free Software Licensing Agreement
Say tralics --help to get some help


In any case, the first three lines are printed. The version number may vary; we shall describe here the behavior of version 2.12 (released in April 2008). Command line arguments are read and interpreted from left to right. If an argument does not start with a hyphen, it is the name of the source file (only one input file is accepted); otherwise it is called an option. Some option names are shown with a hyphen, it is optional (in fact, dashes and underscores are ignored in option names), so that -help´ and --help´ are synonyms. Some options take no argument, for instance -version (whose effect is to print the version number and quit); others, for instance -input-file, take an argument. The argument is the character string that follows, preceded by an optional equals sign. Example

tralics -foo = bar gee     #1
tralics -foo= bar gee
tralics -foo =bar gee
tralics -foo=bar gee       #4
tralics -foo = "bar gee"   #5
tralics -foo = bar\ gee
tralics -foo  bar\ gee
tralics -foo = " bar gee"  #8
tralics -foo = \ bar\ gee
tralics -foo  \ bar\ gee
tralics "-foo = bar gee"   #11
tralics -foo\ =\ bar\ gee\


We assume here that a command line interpreter (usually called a shell) reads the line you type, converts it in character strings, finds the executable program associated to the first string, and calls it with all these strings as arguments. There are five arguments on the first line (the first argument is the name of the program, it is currently ignored). We assume here that spaces can be inserted into an argument by either enclosing the string in quotes, or by escaping the space with a backslash, and that characters after a sharp sign are ignored. Assume that -foo is a Tralics option that takes a value; then the previous line are interpreted as follows.

The first three examples are similar but for spaces around the equals sign. Cases 1 and 4 are equivalent, the argument of -foo is bar, and there is a second option gee. In case 2, the argument of -foo is empty, and there are two options bar, gee. In case 3, the optional equals sign is omitted, hence the argument is =bar, and there is a second option. Thus you should either put no space or two spaces surrounding the equals sign.

Remaining examples show what happens if you put spaces in the argument. In cases 5, 6 and 7, the argument is bar-space-gee. In cases 8, 9, 10 it is space-bar-space-gee. Lines 11 and 12 are the same, except for the trailing space. Since Tralics removes spaces before and after the equals sign, the argument is bar-space-gee (plus space in the last case).

Here is the list of all options, in alphabetic order.

• all (Raweb only) is obsolete and not described anymore.

• check (Raweb only) can be used to check the document for the Raweb semantics. No translation is started. In 2007, we removed the preprocessor and its checks, and this option becomes an error it can only be used if the year of the document (that matches the document class) is 2006 at most. Option is ignored in 2008.

• confdir=prefix specifies an alternate location for configuration files (with extension tcf, ult, plt, and clt). If you specify A, B, and C, in this order, then Tralics checks C, B, A, D in this order (where D is a default value).

• config=SomeFile: configuration file is SomeFile. You can use config-file´ instead of config´.

• default-class=MyClass. Assume that you compile a file that has \documentclass{foo}; in this case, Tralics tries to read the file foo.clt. No error is signaled if the file cannot be opened. If this option is used, then MyClass.clt is loaded if it exists; the command \CurrentClass will hold the name of the document class (here foo), so that MyClass.clt knows how it was called.

• dir=path (Raweb only); path will be the “raweb dir”, the directory containing lots of stuff for the Raweb mode. In particular, it contains a subdirectory confdir(note: ) with the configuration file. If this option is not used, the value of the shell variable TRALICSDIR will be used instead. Is obsolete in 2008, option confdir should be instead.

• distinguish-refer-in-rabib=x sets a special flag. The value can be yes, no, true, false, otherwise it is ignored. Default is yes. The flag indicates whether, for the Raweb, the refer bibliography database should be considered a normal file, or a subfile of the year database.

• doc-type=A-B This specifies the DOCTYPE of the resulting XML document. Here A is the name of the root element, B is the DTD file, these two names are separated by a space, a dash, a comma or a plus sign.

• entnames=yes/no applies to some commands like \alpha that translate as &alpha;´ or &#x3B1;´ (before version 2.9, it applied also to text commands like the eurosign, that are now represented internally as a Unicode character). Default is yes: the XML resulting document contains a name rather than a number.

• etex enables ϵ-TeX extensions. This is the default. Option noetex disables these extensions.

• external-prog=pgm (Raweb only) tells Tralics to use pgm instead of rahandler.pl´ as interpreter for the Raweb actions defined by the xmlXXX switches.

• hack-notitle (Raweb only). Tralics may replace \section{} (sectioning command with empty argument) by \section{Introduction} (same command with a dummy name). This is implied in raweb mode until 2006. The option was withdrawn in 2007: using it has no effect on the translation. You should never use a sectioning command with an empty argument.

• find-words asks for printing on the file words the list of all words of the XML tree.

• help prints the list of all options.

• input-dir=dir specifies where source files are to be found. This is a colon separated list of directories. Current directory is defined by an empty slot, or a single dot; it will be added to the end of the list, unless present.

• input-path=dir is the same as input-dir.

• input-file=foo specifies the source to be foo (extension .tex is added if needed).

• interactivebib: withdrawn in version 2.9.

• interactivemath: special mode, where no input file is required, expressions are read from the terminal. The translation of every math expression is printed on the terminal. The value of \jobname will be texput´ (so that the XML result is in texput.xml, the transcript file is texput.log).

• latin1: source files are assumed to be latin1 encoded, unless the first line of a file contains utf8-encoded´ (if utf8´ and latin1´ are given, the last option wins, if none is given latin1 is assumed).

• leftquote=num specifies translation of the left quote (or backquote) to be character number num; see below under rightquote.

• log-file = myfile. This tells Tralics to put all messages and warnings in myfile (extension .log added if not given). The file can be in the directory specified by the output-dir option.

• math-variant: By default, or if you say no-math-variant´, a math character in a font, for instance $\mathcal A$ translates into <mi>&#x1D49C;</mi> or <mi>&Ascr;</mi>, a character from Unicode plane one. Using this option changes the translation to be an ASCII character with a math variant property, hence $\mathfrak B$ gives <mi mathvariant=´fraktur´> B</mi>.

• no-bib-year-error (Raweb only): no error is signaled for a bibliography reference with missing or wrong year.

• no-bib-year-modify (Raweb only): no special hacks are applied if an entry is wrongly marked refer´ (otherwise, the entry is moved to another category)

• no-config: no configuration file will be used.

• no-entnames is the same as -entnames=no´.

• no-etex disables ϵ-TeX extensions.

• no-mathml sets the \@nomathml counter to minus one; default is zero.

• no-math-variant is the converse of mathvariant´ described above.

• no-trivialmath sets the \notrivialmath counter to 0 (default is 1), thus even trivial math formulas such as $0$ are translated as a <formula> element.

• no-undef-mac: no error is signaled when you use an undefined command like \foo. Instead, the command is automatically defined to be \foo.

• no-straight-quotes: the apostrophe translates into character U+B4, as \textasciiacute. However, the normal value is used in verbatim mode, when reading a file name, in an URL, or in a construct like \char.

• no-xml-error inhibits insertion of <error> elements in the XML tree. By default, an error element containing (at least the current line number) is added to the tree, for every error.

• no-zerowidth-elt controls what should be inserted in a verbatim string in order to inhibit ligatures when converting XML to Pdf. For this purpose the zero-width space character, namely &#x200B;, is used. This character appears sometimes as a normal-width space in a HTML file. For this reason, an element <zws/> is used; it can be replaced by a style sheet according to its destination: a special marker for Pdf, nothing for HTML. The default translation is an element, but using the flag changes it to a character.

• no-zerowidth-space inhibits insertion of a special marker in a case like \verb+--+.

• oe8, oe1, oe8a, or oe1a specify the output encoding (used in the XML file), one of UTF8 or latin1. If the letter a is given, then all non-7 bits characters are printed as character references. Thus, the only difference between option oe8a and oe1a is the XML header line. Default encoding is oe1.

• output-dir = mydir specifies the directory in which output files are to be stored (this concerns the main XML file, the transcript file, and other files).

• output-file = myfile tells Tralics to put the result in myfile (extension .xml added if not given). In the case of the Raweb, this option is ignored.

• param = foo=bar: foo="bar"´ is virtually added at the end of the configuration file. The equals sign can be replaced by a space.

• ps (Raweb only): Tralics creates a file foo.tex´ from the file foo2006.tex´, calls LaTeX, then dvips in order to produce a PostScript file. The document class of the new file is raweb.cls´ instead of raweb2006.cls´. This option exists for compatibility, and may be withdrawn. This is the only case where no XML file is created.

• ra-debug (Raweb only): parsing of the Raweb source continues after the first error.

• rightquote=num defines the translation of the right quote (or apostrophe). The problem is the following: the default translation of the left and right quote are often wrong; but you cannot make these characters active, because the scanner assumes that they are of category 12. The behaviour is the following: in verbatim mode, (as well as in URLs) these characters behave normally; if doubled translation is U+201C and U+201D. Otherwise you can change the translation. If you say -leftquote=2018 and -rightquote=2019 then characters U+2018 and U+2019 are used. Only base16 digits are allowed; the value should be a number between 1 and ${2}^{16}$ (otherwise default value is used).

• shell-escape makes \write18{rm \jobname.tex} remove the file you are translating.

• silent make the program silent (less lines are printed on the terminal).

• te8, te1, te8a, or te1a specify the encoding used in transcript files. In the case of te8 or te8a, characters are printed using UTF-8 format; in the case of te1 or te1a, characters are printed using latin1 encoding. Characters are printed using the ^^^^abcd notation in case: the value if greater than 255, and one of -te8a, -te1a is given, or the character is not in proper range (32-126 plus 160-155) and te1 is given, the character is smaller then 32. Note: horizontal tabulation, line-feed and carriage-return do not use the hat-hat notation. Default value is the output encoding (option oe8, etc.).

• tpa-status=flag controls what is to be translated if the configuration file specifies a titlepage (see for instance the titlepage.html´ document on the Web). If the value is all´, then the whole document is translated; if the value is title´, only the titlepage is translated; if the value is config´, action depends on the configuration file. Otherwise, translation stops in case of an error, continues otherwise. Only the first character of the value is tested. Capital letters are allowed.

• trivialmath=N sets the \notrivialmath counter to N (default is 1). Thus trivial math formulas such as $\alpha$ are translated as non-math.

• type=mytype specifies the configuration file to use. If you say tralics -type ra hello´, this will read the ra.tcf file, and you will enter Raweb mode, and this is wrong because the name of the file contains no year. If you say tralics -type article miaou2003´, you are not in Raweb mode, the preprocessor is not called, and 157 strange errors are signaled because of different reasons. If you say tralics -type ra miaou2007´, the compilation will fail because ra.tcf was designed for year 2006 and ra2007.tcf should be used instead. If you say tralics -type ra2007 miaou2003´, compilation fails because the tcf file contains an instruction declaring \declaretopics to be ignored, and this declaration is declared illegal by the raweb checker.

• use-quotes has as effect to convert double quotes into a pair of single quotes, either left quotes, or right quotes, that in turn can be replaced by other characters (for instance French guillemets).

• utf8: sources files are assumed to be UTF-8 encoded, unless the first line of a file contains iso-8859-1´.

• utf8output is equivalent to options oe8´ and te8´.

• v and verbose make the program rather verbose (it prints a lot of lines in the transcript file). The equivalent of the command \tracingall is executed.

• V or verbose-doc: the program is rather verbose (see option v above), but only when \begin{document} is seen. The equivalent of the command \tracingall is then executed.

• version: the program stops after printing the banner.

• xml, xmlfo, xmlhtml, xmllint, xmltex, xmlall (Raweb only). These options are incompatible with check´ and ps´. They ask Tralics to produce an XML file, and maybe more (a HTML file in the case xmlhtml, a FO file in the case xmlfo, a postscript file in the case xmltex) and check the validity of the translation against the Raweb DTD (case xmllint).

• year=nb (Raweb only) specifies the default year (year 2005 starts at May, 1st, because people start writing the Raweb2004 in September 2004, and everything should be finished by March 2005).

Example. Assume that we have a file, named xii.tex, containing

\let~\catcode~76~A13~F1~j00~P2jdefA71F~7113jdefPALLF
x\showlists
}$}\bye  This is the result of the \showlists command. ### display math mode entered at line 5 \mathord .\fam1 x ### internal vertical mode entered at line 4 prevdepth ignored ### math mode entered at line 3 ### restricted horizontal mode entered at line 2 \glue 3.33333 plus 1.66666 minus 1.11111 spacefactor 1000 ### vertical mode entered at line 0 prevdepth ignored  This example does not compile in Tralics: you cannot put a \vbox in a math formula. You cannot put a display math formula in a formula. TeX provides 9 commands of the form \tracingXXXX described earlier. Each variable defines an integer (in general, positive means verbose). There is a command \tracingall that turns everything on. In Tralics, it sets \tracingmacros, \tracingoutput, \tracingcommands and \tracingrestores to 1. Only these variables are useful in Tralics (the command \tracingmath is new in version 2.11, it controls the math printing). For instance, \tracingonline controls whether or not anything is printed on the terminal; for Tralics, debugging information is only printed on the transcript file. Variables like \tracingparagraphs and \tracingpages show line-break and page-break calculations, performed by TeX but not by Tralics. The command \tracingoutput shows boxes when they are shipped out (in Tralics, the whole XML tree is printed at the end; if the command is positive, lines are printed, whenever used by the scanner), \tracinglostchars indicates all characters not found in the fonts (Tralics never looks at font properties). The command \tracingstats indicates that TeX should gather all statistical information available; in Tralics, statistics are always computed; if you call it with the silent´ switch, statistics are not printed on the terminal. Note that the verbose´ switch calls \tracingall. There are three remaining commands: \tracingmacros is used whenever a user command is expanded, \tracingrestores whenever things are popped from the save stack, and finally, \tracingcommands for all other commands. Let´s start with the example given on page 2.1. This is what you see if \tracingoutput is positive: [4] \def\foo#1{\xbar#1} [5] \def\xbar#1{{\itshape #1}} [6] \foo{12}  It shows the input. This is what you see if \tracingmacros is positive: \foo #1->\xbar #1 #1<-12 \xbar #1->{\itshape #1} #1<-1  This is what you see if \tracingrestores is positive: +stack: level + 2 for brace {Push p 1} {font restore } +stack: level - 2 for brace  This is now what you see if \tracingcommands is positive: As you can see, some commands produce more than one line in the transcript file. For instance, a line is printed for \def when the command is seen, another one when the whole definition is read. {\def} {\def \foo #1->\xbar #1} {\def} {\def \xbar #1->{\itshape #1}} {begin-group character {} {\itshape} {font change \itshape} Character sequence: 1. {end-group character }} {Text:1} Character sequence: 2 . {Text:2 }  This is the start of the trace on page 2.2: [61] \begin{x}a b c \end{x} {\begin} {\begin x} +stack: level + 3 for environment  What you can see is that \begin produces three lines, the second line holds the name of the environment; the last line explains that the stack pointer was changed from 2 to 3; the system remembers that the change comes from an environment, so a closing brace of a \endgroup command is illegal. Later on, the trace says: Character sequence: ZbAY c . {\end} {Text:ZbAY c } {\end x} \endx ->by\end {y}ay  In TeX, instead of the first line, you would have seen: {the letter Z} {blank space } {the letter c} {blank space }  Tralics shows all characters it translates; it puts them on a single line. The character sequence is printed on the transcript file, because the command \end wants to be logged. After that, we have a line that contains Text´ in braces. The text is added to the current XML element; a line is printed whenever the buffer is flushed. The buffer is flushed here because it might be used by the internal routine that scans the argument of \end. The transcript file contains also: Character sequence: ay. {\endgroup (for env)} {Text:ay} +stack: ending environment x; resuming document. +stack: level - 3 for environment Character sequence: .  Normally, each line of the form level +3´, is followed by a line level -3´, after that the current level is 2. The last line contains Character sequence, followed by a colon, a space, some characters, a period. Instead of some characters´, you see only a space, it could be any character token with the category code of a space. In our case, it is the new line character that marks the end of the line. If the example is followed by an empty line, you will see: [62] {\par} {Text: }  What you see here is: open brace, Text, colon, some text, close brace. Here some text´ is the space above, shown as a new line character. What the \par command does is: a) flush the buffer, so that the text is printed, b) remove space at end of paragraph, c) terminate the element and unwind the XML stack. The next line shows this pop´. The integer 1 is the number of elements on the stack after the pop; you see the content of the stack, just before it is popped, in case the topstack is wrong. After the underscore, there is a suffix that indicates the mode (here p_v means that vertical mode will be entered after the pop). {Pop 1: document_v p_v}  This is an example from page 2.3: \E ->\expandafter {\expandafter \E \E} \E ->\expandafter \E ->\expandafter {\expandafter \expandafter \def} {\expandafter \def \toto} \toto ->\titi ! {\def} {\def \titi !->7}  This shows that \expandafter\foo\bar shows all three tokens. This can be interesting if these tokens come from the expansion of other tokens. For instance, in a case like this \def\y{yy} \def\foo{\textit\y} \expandafter\expandafter\foo  it is interesting to know that \y is expanded before \textit. The next one is from page 2.6. [346] \skip\count0=2pt plus \parindent \relax {\skip} +scanint for \count->0 +scanint for \skip->1 +scanint for \skip->2 +scandimen for \skip->2.0pt +scandimen for \skip->3.0pt {scanglue 2.0pt plus 3.0pt} {\relax}  In TeX, there is a big recursive function that converts characters into integers, dimensions and glue. The interesting point is the following: We have two commands \skip and \relax. The purpose of \relax is to stop scanning the glue, because an optional minus´ term. You will not see \parindent nor \count. The TeX output, in this case, consists of two lines. Tralics offers 6 more lines. The last line holds the glue that is effectively read and put in the register. There are three calls to the internal function scanint´, the first is the number of the count register, the second is the number of the skip register, the last is the integer part of the dimension. There are two calls to the internal routine scandimen´, one for each component of the glue (the shrink component is omitted, hence not read). The next example comes from page 2.6. 1 [3506] \count0=2\ifnum\count0=\count13\fi4 2 {\count} 3 +scanint for \count->0 4 +\ifnum3532 5 +scanint for \count->0 6 +scanint for \ifnum->7 7 +\fi3532 8 +scanint for \count->13 9 +scanint for \ifnum->7 10 +iftest3532 true 11 +scanint for \count->2 12 {\relax} 13 +\fi3532 14 Character sequence: 4 .  We have already explained that scanint´ is used to read something in case of assignment; as you can see, the procedure is also called in the case of a conditional. This example is a bit strange. Let´s explain what happens. A line of characters is read (see line L1), tokens are constructed, expanded and evaluated. The evaluator sees a first token, printed on line L2. This matches the rule: <simple assignment>, in fact, the first clause, which is <variable assignment>, that is defined as <integer variable> <equals> <number>, and the first term is \count<8-bit number>. There are two calls to scanint´, the first with a range check. In order to makes things easier to understand, we have given an index to each call, like ${S}_{1}$, ${S}_{2}$, etc. The job of ${S}_{1}$ is easy: there is one digit, printed on L3. The equals character is the first unread character. It is an <equals>. After the equals sign an integer is read, via ${S}_{2}$. This sees the digit 2, then the conditional ${I}_{3532}$. This number was computed by Tralics, it is printed on line L4 to make debug easier. The \ifnum command reads two numbers, and a character between them, and compares the numbers. First number is read via ${S}_{3}$. In fact, ${S}_{3}$ sees \count and calls ${S}_{4}$. Procedure ${S}_{4}$ sees the number 0, followed by an equals sign. It prints that value on line L5. Now ${S}_{3}$ knows that its value is in \count0, this is 7, printed on line L6. After that, ${I}_{3532}$ has a first number 7, and sees the equal sign, and reads the second number via ${S}_{5}$. This sees \count and reads a number via ${S}_{6}$. This reads 13. Then comes \fi. The \fi command prints line L7 on the transcript file. This terminates ${I}_{3532}$. This is not possible: our conditional is still reading the second number. As a consequence, two tokens are pushed back, a \fi and a \relax, in this order: the \relax is read again first. This terminates expansion of the \fi. Our procedure ${S}_{6}$ is programmed to fully expand tokens, and read them as long as digits are seen (even if the result overflows). It is unaware of the fate of the \fi token. All it knows is that the first unexpandable token after the digit 3 is \relax. Thus, ${S}_{6}$ has finished its jobs: the value is 13, printed on line L8. Then ${S}_{5}$ knows its result: the value is \count13, hence 7, printed on line L9. After that, ${I}_{3532}$ has two numbers, they are the same, the test is true, as can been seen on line L10. Normal expansion resumes; however the condition stack has a marker that tells that the next \fi or \else matches ${I}_{3532}$. If the test had been false, the expansion of the test would have read, at high speed, all tokens up to the next \fi or \else. There are four unread tokens: a \relax, a \fi, the digit 4, and the newline character. Remember ${S}_{2}$: this is a procedure that has read a digit, and wonders what follows. It does not care how complicated the task of expand´ may be. It just wants a non-expandable token. In fact, the current token is \relax. Thus, ${S}_{2}$ knows it has read all digits; it prints the result of the transcript file L11. As a consequence, 2 is stored in \count0. The \relax token does nothing (let´s hope nobody has redefined it), see line L12. The conditional is terminated because of the inserted \fi token, line L13. After the last character on the line is translated, a new line is read, and a line of the form L1 will be printed; before a line is added to the transcript file, the internal buffer is flushed, this explains line L14. Note that the following sequence provokes an error in TeX(if both counters are equal) \edef\FOO{\ifnum\count1=\count13\fi} \expandafter\def\FOO{2x}  It is accepted by Tralics. As a consequence, the special \relax token inserted by TeX always behaves like \relax. When Tralics sees a \else in a true condition, it reads everything at high speed, until finding the matching \fi; the example below shows the trace in such a case. 1 [1] \iftrue \else \ifcat 11\ifx ab \else \fi \ifnum1=2 \else \fi \fi\fi 2 +\iftrue1 3 +iftest1 true 4 +\else1 5 +\ifcat1(+1) 6 +\ifx1(+2) 7 +\else1(+2) 8 +\fi1(+2) 9 +\ifnum1(+2) 10 +\else1(+2) 11 +\fi1(+2) 12 +\fi1(+1) 13 +\fi1  ## 6.7. Pictures and friends We explain here the translation of some commands related to the picture environment. The syntax is unusual. In some cases, a pair of integers or a pair of real numbers are read. These numbers are multiplied by the value of the current unit of length, and the XML file contains these values, in pt, without the unit. The default value of \unitlength is 1pt. For instance \setlength{\unitlength}{3pt} \def\ten{10} \put(\ten,\ten.2){x}  translates as <pic-put xpos=´30´ ypos=´30.59999´>x</pic-put>. As the example shows, arithmetic on scaled integers is exact, but 10.2´ cannot be represented exactly. In some cases, arguments are converted to attributes, and errors can be signaled. In the case \put(1.2.3,4) {}”, you will see Missing unit (replaced by pt) {Character . of catcode 12}, followed by three other errors. In the case of \makebox(1,2)[$\alpha$]{x}´ the error is unexpected element formula. Without the dollar signs, an error is signaled, the math formula is discarded, a second error is signaled with unexpected element error. If you invoke Tralics with -noxmlerror´, the first error produces no <error> element, so that there is only one error. • \begin{picture}(A,B)(C,D) ...\end{picture}. The first two arguments are required, the other ones are optional. Normally, there should be no text in the environment, the mode is neither horizontal not vertical, \par commands are forbidden. Example: \begin{picture}(1,2) \begin{picture}(3,4)(5,6) 1=1 \end{picture} \end{picture}  This translates as <picture width='1' height='2'> <picture xpos='5' ypos='6' width='3' height='4'> 1=1 </picture> </picture>  • \fboxrule, \fboxsep. These two dimensions are defined by LaTeX, unused by Tralics. Default values: 0pt and 3pt. • \makebox(A,B)[x]{y}. This translates the value y, inside a group (as is the case for all box´ commands that follow). The result is <pic-framebox> element, with attributes width=A´, height=B´, and position=x´. • \framebox(A,B)[x]{y}. Same as \makebox above, but the attribute framed is set to true. As an example, the translation of \makebox(1,2)[l]{\it x} \makebox(1,2){\it x} \framebox(1,2)[l]{\it x} \framebox(1,2){\it x}  is <pic-framebox width='1' height='2' position='l'> <hi rend='it'>x</hi></pic-framebox> <pic-framebox width='1' height='2'> <hi rend='it'>x</hi></pic-framebox> <pic-framebox width='1' height='2' position='l' framed='true'> <hi rend='it'>x</hi></pic-framebox> <pic-framebox width='1' height='2' framed='true'> <hi rend='it'>x</hi></pic-framebox>  • \makebox[w][x]{y}. See alternate syntax above. The first argument must be a dimension, it is the width of the box; its value is currently ignored. The second argument must be one character of lrcs´. A paragraph is started if necessary. The result is a <mbox> element, containing the translation of y, unless either the box contains only a <figure>, or if it contains only text (characters, and font changes), case where the result is y. • \mbox{y}. This is exactly like \makebox, with a simple syntax. For instance: \makebox{\it x} \mbox{\it x} \makebox[2cm]{y\it x} \makebox[2cm][l]{\it x} \makebox{$x$} \mbox{$x$} \makebox{\xbox{foo}{bar}} \mbox{\xbox{foo}{bar}} \makebox{\includegraphics{x}}\mbox{\includegraphics{x}}  translates as <hi rend='it'>x</hi> <hi rend='it'>x</hi> <mbox>y<hi rend='it'>x</hi></mbox> <mbox position='l'><hi rend='it'>x</hi></mbox> <mbox><formula type='inline'><simplemath>x</simplemath></formula></mbox> <mbox><formula type='inline'><simplemath>x</simplemath></formula></mbox> <mbox><foo>bar</foo></mbox> <mbox><foo>bar</foo></mbox> <figure rend='inline' file='x'/><figure rend='inline' file='x'/>  • \framebox[w][x]{y}. This is like \makebox, but the result is a <fbox>, instead of <mbox>, with attribute rend =boxed´. In the case where the content is a <figure>, then no box is created but the attribute framed is added to the figure. • \fbox{y}. Like \framebox, with a simple syntax. For instance \framebox{\it x} \fbox{\it x} \framebox[2cm]{y\it x} \framebox[2pt][l]{\it x} \framebox{$x$} \fbox{$x} \framebox{\xbox{foo}{bar}} \fbox{\xbox{foo}{bar}} \framebox{\includegraphics{x}} \fbox{\includegraphics{x}}  translates as <fbox rend='boxed'><hi rend='it'>x</hi></fbox> <fbox rend='boxed'><hi rend='it'>x</hi></fbox> <fbox width='56.9055pt' rend='boxed'>y<hi rend='it'>x</hi></fbox> <fbox width='2.0pt' position='l' rend='boxed'><hi rend='it'>x</hi></fbox> <fbox rend='boxed'><formula type='inline'><simplemath>x</simplemath> </formula></fbox> <fbox rend='boxed'><formula type='inline'><simplemath>x</simplemath> </formula></fbox> <fbox rend='boxed'><foo>bar</foo></fbox> <fbox rend='boxed'><foo>bar</foo></fbox> <figure framed='true' rend='inline' file='x'/> <figure framed='true' rend='inline' file='x'/>  • \scalebox{x}{y}. The translation is a <scalebox> containing y, with a scale attribute whose value is x. • \rotatebox{x}{y}. The translation is a <pic-rotatebox> containing y, with a angle attribute whose value is x. • \dashbox{A}(B,C)[d]{y}. The translation is a <pic-dashbox> containing y, with a position attribute whose value is d. The three values A, B and C are numbers, affected by the unit length. They produce attributes dashdim, width and height. Example: \setlength\unitlength{2pt} \scalebox{3}{\it x} \rotatebox{90}{\it x} \dashbox{1.2}(2,3)[l]{\it x} \dashbox{1.2}(2,3){\it x}  The translation is <scalebox scale='3'><hi rend='it'>x</hi></scalebox> <pic-rotatebox angle='90'><hi rend='it'>x</hi></pic-rotatebox> <pic-dashbox dashdim='2.4' width='4' height='6' position='l'> <hi rend='it'>x</hi></pic-dashbox> <pic-dashbox dashdim='2.4' width='4' height='6'> <hi rend='it'>x</hi></pic-dashbox>  • \begin{minipage}[x][y][z][t]{dim} ...\end{minipage}. Optional arguments y and t are ignored. Arguments x and z should define vertical position. The last argument is a glue. Note: the translation starts in vertical mode. The command \nocentering is called. • \parbox[x][y][z]{dim}{y}. This should be the non-environment version of minipage´, but it is much more primitive. It behaves like \hbox and \xbox for argument parsing. Example \begin{center} a \begin{minipage}{2cm} a \end{minipage} \begin{minipage}[c][l][b][r]{2cm plus 3pt} a \end{minipage} \end{center} \parbox[foo][bar][gee]{2cmPlus3mm}{some \it box content}.  The translation is <p rend='center'>a <minipage width='56.9055pt'><p>a </p></minipage> <minipage inner-pos='b' pos='c' width='56.9055pt'><p>a </p></minipage></p> some <hi rend='it'>box content</hi><p>.</p>  • \bezier{N}(A,B)(C,D)(E,F). The first argument must be an integer, others are real numbers, affected by \unitlengh. The result is a <pic-bezier> element. • \qbezier[N](A,B)(C,D)(E,F). As above, but the first argument is optional. A Bezier curve is defined by three points, you must give the coordinates. In the first implementation, you had to specify the number of intermediate points used for plotting. For instance \bezier{10}(1,2)(3,4)(5,6) \qbezier(1,2)(3,4)(5,6) \qbezier[10](1,2)(3,4)(5,6)  translates as <pic-bezier a1='1' a2='2' b1='3' b2='4' c1='5' c2='6' repeat='10'/> <pic-bezier a1='1' a2='2' b1='3' b2='4' c1='5' c2='6'/> <pic-bezier a1='1' a2='2' b1='3' b2='4' c1='5' c2='6' repeat='10'/>  • \put(A,B){x}. The translation is a <pic-put> element containing the translation of x, with attributes xpos and ypos that come from A and B. • \xscale, \yscale, \xscaley, \yscalex. These are user defined commands, that should contain real numbers. The default values are 1, 1, 0, and 0. • \scaleput(A,B){x}. The translation is a <pic-scaleput>. It is like \put, but current scale values are put in the element. For instance the translation of \setlength\unitlength{2pt} \put(1,2){x} \def\xscale{2.0}\def\yscale{3.0}\def\xscaley{4}\def\yscalex{0.5} \scaleput(1,2){x}  is <pic-put xpos='2' ypos='4'>x</pic-put> <pic-scaleput xpos='2' ypos='4' xscale='2.0' yscale='3.0' xscaley='4' yscalex='0.5'>x</pic-scaleput>  • \multiput(A,B)(a,b){n}{x}. The translation is a <pic-multiput> element, with all the arguments as attributes. If the command is followed by a star, then n calls of \put are evaluated, with the same argument x, but at positions $\left(A+ka,B+kb\right)$ instead of $\left(A,B\right)$. See example of the little car on figure 4; the ruler was constructed with \multiput, a star is used for the figures. • \frame{x}. This translates as <pic-frame> with the value of x. • \oval(A,B)[c]. This translates as <pic-oval/> with some attributes, xpos, ypos, spec. • \line(A,B){c}. This translates as <pic-line/>. The first two arguments have to be integers. Only small values are recognized by LaTeX. The last argument is a real number. Attributes are xdir, ydir, width. • \vector(A,B){c}. This translates as <pic-vector/>. Same comments as above. Example. \setlength\unitlength{2pt} \oval(2,3) \oval(2,3)[4] \frame{x} \line(2,3){12.2} \vector(2,3){12.2}  The translation is <pic-oval xpos='4' ypos='6'/> <pic-oval xpos='4' ypos='6' specs='4'/> <pic-frame>x</pic-frame> <pic-line xdir='2' ydir='3' width='24.4'/> <pic-vector xdir='2' ydir='3' width='24.4'/>  • \thicklines. The translation is <pic-thicklines/>. • \thinlines. The translation is <pic-thinlines/>. • \linethickness{x}. The translation is <pic-linethickness> with attribute size. • \arc[n](A,B){c}. The translation is an empty <pic-arc> with attributes nbsymb, angle, xpos, ypos (and also unit-length). • \bigcircle[n]{c}. The translation is an empty <pic-bigcircle> element with attributes nbsymb, size, (and also unit-length). • \circle{c}. The translation is an empty <pic-circle>. For instance \setlength\unitlength{2pt} \arc[17](2,3){40} \arc(2,3){40} \bigcircle[17]{40} \bigcircle{40} \circle{40}  translates to <pic-arc angle='40' xpos='4' ypos='6' unit-length='2' nbsymb='17'/> <pic-arc angle='40' xpos='4' ypos='6' unit-length='2'/> <pic-bigcircle size='40' unit-length='2' nbsymb='17'/> <pic-bigcircle size='40' unit-length='2'/> <pic-circle size='80'/>  • \curve[n](A1,B1)(A2,B2)(A3,B3),...,(An,Bn). \closecurve[n](A1,B1)(A2,B2)(A3,B3),...,(An,Bn). \tagcurve[n](A1,B1)(A2,B2)(A3,B3),...,(An,Bn). These produces curves. • \dashline[A]{B}[C](A1,B1)(A2,B2)(A3,B3),...,(An,Bn). \dottedline[A]{B}[C](A1,B1)(A2,B2)(A3,B3),...,(An,Bn). \drawline[A][C](A1,B1)(A2,B2)(A3,B3),...,(An,Bn). These produce dashes. Example: \setlength\unitlength{2pt} \curve[12](1,2)(3,4)(4,5)(7,8) \tagcurve[12](1,2)(3,4)(4,5)(7,8) \closecurve[12](1,2)(3,4)(4,5)(7,8) \curve(1,2)(3,4)(4,5)(7,8) \tagcurve(1,2)(3,4)(4,5)(7,8) \closecurve(1,2)(3,4)(4,5)(7,8) \dashline[12]{13}[14](1,2)(3,4)(4,5)(7,8) \dottedline[12]{13}[14](1,2)(3,4)(4,5)(7,8) \drawline[12][14](1,2)(3,4)(4,5)(7,8)  The translation is <pic-curve unit-length='2' nbsymb='12'>1,2</pic-curve><p>(3,4)(4,5)(7,8) <pic-tagcurve unit-length='2' nbsymb='12'>1,2</pic-tagcurve>(3,4)(4,5)(7,8) <pic-closecurve unit-length='2' nbsymb='12'>1,2</pic-closecurve>(3,4)(4,5)(7,8) <pic-curve unit-length='2'>1,2</pic-curve>(3,4)(4,5)(7,8) <pic-tagcurve unit-length='2'>1,2</pic-tagcurve>(3,4)(4,5)(7,8) <pic-closecurve unit-length='2'>1,2</pic-closecurve>(3,4)(4,5)(7,8) <dashline arg3='14' arg2='13' arg1='12'> <point xpos='2' ypos='4'/><point xpos='6' ypos='8'/> <point xpos='8' ypos='10'/><point xpos='14' ypos='16'/></dashline> <dottedline arg3='14' arg2='13' arg1='12'><point xpos='2' ypos='4'/> <point xpos='6' ypos='8'/><point xpos='8' ypos='10'/> <point xpos='14' ypos='16'/></dottedline> <drawline arg3='14' arg1='12'><point xpos='2' ypos='4'/> <point xpos='6' ypos='8'/><point xpos='8' ypos='10'/> <point xpos='14' ypos='16'/></drawline>  ## 6.8. The title page Consider the following document fragment. Note the spellings of the commands \keyword and \motcle, this is not the same as for the environments of the Raweb. 1 \documentclass[a4paper]{report} 2 \usepackage{RR} 3 4 \providecommand\Tralics{\xbox{Tralics}{}} 5 \def\XML{XML} 6 7 \RRtitle{Tralics, a \LaTeX\ to XML translator\\Partie I} 8 \RRetitle{Tralics, a \LaTeX\ to XML translator\\Part I} 9 \RRauthor{José Grimm\thanks{Email: Jose.Grimm@sophia.inria.fr}} 10 11 \RRprojet{Apics} 12 \RRtheme{\THNum} 13 14 \RRresume{ 15 Dans cet article\par nous décrivons le logiciel \Tralics,\par...} 16 \RRabstract{ 17 In this paper we describe \Tralics, a \LaTeX\ to \XML\ translator.} 18 19 \RRdate{Aout 2005} 20 \URSophia 21 \motcle{Latex, XML, HTML, MathML, Perl, PostScript, Pdf} 22 \keyword{Latex, XML, HTML, MathML, Perl, PostScript, Pdf} 23 24 \begin{document} 25 \makeRR 26 text  This is translated by Tralics as follows. <?xml version='1.0' encoding='iso-8859-1'?> <!DOCTYPE std SYSTEM 'classes.dtd'> <!-- Translated from latex by tralics 2.9, date: 2006/10/03--> <std chapters='true'> <ftitle>Tralics, a <LaTeX/> to XML translator Partie I</ftitle> <title>Tralics, a <LaTeX/> to XML translator Part I</title> <author>José Grimm<note id='uid1' place='foot'>Email: Jose.Grimm@sophia.inria.fr</note></author><inria-team>Apics</inria-team> <theme>THnum</theme><resume><p>Dans cet article</p> <p>nous décrivons le logiciel <Tralics/>,</p> <p>...</p></resume> <abstract><p>In this paper we describe <Tralics/>, a <LaTeX/> to XML translator.</p></abstract> <date>Aout 2005</date><location>Sophia Antipolis</location> <motcle>Latex, XML, HTML, MathML, Perl, PostScript, Pdf</motcle><keyword>Latex, XML, HTML, MathML, Perl, PostScript, Pdf</keyword><p>text</p> </std>  The document you are reading here is a technical report (it has \makeRT instead of \makeRR, but it uses the same commands starting with RR´, they are defined in the file RR.sty, and Tralics (since version 2.9) uses some equivalents from the file RR.plt. This was translated to XML then HTML (may be you are reading the HTML version). Since year 2006, Inria´s research reports are to be put on HAL(note: ); before that, they were stored on Inria´s Web server. The meta-data were generated automatically: the author sends to the “gescap” mailing list the beginning of the document, up to the magic command \makeRR; this is translated by Tralics (that does not care about missing \end{document}); a post-processor extracts the <RRstart> element from the XML result, and converts it to HTML. Let´s compile the same file as above with the command tralics tptest.tex -type RR. <?xml version='1.0' encoding='iso-8859-1'?> <!DOCTYPE rr SYSTEM 'raweb.dtd'> <!-- Translated from latex by tralics 2.9, date: 2006/10/03--> <rr type='RR' chapters='true'> <RRstart><UR> <URSophia/> </UR> <title>Tralics, a <LaTeX/> to XML translator Partie I</title> <etitle>Tralics, a <LaTeX/> to XML translator Part I</etitle> <projet>Apics</projet> <motcle>Latex, XML, HTML, MathML, Perl, PostScript, Pdf</motcle> <keyword>Latex, XML, HTML, MathML, Perl, PostScript, Pdf</keyword> <resume><p> Dans cet article</p> <p>nous décrivons le logiciel <Tralics/>,</p> <p>...</p></resume> <abstract><p> In this paper we describe <Tralics/>, a <LaTeX/> to XML translator.</p></abstract> <author><auth>José Grimm<note id='uid1' place='foot'> Email: Jose.Grimm@sophia.inria.fr</note></auth> </author> <date>Aout 2005</date> <RRnumber>????</RRnumber> <Theme> <THNum/> </Theme> </RRstart> <p>text</p> </rr>  We have shown above the content of the files RR.plt and RR.tcf. One file ends with \let \RRstyisuseful \relax and the other starts with \ifx \RRstyisuseful \relax \endinput \fi. As a result, if you load the tcf file, the content of the plt file is discarded. The syntax in the TitlePage part of a configuration file is the following: each line has some fields, that can be of type A (the word alias´, or action´ or execute´) or type C (a command, a backslash followed by some letters), or E (an element name, delimited by less-than and greater-than) or S (a string, delimited by a double quote). Before each field, you can put one or two modifiers. Only the second and the third fields can have a modifier. More details can be found on the web page. The following combinations are recognized. (CESS) as in \makeRR <RRstart> "" “type = ´RR´”. This declaration has to be the first in the list. It can be given only once. No modifiers are allowed. It defines a command \makeRR, that can be used only once in the document, after \begin{document}. The effect is to insert the <RRstart> element into the XML tree, after some checks (that may produce an error). In what follows, we shall call it the TPA element. This element is formed of other elements defined by the titlepage info, the names of these elements are statically defined, their content is dynamic (i.e., the names depends on the configuration file, the content on the TeX document). The first string is a list of attributes added to the TPA element and the second string is a list of attributes added to the document element. In our example, the first string is empty. In the case where one of the attributes of the second string has the value only title page´, then \endinput is evaluated just after the Titlepage command. This means that everything after the titlepage command is ignored. This is useful if you want to extract the titlepage information from a document, without converting the whole document. (AESS) as in alias "" “type = ´RT´”. This declaration is valid only after a CESS declaration (or after another AESS declaration). It defines a command \makeRT that can be used instead of \makeRR (only one of these commands can be used). The result is the same; however it can use different attributes. (Same remark as above for special attribute values in the second string). In what follows, the \TPA command means one of the commands defined by this rule or the preceding one. (CEES) as in \RRauthor + <author> <auth> “Pas d´auteurs”. Note that the plus sign is required before the <author> element. This declaration has as side effect that the TPA element will contain a <author> element, formed of a number of <auth> elements. Initially there is only one, initialized with Pas d´auteurs´. The declaration has another effect, it defines a command \RRauthor, that has to be used before the \TPA command. It takes one argument, and creates a <auth> element whose content is the translation of the argument. This element is added to the end of the <author> element. The command can be used more than once, in the case there are multiple authors. Note that the default value is removed in case at least one value is given. (CCS) as in \myself \RRauthor “JG”. The effect is the same as \def\myself{\RRauthor{JG}}. However, the string argument is not translated, it is taken verbatim. (AC) as in alias \URRocq. This makes \URrocq an alias for the command defined on the previous line. Aliasing is achieved via \let. (E) as in <UR> -. The dash after the element is required. Another example can be <sUR fr=´unité de recherche´ en=´research unit´> -. In this second example, we have an element named <sUR>, that has two attributes. The effect is to put, in the XML result, this element (with its attributes), and its content is a list of items declared in the configuration file (the list can be empty). (CE) as in \URSophia ?+<UR> or \URFuturs ?+<UR d=´true´>. This has as effect to define a command, here \URSophia or \URFuturs, that takes no argument, whose effect is to insert, to the element <UR> (that must be defined by a previous rule), an empty element, whose name is <URSophia>, and that has the attributes of <UR>. (CEE) as in \Paris ?<UR> <Rocquencourt>. The effect is to define a command \Paris, that behaves like \URsophia, but the element created is <Rocquencourt> instead of one named <Paris>. (S) A character string is inserted verbatim. Note that less-than signs are not converted to entities like &lt;. (AC) as in execute \foo or action \foo. The expression \xbox{}{\foo} is translated. The resulting box is added to the XML tree. (CES) as \RRtitle <title> “pas de titre”. This is the generic command. The element can have the modifiers p, q, e or E, and the value can have the modifiers +ABC. The effect is to define a command \RRtitle (or an environment RRtitle´ if the E modifier has been given), that can be used only before the \TPA command. The argument of the command (or the content of the environment) is translated, put in a <title> element, and added to the TPA element. If no modifier is given for the element, paragraphs are forbidden in the argument. If you want to use paragraphs (either \par or \\) you must use the P modifier (lower-case letter). In the same fashion, a lower case E means environment without paragraphs, an upper case E means environment with paragraphs. If the q modifier is given, paragraphs are forbidden, but you can use \\, which is ignored. (In fact, the command reads an optional star, an optional argument, and the result is replaced by a space). Note that, in this document, there is a \\ in the title, that appears as a space in the page headings. This is done by redefining \\ to \space, so that optional arguments are not taken into account. There is a dirty hack in Tralics. If no modifier is given for the value, then <title>pas de titre</title> is added to the TPA element in case the command is never used. Near the end of the titlepage example, we define \cmdp, \cmdA, \cmdB, and \cmdC in a similar fashion, but add a modifier before the value. None of these commands is used in the TeX file; if you uncomment them, you can observe the following facts. • Tralics complains with: Error signaled at line 25 of file tptest.tex: No value given for command \cmdp. In fact, when Tralics sees the \makeRR command, it notices that \cmdp has not been called and complains, because the plus-sign modifier means: this value is required. • In the case where the modifier is one of A, B or C, then the default value is a LaTeX command (in fact, a list of characters, that may be interpreted as a set of LaTeX commands, and must be translated). Tralics removes the double quotes, and inserts the characters in one of its buffers, or converts the string into a token list that is appended to the input token list. The non trivial point is: when is the command evaluated? • In thee case of A´ modifier, the command is evaluated just before the \documentclass command. There may be other lines that are not in the TeX source file that are evaluated there. • In the case of B´ modifier, the command is evaluated at begin-document. More precisely \cmdb{\cmdBval} is tokenised, and the result is added to the token list maintained by \AtBeginDocument. • In the case of C´ modifier, the command is evaluated when the TPA command is seen. The important point is that category codes in effect at this moment will be used to convert the string into a sequence of tokens. There is special trick for the case where the name of the element associated to the command is empty. Assume that the configuration file contains \RRtheme <> +“pas de theme”. In the case where the user does not use \RRtheme, an error will be signaled, and the text will appear in the resulting XML. If the user says \RRtheme{foo}, then Tralics remembers the use and issues no complain. Moreover, it reads the argument, and pushes foo\par in the input stream (the reason why \par is executed is to make sure that Tralics remains in vertical mode). ## 6.9. Array and Tables We describe here the implementation of the arrays in Tralics. One has to distinguish between table´ which is an environment in which you can put some objects (in general tables) with a caption; like the figure´ environment, this generates a floating object. On the other hand, the array´ and tabular´ environments can be used to create a table: the first one is designed for math only, the second for non-math material. Math tables are described in the chapter about mathematics. There is currently no difference between figure´, figure*´ and wrapfigure´. Example \begin{table} \begin{tabular}{c} x \\y \end{tabular} \caption{My caption} \label{tl} \end{table} \begin{tabular}{c} \ref{tl} \end{tabular}  The translation is a follows. As you can see, both objects have the same name. If the table contains a tabular, only one XML object is created. <table id='uid1'> <head>My caption</head> <row><cell halign='center'>x</cell></row> <row><cell halign='center'>y</cell></row> </table> <p><table rend='inline'><row><cell halign='center'><ref target='uid1'/></cell> </row></table></p>  ### 6.9.1. The tabular environment You can say \begin{tabular} [pos] {cols} ...\end{tabular} or \begin{tabular*}{width} [pos] {cols} ...\end{tabular*}. In both cases, the result is a <table> element. This element has a vpos attribute whose value is t, b or c, provided that the optional [pos] argument is one of [t], [b] or [c]. The element has a width attribute with value xx, provided that the tabular*´ environment has been used and the first argument evaluates to xx as a dimension. The resulting element consists of some <row> elements, each of which contains some <cell> elements. A more complicated example: \begin{tabular*}{10pc}[b]{lrc} \hline a&b&c\\[2pt] \multicolumn{1}{l}{A}&B&C\\\hline \end{tabular*}  The translation here shows that the name of elements and attributes can be changed. <Table VPos='b' TableWidth='120.0pt' rend='inline'> <Row SpaceAfter='2.0pt' TopBorder='true'> <Cell Align='Cleft'>a</Cell> <Cell Align='Cright'>b</Cell> <Cell Align='Ccenter'>c</Cell> </Row> <Row BottomBorder='true'> <Cell Align='Cleft' Cols='1'>A</Cell> <Cell Align='Cright'>B</Cell> <Cell Align='Ccenter'>C</Cell> </Row> </Table>  ### 6.9.2. Interpreting the preamble This is an example of halign from the TeXbook The preamble of the array is the quantity marked {cols}´ in the description above. This is a specification for columns. It specifies how the columns should be formatted. In standard LaTeX, you cannot use more columns than specified; in Tralics, this is not relevant. The TeX primitive is called \halign, and LaTeX has to construct a preamble that matches the requirements of TeX; it is very difficult to implement the TeX algorithm, so that we make no attempt to implement the commands. This is an example \vbox{\offinterlineskip \hrule \halign{&\vrule#& \strut \quad\hfil#\quad\cr height2pt &\omit&&\omit&\cr &Year\hfil&&Word Population&\cr height2pt &\omit&&\omit&\cr \noalign{\hrule} \noalign{\vskip 2pt} \noalign{\hrule} height2pt &\omit&&\omit&\cr &8000BC&&5,000,000&\cr &50AD&&200,000,000&\cr &1650AD&&500,000,000&\cr &1850AD&&1,000,000,000&\cr &1945AD&&2,300,000,000&\cr &1980AD&&4,400,000,000&\cr height2pt &\omit&&\omit&\cr}\hrule}  The table has 5 columns, of the form ABABA, because the preamble has the form &A&B\cr, the first & marks repetition. Both templates A and B are formed of a 〈u〉 part, then #, then a 〈v〉 part. In the table, the # means: “stick the text of each column entry in this place”. In the case of A, this is almost always empty. In some cases, it is height2pt´, case where the values of B are \omit. Here \omit says that 〈u〉 and 〈v〉 should be omitted; the important point is that the \strut be omitted. This gives additional vertical space, of exactly 2pt; other rows have (at least) the vertical size of a \strut. Very often row are too narrow; LaTeX has a command \arraystretch that controls this. Note that A is \vrule# and \vrule is a command that accepts an optional argument. Note how horizontal rules are inserted in the table. As the previous example shows, there are three standard column types: c, l and r (centered, left-aligned, right-aligned). A TeX preamble like \quad\hfil#\quad corresponds to r´ (instead of \quad, LaTeX uses some default intercolumn space that can be modified). You can also say p{dim}. This should typeset the column in a \parbox[t]{dim}. This feature is not implemented: the argument is ignored, and p is replaced by c. Note: \parbox currently ignores its argument in Tralics. The array.sty package adds two options that take a dimension as argument: m´ and b´. The b´ option is like the p´ option, but bottom-aligned. The m´ option should be used only in math mode (i.e. for the array environment, and not tabular). In Tralics, there is no difference between b´, m´ and p´. There is a @{text} option. It inserts text´ in every row, where text´ is processed in math mode in the array´ environment and in LR mode in the tabular´ and tabular*´ environments. Such an expression suppresses the space that LaTeX normally inserts between columns. For instance, an array specification like {l@{\hspace{1cm}}l} says that the two columns of text should be separated by exactly one centimeter. A specification like {@{}c@{}} says that no additional space should be added neither of the left not the right of the column. An \extracolsep{wd} command can be used inside such an expression. It causes an extra space to appear to the left of all subsequent columns. Note that \extracolsep expands to \tabskip; this TeX primitive is not implemented in Tralics. In fact, Tralics ignores an @´ and its argument. You can use a | for specifying a vertical rule. However, in Tralics you cannot use double or triple rules. Sorry. There is also a !{...} options that is not implemented. Every specification (l´, r´, c´, p´, b´, m´) can be preceded by a >{xx} declaration, and followed by a <{yy} declaration. In case of multiple declarations, the last will be executed first. Said otherwise, >{3}>{b}c<{a}<{z} is the same as >{b3}c<{za}. The effect is to insert b3´ before the cell in the current position, and za´ after the cell. See the last tabular in table 2. This corresponds to 〈u〉 and 〈v〉 parts of a TeX array. Note that the cell is finished when a token is sensed that indicates either a new cell, a new row or the end of the array. Technically, this means a &, a \\, or an \end (the end of the environment). A special marker is pushed back after the za´. This is a special endtemplate token in the case of a cell, and a \cr in the case of \\. You should not use \cr or \crcr outside an array defined by \halign (this is not yet implemented). You must be careful that the za´ (more generally, the 〈v〉 part) does not contain something that reads the special end marker. For instance \def\x#1{}\halign{#\x&#\cr 1&2\cr} is an error. Finally, *{N}{text} can be used instead of N occurrences of text´. Note. At the end of Chapter 22 of the TeXbook, Knuth gives an example of a table where the preamble is \centerline{#}. Such a construction cannot be done in Tralics, since a specification of the form >{\centerline}c<{} would transform into \centerline?#? and question marks cannot be replaced by braces; you could try >{\expandafter\centerline?} and replace the question mark by something that expands to an open brace but contains as many open braces as closing ones, for instance \expandafter {\iffalse}\fi. However, it is not possible to put in the <{?} part something that the parser considers as a closing brace followed by some other text (otherwise, this closing brace would terminate parsing of the <{?} part). Knuth says that an entry of the form a}b{c is legitimate, with respect to this template. This cannot be the case in Tralics, but it would be valid for a template like >{\bgroup\bf}c<{\egroup}. This justifies that a table has to be terminated by \cr or \crcr. In the case of Tralics, this is not needed. ### 6.9.3. New column types You can add new column types to the list of existing one, using \newcolumntype, with as argument a letter. For instance: \newcolumntype{C}{>{}c<{$}} \newcolumntype{L}{>{$}l<{$}} \newcolumntype{R}{>{$}r<{$}} \newcolumntype{d}[1]{>{\rightdots{#1}}r<{\endrightdots}} \newcolumntype{X}{CLR} \begin{tabular}{*{3}{|c|}d{23}X} \end{tabular}  In this case, the transcript file will contains (line breaks added before r´) {Push tabular 2} array preamble at start: |c||c||c|d{23}X array preamble after X: |c||c||c|d{23}CLR array preamble after d: |c||c||c|>{\rightdots {23}} r<{\endrightdots }CLR array preamble after C: |c||c||c|>{\rightdots {23}} r<{\endrightdots }>{$}c<{$}LR array preamble after L: |c||c||c|>{\rightdots {23}} r<{\endrightdots }>{$}c<{$}>{$}l<{$}R array preamble after R: |c||c||c|>{\rightdots {23}} r<{\endrightdots }>{$}c<{$}>{$}l<{$}>{$}r<{} array preamble parse: | c | | c | | c | >>{} r <<{} >>{} c <<{} >>{} l <<{} >>{} r <<{}  Whenever a tabular is seen, optional arguments are read, and then the first argument is handled. In a first pass, * is evaluated. This gives the lines marked at start´. After that, the preamble contains, at toplevel (outside braces) two characters d´ and X´ that are defined to be new column types. These are evaluated one after the other (the order is irrelevant, here alphabetic order is used so that X is expanded first). Since the expansion was non trivial, a second try is made. Note that only a finite numbers of tries are executed. In case of recursion, strange things can happen. Note how you can use commands with arguments (here d´ takes one argument, it is 23´). The table is empty, on purpose, because there are two undefined macros, moreover, because, in the current version of Tralics, dollar signs have to be explicit, and not hidden in a >{}...<{} construction. ### 6.9.4. Another example We consider here the following new column types. As you can see, one of them is the character +, another is the character _. The fact that these characters have special catcodes is irrelevant (they cannot be of catcode 1 and 2, because this would interfere with brace matching, and they cannot be of catcode 10, because space characters should be ignored in the preamble). \newcolumntype{L} {>{\large\bfseries 2}l <{y}|} \newcolumntype{+} {>{B}l <{D}|} \newcolumntype{_}{rlc<{x}} \newcolumntype{x}{>{b}c<{a}}  Consider the four following tables \begin{tabular*}{339pt}[b]{*{4}{_c|}} a1&a2&a3&a4 & b1&b2&b3&b4 & c1&c2&c3&c4& d1&d2&d3&d4\\ Wa1&Wa2&Wa3&Wa4 & Wb1&Wb2&Wb3&Wb4 & Wc1&Wc2&Wc3&Wc4& Wd1&Wd2&Wd3&Wd4\\ \end{tabular*} \begin{tabular}{|ll|rr|cc|} \hline a&b&c&d&e&f\\ aaa&bbb&ccc&ddd&eee&fff\\ \hline A&\multicolumn{3}{+}{C}&E&F\\ \multicolumn{2}{|l}{ab}&c&d&e&f\\ \cline{1-3}\cline{6-6} aaa&bbb&ccc&ddd &eee&fff\\\hline \end{tabular} \begin{tabular} {| >{\large 1}c <{x}| L > {\large\itshape 3}c <{z}|} \hline A&B&C\\\hline 100&10 &1\\\hline \end{tabular} \begin{tabular} {| >{\large 1}c <{x}| L > {\large\itshape 3}x <{z}|} \hline A&B&C\\\hline 100&10 &1 \end{tabular}  Table 2. Some LaTeX tables  a1 a2 a3x a4 b1 b2x b3 b4 c1 c2x c3 c4 d1 d2x d3 d4 Wa1 Wa2 Wa3x Wa4 Wb1 Wb2x Wb3 Wb4 Wc1 Wc2x Wc3 Wc4 Wd1 Wd2x Wd3 Wd4  a b c d e f aaa bbb ccc ddd eee fff A BCD E F ab c d e f aaa bbb ccc ddd eee fff  1Ax 2By 3Cz 1100x 210y 31z  1Ax 2By b3Cza 1100x 210y b31za You can see the LaTeX result on table 2. We had to change the \tabcolsep of the first table to 0, otherwise, it is two wide. Specifying 0pt as width gives the following warning : Overfull \hbox (339.38422pt too wide) in alignment, from this we deduced that 339pt could be a good value, specifying 340 gives an underful box. The XML translation can be found on the Web page. In order to explain what happens, we consider an example: \begin{tabular*}{10pc}[b]{l>{x}r<{y}c} \hline a&b&c\\[2pt] a&\omit b&c\\ \multicolumn{1}{l}{A}&B&C\\\hline \end{tabular*}  We explain now the translation. Line numbers refer to the transcript file given below. We do not show the start of the job (initialization). The command \par is redefined to do nothing. It is restored on line 107. • A first procedure is used to start a row. See example, lines 1, 35, 63, 101. It can take an argument, that explains that some vertical spacing should be added between rows, this is the case for line 35. Tokens are read and expanded. Spaces are ignored. If the command that comes next is \hline, for instance lines 1 and 101, we add a bottom-border attribute to the previous row (if we are about to start the first row, we mark this as top-border for the current row). If the command is \cline, see syntax above, we try to add a bottom-border attribute to some cells (this is not shown on the example). This could fail, because cells can span more than one column; in this case an row of empty cells may be added. If the next token is \end, we do nothing (line 101). Otherwise, we create a new \row element (lines 3, 36, and 63) and start a cell. • When a cell is started, the equivalent of \begingroup is evaluated, and a \cell element is started. The example table has 9 cells, started on lines 4, 12, 22, 37, 45, 53, 64, 82, 92. The Push´ line indicates that a <cell> element is created, the line that follows show the \begingroup command. We consider the first non space token after expansion. This token may be \omit, as on line 47. The cell is marked omitted; otherwise the 〈u〉 part of the current template is added. The current token could be \multicolumn. This is a command that takes 3 arguments: an integer n, a specification c, a value v. The example on lines 66 to 69 shows how n is read; this might change, LaTeX uses the equivalent of \setcounter for parsing the number. The specification is handled in the same fashion as an array preamble (lines 70-71), it should provide only one cell specification. The integer n specifies the span, it will be added as an attribute to the cell, but also used to find the position of the next cell in the row. The cell is marked omit´; in fact, we push in the current input stream the value of the 〈u〉 part, 〈v〉 part and content (last argument) of \multicolumn. Braces are added for some obscure reason (see lines 72 and 73). • Translation proceeds as usual, three events may change it. Assume that we see &, as on lines 7, 15, 40, 77, 85. This is only allowed in a table. A final space in the XML element will be removed. A \endtemplate token is pushed to be read again. It will be read again on lines 9, 18, 42, 79, and 88. If the cell on the stack is not marked omit´ then the 〈v〉 part of the template is inserted in the input stream (see lines 17 and 87). • The translation of \endtemplate is trivial: it is an error if not in a cell. Otherwise, the current cell is finished, the equivalent of \endgroup is executed, and a new cell is started as above. On line 10 you can see for instance that the cell and the row are in array´ mode, the tabular in horizontal mode, the paragraph and the document in vertical mode. • Assume that we see \\, for instance lines 25, 56, 95. We have explained the meaning of this command outside a cell. In any case, an optional argument is read (between the command and the optional argument can be a space or a newline character, so that source line 10 is read; see line 58). The behavior is like &, except that \cr is pushed instead of \endtemplate. (in the case of an optional argument, the code is a bit hacked, see line 30). • The translation of \cr is trivial. We have two versions: one that reads a dimension, and one that does not. On lines 27-29, you can see how scanglue´ reads to optional argument to \\, on line 31, you see that scanint´ reads 1703, this is the address in a table of the string that represents the glue. The command finishes the cell, finishes the row, evaluates \endgroup and starts a new row. • The \end command, with argument tabular´ or tabular*´ behaves in a strange manner: If inside a cell, it behaves like \\, except that it does not insert \endtemplate but itself with the argument, then a \cr. We have seen that \cr starts a new row. We have seen that no row is started if the token is \end. The magic is that the top-stack contains the begin´, and a normal end´ can be used, instead of a hacked one. In our example, the array is terminated by \\\hline, so that the end occurs when we are about to start a new row. In order to show this, we have commented out this line, and re-run the example. The result can be seen on line 111, a \cr is inserted and evaluated on line 115, the second \end is evaluated on line 19. • The commands \cr, \crcr, \span, \halign, \valign, \noalign are not implemented as described in the TeXbook. This is the transcript file. 1 [7] \hline 2 [8] a&b&c\\[2pt] 3 {Push row 3} 4 {Push cell 4} 5 +stack: level + 3 for cell 6 Character sequence: a. 7 {alignment tab character &} 8 {Text:a} 9 {\endtemplate} 10 {Pop 4: document_v p_v tabular*_h row_a cell_a} 11 +stack: level - 3 for cell 12 {Push cell 4} 13 +stack: level + 3 for cell 14 Character sequence: xb. 15 {alignment tab character &} 16 {Text:xb} 17 Character sequence: y. 18 {\endtemplate} 19 {Text:y} 20 {Pop 4: document_v p_v tabular*_h row_a cell_a} 21 +stack: level - 3 for cell 22 {Push cell 4} 23 +stack: level + 3 for cell 24 Character sequence: c. 25 {\\} 26 {Text:c} 27 +scanint for \\->2 28 +scandimen for \\->2.0pt 29 {scanglue 2.0pt} 30 {\cr withargs} 31 +scanint for \cr withargs->1703 32 {Pop 4: document_v p_v tabular*_h row_a cell_a} 33 +stack: level - 3 for cell 34 {Pop 3: document_v p_v tabular*_h row_a} 35 [9] a&\omit b&c\\ 36 {Push row 3} 37 {Push cell 4} 38 +stack: level + 3 for cell 39 Character sequence: a. 40 {alignment tab character &} 41 {Text:a} 42 {\endtemplate} 43 {Pop 4: document_v p_v tabular*_h row_a cell_a} 44 +stack: level - 3 for cell 45 {Push cell 4} 46 +stack: level + 3 for cell 47 Character sequence: b. 48 {alignment tab character &} 49 {Text:b} 50 {\endtemplate} 51 {Pop 4: document_v p_v tabular*_h row_a cell_a} 52 +stack: level - 3 for cell 53 {Push cell 4} 54 +stack: level + 3 for cell 55 Character sequence: c. 56 {\\} 57 {Text:c} 58 [10] \multicolumn{1}{l}{A}&B&C\\\hline 59 {\cr} 60 {Pop 4: document_v p_v tabular*_h row_a cell_a} 61 +stack: level - 3 for cell 62 {Pop 3: document_v p_v tabular*_h row_a} 63 {Push row 3} 64 {Push cell 4} 65 +stack: level + 3 for cell 66 {Push argument 5} 67 Character sequence: 1. 68 {Text:1} 69 {Pop 5: document_v p_v tabular*_h row_a cell_a argument_a} 70 array preamble at start: l 71 array preamble parse: l 72 {begin-group character {} 73 +stack: level + 4 for brace 74 Character sequence: A. 75 {end-group character }} 76 +stack: level - 4 for brace 77 {alignment tab character &} 78 {Text:A} 79 {\endtemplate} 80 {Pop 4: document_v p_v tabular*_h row_a cell_a} 81 +stack: level - 3 for cell 82 {Push cell 4} 83 +stack: level + 3 for cell 84 Character sequence: xB. 85 {alignment tab character &} 86 {Text:xB} 87 Character sequence: y. 88 {\endtemplate} 89 {Text:y} 90 {Pop 4: document_v p_v tabular*_h row_a cell_a} 91 +stack: level - 3 for cell 92 {Push cell 4} 93 +stack: level + 3 for cell 94 Character sequence: C. 95 {\\} 96 {Text:C} 97 {\cr} 98 {Pop 4: document_v p_v tabular*_h row_a cell_a} 99 +stack: level - 3 for cell 100 {Pop 3: document_v p_v tabular*_h row_a} 101 [11] \end{tabular*} 102 {\end} 103 {\end tabular*} 104 {\endtabular*} 105 {Pop 2: document_v p_v tabular*_h} 106 {\endgroup (for env)} 107 +stack: restoring \par=\par 108 +stack: ending environment tabular*; resuming document. 109 +stack: level - 2 for environment 110 Character sequence: .  Alternate version, where the final \\\hline is commented out 111 [11] \end{tabular*} 112 {\end} 113 {Text:C} 114 {\end tabular*} 115 {\cr} 116 {Pop 4: document_v p_v tabular*_h row_a cell_a} 117 +stack: level - 3 for cell 118 {Pop 3: document_v p_v tabular*_h row_a} 119 {\end} 120 {\end tabular*} 121 {\endtabular*}  ## 6.10. Actions declared in the configuration file An action is defined by a name, an equals sign, and a value. Optional spaces can be used. The syntax of DocType and DocAttrib is special. In all other cases, double quotes must delimit the value. All names contain only letters, digits, and underscores. If the name has the form att_foo, this changes the value of attribute foo´. If the name has the form xml_foo, it changes the value of element foo´. In a previous version you had to give the full name, xml_foo_name. Names of elements and attributes can be dynamically changed: when you say \ChangeElementName{item}{Item} \ChangeElementName*{rend}{rendering} \ChangeElementName*{quote}{quotation}  this changes the name of element item´ and attributes rend´ and quote´. In the examples that follow, we shall assume that the file defined in section 6.3.6 is loaded. • makefo, makehtml, checkxml, makepdf, makedvi, dvitops, generatedvi, generateps. These specify actions for the Raweb. For details see the Web page. • theme_vals (Raweb only). This defines the list of all Inria Themes. • section_vals (Raweb only). This defines the list of all valid sections in the Raweb. If the first character is a +´ sign, the remaining of the line is appended to the previous value. You must use a slash as separator. • ur_vals (Raweb only). This defines the list of all valid UR (name and value) in the Raweb. If the first character is a +´ sign, the remaining of the line is appended to the previous value. You must use a slash as separator. After each name, you must give a value (if empty, the name will be used). Only letters can be used in the name. • affiliation_vals, profession_vals (Raweb only). Same syntax as above. These lists specify which values are valid for argument 3 and 4 of the \pers command. The value Other´ is always valid. • catperso_vals, (Raweb only). Same syntax as above. These lists specify which values are valid for argument of the \catperso command. If no such declaration is given, any value is accepted. • Language. The main element contains an attribute pair of the form language=´english´. Specifying Language´ in the configuration file modifies the name of the attribute. • lang_fr, lang_en. See above. These two commands can parametrize the value of the attribute. The attribute pair is added to the main element: just after translation of the preamble in the Raweb case, by the titlepage command, or in the at-begin-document hook. The language chosen is the “default language”. • url_font. If you specify a value \foo´, then \def\urlfont{\foo} will be added to the document-hook. The command is empty by default. It is the font used for urls. • distinguish_refer_in_rabib (Raweb only). This overrides the command line argument of the same name. • entity_names. This overrides the command line option entnames. • bibtex_fields. This specifies a list of additional BibTeX fields that Tralics should read and translate. • bibtex_extensions. This specifies a list of additional BibTeX entry types that Tralics should read and translate. • everyjob. If the value is \foo´, then \everyjob={\foo} will be executed. In fact, this is the last line of the bootstrap code. After these lines are translated, the value of the token list \everyjob is inserted in the input stream, before the first line of the input file. • no_footnote_hack. If the value is true´, then no hack is applied to footnotes. The translation of a\footnote{B}\footnote{C\par D}  is <p>a<note id='uid1' place='foot'>B</note> <note id='uid2' place='foot'><p>C</p> <p>D</p> </note></p>  As you can see, if the footnote holds only a single <p> element, it will be removed. If the switch is true, then all footnotes translate the same. • xml_footnote_name, att_place, att_foot_position. These assignments explain how to change the name of the <note> element, the attribute name and the attribute value in place=´foot´. Thus, the translation of the example above can be: <p>a<Note id='uid12' Place='Inline'><p>B</p> </Note><Note id='uid13' Place='Inline'><p>C</p> <p>D</p> </Note>  • use_font_elt. The default translation of {\tiny \textit{A}B} is <hi rend='small'><hi rend='it'>A</hi></hi><hi rend='small'>B</hi>  If you say use_font_elt=true´, this changes the translation as follows <small><it>A</it></small><small>B</small>  We shall see below how to replace small´ by something else. the method is the same whether small´ is the name of a an element or an attribute value. • use_all_sizes. By default, Tralics knows only three font sizes, normal, smaller, larger. If the switch is true, the previous example translates to <small4><it>A</it></small4><small4>B</small4>  or <hi rend='small4'><hi rend='it'>A</hi></hi><hi rend='small4'>B</hi>  • xml_font_small, xml_font_large, xml_font_normalsize. These elements specify the names of small, large and normal size. The translation of {\tiny a}{\normalsize b}{\large c} can be changed to <Small>a</Small>b<Large>c</Large>  Currently, no tag is inserted in the case of \normalsize. In some cases, this is wrong. • xml_font_small1, xml_font_small2, xml_font_small3, xml_font_small4, xml_font_large1, xml_font_large2, xml_font_large3, xml_font_large4, xml_font_large5. These specify the names of all font sizes for the case where all sizes are used. For instance, the translation of {\Huge a}{\huge b}{\LARGE c}{\Large d}{\large e}{\normalsize f}{\small g}{\footnotesize h}{\scriptsize i}{\tiny j}  is <font-large5>a</font-large5><font-large4>b</font-large4> <font-large3>c</font-large3><font-large2>d</font-large2> <font-large1>e</font-large1>f<font-small1>g</font-small1> <font-small2>h</font-small2><font-small3>i</font-small3> <font-small4>j</font-small4>  It can be changed to <hi rend='font-large5'>a</hi><hi rend='font-large4'>b</hi> <hi rend='font-large3'>c</hi><hi rend='font-large2'>d</hi> <hi rend='font-large1'>e</hi>f<hi rend='font-small1'>g</hi> <hi rend='font-small2'>h</hi><hi rend='font-small3'>i</hi> <hi rend='font-small4'>j</hi>  • xml_font_upright, xml_font_it, xml_font_slanted, xml_font_sc. These four parameters specify the shape. The first one is currently unused. The default translation of {\upshape a}{\itshape b}{\slshape c}{\scshape d}  is a<hi rend='it'>b</hi><hi rend='slanted'>c</hi><hi rend='sc'>d</hi>  or (using elements): a<it>b</it><slanted>c</slanted><sc>d</sc>  You can change it to: a<font-italic-shape>b</font-italic-shape> <font-slanted-shape>c</font-slanted-shape> <font-small-caps-shape>d</font-small-caps-shape>  • xml_font_medium, xml_font_bold. These two parameters specify the series. The first is currently unused. • xml_font_roman, xml_font_tt, xml_font_sansserif. These three parameters specify the family. The first is currently unused. The translation of {\mdseries e}{\bfseries f}{\ttfamily h}{\sffamily h}{\rmfamily i}  is e<hi rend='bold'>f</hi><hi rend='tt'>h</hi><hi rend='sansserif'>h</hi>i  but you can change it to e<bold>f</bold><tt>h</tt><sansserif>h</sansserif>i  or e<font-bold-series>f</font-bold-series> <font-typewriter-family>h</font-typewriter-family> <font-sansserif-family>h</font-sansserif-family>i  • xml_sup_name, xml_sub_name. These two parameters control the name of superscript and subscripts in text mode. • xml_oldstyle_name, xml_overline_name, xml_underline_name. These parameters control the names used for oldstyle numbers, overline and underline. • xml_caps_name, xml_ul_name, xml_hl_name, xml_so_name, xml_st_name. These control element names and attributes defined by the soul package. The translation of \ul{a}\caps{b}\hl{c}\so{d}\st{e} \textsuperscript{f}\textsubscript{g} \oldstylenums{h}\overline{i}\underline{j}  is by default <hi rend='ul'>a</hi><hi rend='caps'>b</hi><hi rend='hl'>c</hi> <hi rend='so'>d</hi><hi rend='st'>e</hi> <hi rend='sup'>f</hi><hi rend='sub'>g</hi> <hi rend='oldstyle'>h</hi><hi rend='overline'>i</hi> <hi rend='underline'>j</hi>  but can be changed to <font-ul>a</font-ul><font-caps>b</font-caps><font-hl>c</font-hl> <font-so>d</font-so><font-st>e</font-st> <font-super>f</font-super><font-sub>g</font-sub> <font-oldstyle>h</font-oldstyle><font-overline>i</font-overline> <font-underline>j</font-underline  • alternate_item. If true or false, it redefines \item to \@item or \@@item. The translation of \begin{itemize} \makeatletter \@item [A]b \@@item [A]b \end{itemize}  is <List type='simple'> <Item id='uid14' Label='A'><p Noindent='true'>b</p> </Item><Label>A</Label> <Item id='uid15'><p Noindent='true'>b</p> </Item></List>  • xml_labelitem_name. This specifies the name of the element containing the optional argument of an \item. Default value is label´. If alternate items are used, it specifies the names of an attribute. • xml_item_name. This specifies the name of the element containing an \item. Default value is item´. • xml_list_name. This is the name of the element generated by list environments like itemize, enumerate and description. • att_user_list. List defined by the list´ environment are by default of type description´. Example \begin{list}{}{} \item[item label] item value \begin{description} \item[first item] okok \item[second item] \begin{itemize} \item First \item Second \begin{enumerate} \item some item \item another one \end{enumerate} \end{itemize} \end{description} \end{list}  This translates by default to <list type='description'><label>item label</label> <item id='uid3'><p noindent='true'>item value</p> <list type='description'><label>first item</label> <item id='uid4'><p noindent='true'>okok</p> </item><label>second item</label> <item id='uid5'> <list type='simple'> <item id='uid6'><p noindent='true'>First</p> </item> <item id='uid7'><p noindent='true'>Second</p> <list type='ordered'> <item id='uid8'><p noindent='true'>some item</p> </item> <item id='uid9'><p noindent='true'>another one</p> </item></list> </item></list> </item></list> </item></list>  It can be changed to: <List type='MyList'> <Item id='uid16' Label='item label'><p Noindent='true'>item value</p> <List type='description'> <Item id='uid17' Label='first item'><p Noindent='true'>okok</p> </Item> <Item id='uid18' Label='second item'> <List type='simple'> <Item id='uid19'><p Noindent='true'>First</p> </Item> <Item id='uid20'><p Noindent='true'>Second</p> <List type='ordered'> <Item id='uid21'><p Noindent='true'>some item</p> </Item> <Item id='uid22'><p Noindent='true'>another one</p> </Item></List> </Item></List> </Item></List> </Item></List>  • xml_gloitem_name. This specifies the name of the element containing the first argument of \glo. Default value is label´. • xml_glo_name. This controls the name of the glossary. • att_gloss_type. In a glossary, a <list> element is created with attribute type=´gloss´. This variable can be used to change the value of the attribute. The translation of \begin{glossaire} \glo{aa}{bb} \glo{cc}{dd} \end{glossaire}  can be <List type='Gloss'> <Head>The famous glossary</Head> <Glolabel>aa</Glolabel><Item><p>bb</p></Item> <Glolabel>cc</Glolabel><Item><p>dd</p></Item> </List>  • xml_head_name. This is the name of the <head> element in a title. • att_nonumber. This is the value of the rend´ attribute for unnumbered sections. • xml_frontmatter_name, xml_mainmatter_name, xml_backmatter_name. These are the name of elements associated to frontmatter, mainmatter and backmatter. • xml_div0_name, xml_div1_name, xml_div2_name, xml_div3_name, xml_div4_name, xml_div5_name, xml_div6_name. This specifies the name of a section. The default translation of \frontmatter \chapter{Chapter one} OK \mainmatter \part{First Part of document} Some text here \part{Second Part} \chapter{Chapter two} \section{Section one} \subsection{Subsection one} \subsubsection{Subsubsection one} \paragraph{First paragraph} \subparagraph{First sub paragraph} Normal text\label{a} \backmatter We are now in the backmatter.\ref{a}\pageref{a}  is <frontmatter> <div1 id='uid1' rend='nonumber'><head>Chapter one</head> <p>OK</p> </div1></frontmatter> <mainmatter> <div0 id='uid2'><head>First Part of document</head> <p>Some text here</p> </div0> <div0 id='uid3'><head>Second Part</head> <div1 id='uid4'><head>Chapter two</head> <div2 id='uid5'><head>Section one</head> <div3 id='uid6'><head>Subsection one</head> <div4 id='uid7'><head>Subsubsection one</head> <div5 id='uid8'><head>First paragraph</head> <div6 id='uid9'><head>First sub paragraph</head> <p>Normal text</p> </div6></div5></div4></div3></div2></div1></div0></mainmatter> <backmatter><p>We are now in the backmatter. <ref target='uid9'/><ref target='uid9' rend='page'/></p> </backmatter>  but you can use these commands to get: <Frontmatter> <Xdiv1 id='uid1' Rend='NoNumber'><Head>Chapter one</Head> <p>OK</p> </Xdiv1></Frontmatter> <Mainmatter> <Xdiv0 id='uid2'><Head>First Part of document</Head> <p>Some text here</p> </Xdiv0> <Xdiv0 id='uid3'><Head>Second Part</Head> <Xdiv1 id='uid4'><Head>Chapter two</Head> <Xdiv2 id='uid5'><Head>Section one</Head> <Xdiv3 id='uid6'><Head>Subsection one</Head> <Xdiv4 id='uid7'><Head>Subsubsection one</Head> <Xdiv5 id='uid8'><Head>First paragraph</Head> <Xdiv6 id='uid9'><Head>First sub paragraph</Head> <p>Normal text</p> </Xdiv6></Xdiv5></Xdiv4></Xdiv3></Xdiv2></Xdiv1></Xdiv0></Mainmatter> <Backmatter><p>We are now in the backmatter. <Ref target='uid9'/><Ref target='uid9' Rend='Page'/></p> </Backmatter>  • xml_fbox_name, xml_scalebox_name, xml_box_name. These control the names of various box commands. • att_boxed. This is the name of the attributed added by \fbox, unless it is a includegraphics. • att_framed. If a figure is in a \fbox, it will have framed=´true´. This changes the name of the attribute. • att_box_width. Name of width attribute for commands like \framebox. • att_box_scale. This controls the name scale attribute, unless in a figure. Example \fbox{foo}\scalebox{0.3}{foo}\framebox(10,10){foo}\framebox[10pt][11]{foo}  translates as <fbox rend='boxed'>foo</fbox> <scalebox scale='0.3'>foo</scalebox> <pic-framebox width='10' height='10' framed='true'>foo</pic-framebox> <fbox width='10.0pt' rend='boxed'>foo</fbox>  You can change it to <Framebox Rendering='Boxed'>foo</Framebox> <Scalebox BoxScale='0.3'>foo</Scalebox> <Xbox Width='10' Height='10' Framed='true'>foo</Xbox> <Framebox BoxWidth='10.0pt' Rendering='Boxed'>foo</Framebox>  • xml_keywords_name. This is the name of the element generated by motscle´ environment. The default value is keywords´. • xml_term_name. This is the name of the element used for each keyword. The default value is term´. For instance, \begin{motscle} first, second, {(max,+)}\end{motscle}  translates to <keywords> <term>first</term> <term>second</term> <term>(max,+)</term> </keywords>  and can be changed to <Keywords> <Term>first</Term> <Term>second</Term> <Term>(max,+)</Term> </Keywords>  • xml_scaption_name. Special caption (outside figure or table). • xml_mbox_name. This is the name of the element used by the \mbox, unless the result is trivial. • xml_rotatebox_name. This is the name of the element generated by \rotatebox. • att_rotate_angle. This controls the name of the angle attribute in the case of \rotatebox. • xml_subfigure_name. This is the name of the element generated by \subfigure. The default value is subfigure´. • xml_texte_name. This is the name of the element generated by \subfigure, containing the required argument. • xml_leg_name. This is the name of the element generated by \subfigure, containing the optional argument. For instance, the translation of \noindent \mbox{\xbox{a}{b}} \rotatebox{30}{x} \subfigure[a]{b}  is <p noindent='true'> <mbox><a>b</a></mbox> <pic-rotatebox angle='30'>x</pic-rotatebox> <subfigure><leg>a</leg><texte>b</texte></subfigure> </p>  but can be changed to <p Noindent='true'> <Xmbox><a>b</a></Xmbox> <Rotatebox Rangle='30'>x</Rotatebox> <Xsubfigure><Leg>a</Leg><Texte>b</Texte></Xsubfigure> </p>  • xml_topic_name, xml_topic_title, att_topic_num. These are used for topics (Raweb only). The default values for the elements are topic´ and t_titre´, for the attribute it is num´. • xml_caption_name, xml_graphics_name, xml_figure_env_name, xml_table_env_name, xml_Table_name. These names are used by some commands and environments. For instance, consider the following code. Normally, you put a tabular in a table, an image in a figure (as in B or D), this gives smaller XML objects. \begin{tabular}{c}a\end{tabular} \caption{A} % \begin{table}[htbp] \begin{tabular}{c}a\end{tabular} \caption{B} \end{table} % \begin{table}[htbp] \includegraphics{a} \caption{C} \end{table} % \begin{figure}[htbp] \includegraphics{a} \caption{D} \end{figure}  This is the default translation: <table rend='inline'><row><cell halign='center'>a</cell></row></table> <p><caption>A</caption></p> <table rend='display' id='uid10'><head>B</head> <row><cell halign='center'>a</cell></row></table> <table rend='display' id='uid11'><head>C</head> <figure rend='inline' file='a'/></table> <figure file='a' id='uid12'><head>D</head></figure>  This shows how all names can be parametrized. <Table Rend='inline'><Row><Cell Halign='Center'>a</Cell></Row></Table> <p><SCaption><p>A</p></SCaption></p> <FloatTable Rend='display' id='uid14'> <Caption><p>B</p></Caption> <Row><Cell Halign='Center'>a</Cell></Row> </FloatTable> <FloatTable Rend='display' id='uid15'> <Caption><p>C</p></Caption> <Figure Rend='inline' File='a'/> </FloatTable> <FloatFigure File='a' id='uid16'> <Caption><p>D</p></Caption> </FloatFigure>  • xml_xref_name. This is the name of the element associated to \url. • xml_project_name. This controls the name of the <projet> element. • xml_accueil_name. This controls the name of the <accueil> element. • xml_composition_ra_name. This controls the name of the <composition> element. In fact, in Raweb mode, when a environment RAsection´ is closed, and the argument of the environment is the value of this variable, then modules inside the element are replaced by their content. • xml_xtheorem_name. This controls the theorem names. This is an example of theorems \theorembodyfont{\sl} \theoremstyle{break} \newtheorem{Cor}{Corollary} \theoremstyle{plain} %\newcounter{section} \setcounter{section}{17} \newtheorem{Exa}{Example}[section] {\theorembodyfont{\rmfamily}\newtheorem{Rem}{Remark}} \theoremstyle{marginbreak} \newtheorem{Lem}[Cor]{lemma} \theoremstyle{change} \theorembodyfont{\small\itshape} \newtheorem{Def}[Cor]{Definition} \theoremheaderfont{\scshape} \def\Lenv#1{\texttt{#1}} \begin{Cor} This is a sentence typeset in the theorem environment \Lenv{Cor}. \end{Cor} \begin{Exa} This is a sentence typeset in the theorem environment \Lenv{Exa}. \end{Exa} \begin{Rem} This is a sentence typeset in the theorem environment \Lenv{Rem}. \end{Rem} \begin{Lem}[Ben User] This is a sentence typeset in the theorem environment \Lenv{Lem}. \end{Lem} \begin{Def}[Very Impressive definition] This is a sentence typeset in the theorem environment \Lenv{Def}. \end{Def}  This is the translation: <p><hi rend='sc'>Corollary 1 </hi><hi rend='slanted'>This is a sentence typeset in the theorem environment </hi> <hi rend='slanted'><hi rend='tt'>Cor</hi></hi><hi rend='slanted'>.</hi></p> <p><hi rend='sc'>Example 17.1 </hi><hi rend='slanted'>This is a sentence typeset in the theorem environment </hi> <hi rend='slanted'><hi rend='tt'>Exa</hi></hi><hi rend='slanted'>.</hi></p> <p><hi rend='sc'>Remark 1 </hi>This is a sentence typeset in the theorem environment <hi rend='tt'>Rem</hi>.</p> <p><hi rend='sc'>lemma 2 (Ben User) </hi><hi rend='slanted'> This is a sentence typeset in the theorem environment </hi><hi rend='slanted'><hi rend='tt'>Lem</hi></hi><hi rend='slanted'>.</hi></p> <p><hi rend='sc'>Definition 3 (Very Impressive definition) </hi><hi rend='small'/><hi rend='small'><hi rend='it'> This is a sentence typeset in the theorem environment </hi></hi> <hi rend='small'><hi rend='it'><hi rend='tt'>Def</hi></hi></hi> <hi rend='small'><hi rend='it'>.</hi></hi></p>  This may be changed to: <BTheorem id='uid29'><p><SC>Corollary 1 </SC> <SL>This is a sentence typeset in the theorem environment </SL> <SL><TT>Cor</TT></SL><SL>.</SL></p> </BTheorem> <BTheorem id='uid30'><p><SC>Example 17.1 </SC> <SL>This is a sentence typeset in the theorem environment </SL> <SL><TT>Exa</TT></SL><SL>.</SL></p> </BTheorem> <BTheorem id='uid31'><p><SC>Remark 1 </SC> This is a sentence typeset in the theorem environment <TT>Rem</TT>.</p> </BTheorem> <BTheorem id='uid32'><p><SC>lemma 2 (Ben User) </SC><SL> This is a sentence typeset in the theorem environment </SL><SL><TT>Lem</TT></SL><SL>.</SL></p> </BTheorem> <BTheorem id='uid33'><p><SC>Definition 3 (Very Impressive definition) </SC> <Small/><Small><IT> This is a sentence typeset in the theorem environment </IT></Small><Small><IT><TT>Def</TT></IT></Small><Small><IT>.</IT></Small></p> </BTheorem>  • xml_theorem_head. This controls the element that contains the optional argument of the theorem, if the alternate syntax is used (default is alt_head, shown as AltHead below). • xml_theorem_name. This is used for theorems. The value of the variable is unused. Redefining the command changes the meaning of \@begintheorem to \@xbegintheorem. As a consequence the translation of the previous theorem is: <BTheorem style='break' type='Cor' id='uid29'> <Head>Corollary</Head> <p>This is a sentence typeset in the theorem environment <TT>Cor</TT>.</p> </BTheorem> <BTheorem style='plain' type='Exa' id='uid30'> <Head>Example</Head> <p>This is a sentence typeset in the theorem environment <TT>Exa</TT>.</p> </BTheorem> <BTheorem style='plain' type='Rem' id='uid31'> <Head>Remark</Head> <p>This is a sentence typeset in the theorem environment <TT>Rem</TT>.</p> </BTheorem> <BTheorem style='marginbreak' type='Lem' id='uid32'> <Head>lemma</Head> <ThHead>Ben User</ThHead> <p>This is a sentence typeset in the theorem environment <TT>Lem</TT>.</p> </BTheorem> <BTheorem style='change' type='Def' id='uid33'> <Head>Definition</Head> <ThHead>Very Impressive definition</ThHead> <p>This is a sentence typeset in the theorem environment <TT>Def</TT>.</p> </BTheorem>  • mfenced_separator_val. If the value of this quantity is X´, then Tralics will add separators = X´ to each <mfenced> that are created (except for fences for arrays, i.e., matrices and the like). The default value is the empty string. If the value is NONE´, no attribute will be added. If the value is mrow´, no attribute is added, but the <mfence> elements has a single child, a <mrow> element being inserted, if needed. Example \left[ a +b \right ] \left(x\right)  This is the translation if the separator is &ThinSpace; <formula type='inline'> <math xmlns='http://www.w3.org/1998/Math/MathML'> <mrow> <mfenced separators='&ThinSpace;' open='[' close=']'> <mi>a</mi><mo>+</mo><mi>b</mi> </mfenced> <mfenced separators='&ThinSpace;' open='(' close=')'> <mi>x</mi> </mfenced> </mrow> [/itex] </formula>  Translation if the value the separator is the empty string (this is the default behavior). No separator added in case where the <mfenced> element has a single child. <formula type='inline'> <math xmlns='http://www.w3.org/1998/Math/MathML'> <mrow> <mfenced separators='' open='[' close=']'> <mi>a</mi><mo>+</mo><mi>b</mi> </mfenced> <mfenced open='(' close=')'><mi>x</mi></mfenced> </mrow> [/itex] </formula>  Translation if the value the separator is mrow´. Here a <mrow> element is added. <formula type='inline'> <math xmlns='http://www.w3.org/1998/Math/MathML'> <mrow> <mfenced open='[' close=']'> <mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow> </mfenced> <mfenced open='(' close=')'><mi>x</mi></mfenced> </mrow> [/itex] </formula>  Translation if the value the separator is NONE´. This is the behaviour of Tralics before 2.9.4. <formula type='inline'> <math xmlns='http://www.w3.org/1998/Math/MathML'> <mrow> <mfenced open='[' close=']'><mi>a</mi><mo>+</mo><mi>b</mi></mfenced <mfenced open='(' close=')'><mi>x</mi></mfenced> </mrow> [/itex] </formula>  • xml_biblio. This controls the name of the element that contains the bibliography. • att_box_pos. This controls the name of the pos attribute in a box. • att_full. If a star follows \circle, an attribute pair full=´true´ is added. This controls the attribute name. • att_table_width. Name of width attribute for a table. • att_pos. Used by environments like minipage´, for the horizontal position. • att_vpos. Used by minipage´, for the vertical position. • att_inner_pos. Used by minipage´, for the third optional argument. • att_minipage_width. Used by minipage´, for the mandatory argument. • xml_figure_name. This controls the name of the element produced by \includegraphics. • att_file, att_angle, att_scale, att_clip, att_width, att_height. These control the attribute names set by \includegraphics. The translation of \fbox{\includegraphics[clip=, angle=90, scale=3, % width=10cm, height=3m]{A}}  is <figure framed='true' rend='inline' height='3m' width='10cm' scale='3' angle='90' clip='true' file='A'/>  You can change it to <Figure Framed='true' Rend='inline' Height='3m' Width='10cm' Scale='3' Angle='90' Clip='true' File='A'/>  • att_rend, att_fbox_rend. These control the name of the rend attribute (why is fbox´ a special case ?) • att_noindent. This is the name of the noindent attribute. • att_space_before. This is the name of the attribute that indicates space between the current paragraph and the element before it. • att_flush_right, att_flush_left, att_quotation, att_quote, att_centering. The five environments center, quote, quotation, flushleft, and flushright modify (locally) an integer that asks each <p> to get an attribute rend with value flushed-left´, flushed-right´, center´ or quote´. These environment execute the equivalent of \par just after the \begin (before the parameter is changed), and just after the \end. The \centering command modifies the integer and the attribute list of the current <p>. These assignments show how to control the value of the attribute. Example: a\\[2pt]b \begin{center}A\end{center} \begin{quote}B\end{quote} \begin{quotation}C\end{quotation} \begin{flushleft}D\end{flushleft} \begin{flushright}E\end{flushright}  The default translation is <p>a</p> <p noindent='true' spacebefore='2.0pt'>b</p> <p rend='center'>A</p> <p rend='quoted'>B</p> <p rend='quoted'>C</p> <p rend='flushed-left'>D</p> <p rend='flushed-right'>E</p>  but you can change it to p>a</p> <p Noindent='true' Spacebefore='2.0pt'>b</p> <p Rend='Center'>A</p> <p Rend='Quote'>B</p> <p Rend='Quotation'>C</p> <p Rend='FlushLeft'>D</p> <p Rend='FlushRight'>E</p>  • att_cell_bottomborder, att_cell_leftborder, att_cell_rightborder, att_cell_topborder. Specifying a \hline in a table, or vertical rules may add attributes to cells. The name is left-border etc. The name of the attribute can be changed via these commands. • att_row_spaceafter, att_row_spacebefore. Inside a table, an optional argument to \\ asks for a space before or after the current row. This is done by adding a spacebefore and spaceafter attribute. The name of the attribute can be changed via this variable. Note: There is no spacebefore in the current version; is this a bug? • att_cols, att_halign, att_cell_left, att_cell_right, att_cell_center. The translation of a command of the form \multicolumn{1}{c}{...} is a cell, with attributes halign=center´ and cols=1´. These parameters allow you to change the name of the attribute name or value. • xml_table_name, xml_row_name, xml_cell_name. These commands allow you to change the names of the elements <table>, <row> and <cell>. The default translation of \begin{tabular}{|r|l|c} \hline a&b&\multicolumn{1}{c|}{x}\hline\\[2pt] \end{tabular}\begin{array}{|r|l|}
a&b&\multicolumn{1}{c|}{x}\\[2pt]
### hbox group (level 5) entered at line 12 (\hbox{)
### semi simple group (level 4) entered at line 12 (\begingroup)
### simple group (level 3) entered at line 11 ({)
### semi simple group (level 2) entered at line 10 (\begingroup)
### semi simple group (level 1) entered at line 9 (\begingroup)
### bottom level


or by Tralics

### cell group (level 5) entered at line 13
### environment group (level 4) entered at line 12
### brace group (level 3) entered at line 11
### \begingroup group (level 2) entered at line 10
### environment group (level 1) entered at line 9
### bottom level


You may wonder why ϵ-TeX uses twice as many stack levels as Tralics. This is because tables are implemented in a different way. For instance, using math mode for tables is very strange; one might wonder what the current mode is, when \tracinggroupd is seen; the answer is restricted horizontal mode, but why? If we insert a \showlist command, we see

### restricted horizontal mode entered at line 13 []
spacefactor 3000
### restricted horizontal mode entered at line 13 []
spacefactor 0
### internal vertical mode entered at line 12
prevdepth ignored
### internal vertical mode entered at line 12
prevdepth ignored
### math mode entered at line 12
### restricted horizontal mode entered at line 12
spacefactor 1000
### horizontal mode entered at line 12 []
spacefactor 1000
### vertical mode entered at line 0
### current page: []


In the same situation, you will see the following lines in the Tralics transcript file. Here, the level is an index in the XML stack, and you can see that the current mode is a´ (for array).

level 0 entered at line 0, type document, mode_v:
<std>
<table rend='inline'><row><cell/></row></table></std>
level 1 entered at line 12, type tabular, mode_v:
<table rend='inline'><row><cell/></row></table>
level 2 entered at line 13, type row, mode_a:
<row><cell/></row>
level 3 entered at line 13, type cell, mode_a:
<cell/>


If you translate the following line in verbose mode

{\the\currentgrouplevel}


you will see the following in the transcript file. The current level outside the group is one, so that you see it increase to 2; but ϵ-TeX shows it as zero, so that the \the inside the group expands to one. The reason for this strange behaviour is that a quantity defined at level zero is never defined; the level is never zero, so that the \the never returns a negative value.

[9] {\the\currentgrouplevel}
{begin-group character}
+stack: level + 2 for brace entered on line 9
{\the}
{\the \currentgrouplevel}
\the->1.
{end-group character}
+stack: level - 2 for brace from line 9


The command \eTeXversion expands to a token list containing the current ϵ-TeX revision. The counter \eTeXversion returns ϵ-TeX´s major version number. Thus

\message{\number\eTeXversion\eTeXrevision}


prints something like 2.0´.

The commands \gluestretchorder, \glueshrinkorder, \gluestretch, \glueshrink can be used when some internal quantity is scanned, for instance after \the. They read some glue and return one part of the glue, it can be the stretch order or the shrink order (an integer between 0 and 3), or the stretch or shrink value (as a dimension). The commands \gluetomu, \mutoglue read and return some glue. The ϵ-TeX manual says: glue is converted into muglue and vice versa by simply equating 1pt with 1mu. Example: we define here a command, whose value will be used later.

\muskip0 = 18mu plus 36mu minus 1 fill
\skip0 = 10pt plus 20pt minus 1 fil
\edef\uselater{%
\the\muskip0,%
\the\mutoglue\muskip0,%
\the\skip0,%
\the\gluetomu\skip0,%
\the\mutoglue\gluetomu\skip0,%
\the\glueshrink\skip0,%
\the\gluestretch\skip0,%
\the\glueshrinkorder\skip0,%
\the\gluestretchorder\skip0}


The commands \detokenize and \unexpanded read a token list. The second command returns the list unchanged, the first one detokenizes it; said otherwise the token list is converted into a character list, of category code 12 (except for space). These commands behave like \the, in that the resulting token list is not expanded, even in a \edef or \write. This example shows how \unexpanded works.

\def\foo{12}\def\equals{<}
\edef\A{\unexpanded{\foo\equals}\foo\relax}
\def\equals{=}
\def\foo{11}


The command \uselater, defined above, should compare equal to \xoo defined here(note: )

{\let\GDEF\gdef\let\XDEF\xdef\def\S{ }
\catcodem=12 \catcodeu=12 \catcodep=12 \catcodef=12
\catcodei=12  \catcodel=12 \catcoden=12 \catcodei=12 \catcodes=12
\catcodet=12
\GDEF\MU{mu}\GDEF\PT{pt}\GDEF\FIL{fil}\GDEF\FILL{fill}%
\GDEF\PLUS{plus}\GDEF\MINUS{minus}
\XDEF\xoo{18.0\MU\S \PLUS\S 36.0\MU\S \MINUS\S 1.0\FILL,%
18.0\PT\S \PLUS\S 36.0\PT\S \MINUS\S 1.0\FILL,%
10.0\PT\S \PLUS\S 20.0\PT\S \MINUS\S 1.0\FIL,%
10.0\MU\S \PLUS\S 20.0\MU\S \MINUS\S 1.0\FIL,%
10.0\PT\S \PLUS\S 20.0\PT\S \MINUS\S 1.0\FIL,%
1.0\PT,20.0\PT,1,0}}


Using \detokenize makes life easier. The test should be true here.

\edef\yoo{\detokenize{18.0mu plus 36.0mu minus 1.0fill,%
18.0pt plus 36.0pt minus 1.0fill,%
10.0pt plus 20.0pt minus 1.0fil,%
10.0mu plus 20.0mu minus 1.0fil,%
10.0pt plus 20.0pt minus 1.0fil,%
1.0pt,20.0pt,1,0}}


As in the case of ϵ-TeX, Tralics provides the notion of expressions of type number, dimen, glue or muglue, that can be used whenever a quantity of that type is needed. Such an expression is read by the scanning mechanism; basically scanint and friends are used to read a quantity, and \multiply and friends are used to perform operations. The four commands that can be used are \numexpr, \dimexpr, \glueexpr and \muexpr. They determine a type t, the type of the result, and read an expression, that is followed by an optional \relax (that will be read). When scanning for an operator or the end of an expression, spaces are discarded. An expression consists of one or more terms of type t, that are added or subtracted. A term of type t consists of an initial factor of type t, multiplied or divided by a numeric (integer) factor. Finally, a factor is either a quantity of type t, or a parenthesized expression. Example.

\ifdim \dimexpr(2pt-5pt) *\numexpr 3-3*13/5\relax + 34pt/2=32pt


Here the \relax terminates the \numexpr. This is the trace. You will see expr so far when a term is converted into an expression (prefix =´), or after an addition or subtraction (prefix +´ or -´). You will see term so far after a multiplication or division (prefix ´*´ or ´/´) or a scaling (prefix backslash). In the case of $a*b/c$, a 64bit intermediate product is computed.

[8] \ifdim \dimexpr(2pt-5pt) *\numexpr 3-3*13/5\relax + 34pt/2=32pt
+\ifdim1
+scanint for \dimexpr->2
+scandimen for \dimexpr->2.0pt
+expr so far for \dimexpr= 2.0pt
+scanint for \dimexpr->5
+scandimen for \dimexpr->5.0pt
+expr so far for \dimexpr- -3.0pt
+scanint for \numexpr->3
+expr so far for \numexpr= 3
+scanint for \numexpr->3
+scanint for \numexpr->13
+scanint for \numexpr->5
+term so far for \numexpr\ 8
+expr so far for \numexpr- -5
+scan for \numexpr= -5
+scanint for \dimexpr->-5
+term so far for \dimexpr* 15.0pt
+expr so far for \dimexpr= 15.0pt
+scanint for \dimexpr->34
+scandimen for \dimexpr->34.0pt
+scanint for \dimexpr->2
+term so far for \dimexpr/ 17.0pt
+expr so far for \dimexpr+ 32.0pt
+scan for \dimexpr= 32.0pt
+scandimen for \ifdim->32.0pt
+scanint for \ifdim->32
+scandimen for \ifdim->32.0pt
+iftest1 true


Note that 3*13/5 is 8-1/5, and this is rounded to 8. In the case of \divide, the result is truncated. All intermediate expressions are checked for overflow(note: ), which is ${2}^{31}$ for an integer, and ${2}^{30}$ otherwise (in magnitude). This means that dimensions and components of glue must be less than ${2}^{14}$ in units of pt, mu or fil.

One important point is that these operations do no side effects, hence can be used inside an \edef. If used out of context, you can see error messages like You can´t use \numexpr´ in horizontal mode, (the messages depends on the current mode), in Tralics, the error is Read only variable \numexpr, because these operations are implemented as the value of a read only variable. Example

\def\foo#1#2{\number#1
\ifnum#1<#2, %
\expandafter\foo
\expandafter{\number\numexpr#1+1\expandafter}%
\expandafter{\number#2\expandafter}%
\fi}

\edef\Bar{\foo{7}{13}}
\def\xBar{7, 8, 9, 10, 11, 12, 13}



The integer \lastnodetype returns a number indicating the type of the last node, if any, on the current list. This is not implemented in Tralics, and the value is always zero.

The \interactionmode command allows you to get or set the current interaction mode, an integer between 0 and 3. Setting it is no-op in Tralics (no error signaled), the value is always zero (this is batchmode in TeX, which is more or less the only mode of interaction of Tralics).

The commands \fontcharwd, \fontcharht, \fontchardp, \fontcharic can be used to get some information about characters; do not use them to set a value. The command reads a font identifier, and a character position; if the character does not exists, the value is zero, otherwise the width, height, depth or italic correction. In the following example, Tralics shows 0 for the interaction mode, and 0.0pt for the other values; in ϵ-TeX, only the italics correction is zero.

{
\showthe\interactionmode
\interactionmode=2
\showthe\fontcharwd\fontq
\showthe\fontcharht\fontq
\showthe\fontchardp\fontq
\showthe\fontcharic\fontq
}
\showthe\interactionmode


The commands \parshapelength, \parshapeindent, read an integer n; they return the length or indentation of the line n in the current parshape; the command \parshapedimen reads $2n$ or $2n+1$, and returns one of these quantities, depending on the parity of the argument. Example: in the following code, the \bad macro is not called.

\parshape 3 1pt 2pt 3pt 4pt 5pt 6pt
\ifnum\parshape         = 3 \else\bad\fi
\ifdim\parshapelength 1 = 2.0pt\else\bad\fi
\ifdim\parshapeindent 2 = 3.0pt\else\bad\fi
\ifdim\parshapedimen 4  = 4.0pt\else\bad\fi
\ifdim\parshapedimen 5  = 5.0pt\else\bad\fi
\ifdim\parshapedimen 6  = 6.0pt\else\bad\fi
\ifdim\parshapedimen 7  = 5.0pt\else\bad\fi
\ifdim\parshapedimen 0  = 0.0pt\else\bad\fi
\parshape 0
\ifdim\parshapedimen 1  = 0.0pt\else\bad\fi


The four commands \interlinepenalties, \clubpenalties, \widowpenalies, as well as \displaywidowpenalties can be used to get or set penalties. The values are read, but not used by Tralics. The syntax is the following. In a set context, an optional equals sign is read, followed by an integer n. If the integer is positive, then n integer values are read and stored, otherwise the table is cleared. In a get context, an integer n is read, and the result is an integer; if n is negative, this is zero, if n is zero it is the length of the table, if n is positive it is the value found in the table (or the last value if n is too big). Example: in the following code, the \bad macro is not called.

\interlinepenalties=3 1 2 3
\clubpenalties=3 11 12 13
\widowpenalties=3 101 102 103
\displaywidowpenalties=3 1001 1002 1003
\widowpenalties= -1
\edef\foo{%
\the\interlinepenalties 1
\the\clubpenalties\interlinepenalties2
\the\displaywidowpenalties -1
\the\displaywidowpenalties 0
\the\displaywidowpenalties 4
\the\widowpenalties 0}
\def\xfoo{1120310030}


The command \showtokens reads a token list, and prints it on the terminal and transcript file. As the example below shows, the start of the token list is obtained by expanding tokens and ignoring \relax until a brace (implicit or explicit) is found.

\showtokens \expandafter{\jobname}
\showtokens \expandafter{\tralicsversion }


The command \readline has the same syntax as \read, it is followed by a channel number, a to keyword, and a definable command. It reads a line from a file, and puts it in the command. The difference is that all characters are assumed of category code 12, except space that has its standard category code; only one line is read, since the result is always properly nested.

The command \everyeof holds a token list, like \everypar, that is inserted at the end of every file, or virtual file.

The counter \lastlinefit contains an integer, that is used by ϵ-TeX to set the glue in the last line of a paragraph. For each line, the actual space used by by a glue item of the form 10pt plus 4pt minus 3pt is $10+4f$ or $10-3f$, depending on whether the natural width is too big or too small. The last line of a paragraph is generally terminated by an infinite stretchable glue, so that the glue factor f for normal glue is zero. In ϵ-TeX, you can use the same factor as the previous line, or an interpolation ($l/1000$ times the factor of the previous line), where l is the value of \lastlinefit, or 0 if negative, or 1000 if greater than 1000. Not used in Tralics.

The integer quantity \savinghyphcodes, when positive, tells ϵ-TeX to store the current \lccode table together with the hyphenation table of the current language. See ϵ-TeX documentation for why it is useful to store such a table; not used in Tralics.

When TeX´s page builder transfers material from the recent contribution´ to the page so far´, it discards discardable items preceding the first box or rule on the page. When ϵ-TeX´s parameter \savingdiscards is positive, these discarded items are stored in a special list; the command \pagediscards reinserts these items (and clears the list). The same holds for \vsplit, the command is then \splitdiscards.

The \middle command is not implemented in Tralics. This is a math-only command that reads a delimiter, and should be placed between \left and \right, more than one such command can be used. The height of the delimiter of \left, \right and \middle is the height of the formula, from \left to \right.

The six commands \marks, \firstmarks, \topmarks \botmarks, \splitfirstmarks, and \splitbotmarks generalise commands like \mark, they read an integer N, and set a mark at position N, or get the mark at position N. No error is signalled if N is out of range.

There is a possibility to type text from, left to right or right to left in ϵ-TeX. Not implemented in Tralics. The use of these features is controlled by the integer \TeXXeTstate.

The integer \predisplaydirection contains the text direction preceding a display. The commands \beginL, \beginR, \endL, \endR mark the start and end of a left-to-right or right-to-left region.

## 6.13. Bootstrap code

The transcript file of Tralics contains a line for each use of \dimendef or friends. Here is the list of all standard definitions (for Tralics version 2.12). Note that \count@ is counter 255, while \dimen@ is dimension 0. The names (and values) of the commands \z@, \@ne, \tw@, \thr@@, \sixt@@n, \@cclv, \@cclvi, \m@ne, \@m, \@M, \@Mi, \@Mii, \@Miii, \@Miv, \@MM, were chosen by Knuth (maybe Lamport). The values are 0, 1, 2, 3, 16, 255, 256, -1, 1000, 10000, 10001, 10002, 10003, 10004, and 20000. These numbers were typeset via \number\@MM.

Remember that the internal name of the LaTeX counter enumi´ is \c@enumi.

\trivialmath=1
{\countdef \count@=\count255}
{\countdef \c@page=\count0}
{\dimendef \dimen@=\dimen0}
{\dimendef \dimen@i=\dimen1}
{\dimendef \dimen@ii=\dimen2}
{\dimendef \epsfxsize=\dimen11}
{\dimendef \epsfysize=\dimen12}
{\chardef \@ne=\char1}
{\chardef \tw@=\char2}
{\chardef \thr@@=\char3}
{\chardef \sixt@@n=\char16}
{\chardef \@cclv=\char255}
{\mathchardef \@cclvi=\mathchar256}
{\mathchardef \@m=\mathchar1000}
{\mathchardef \@M=\mathchar10000}
{\mathchardef \@Mi=\mathchar10001}
{\mathchardef \@Mii=\mathchar10002}
{\mathchardef \@Miii=\mathchar10003}
{\mathchardef \@Miv=\mathchar10004}
{\mathchardef \@MM=\mathchar20000}
{\chardef \active=\char13}
{\tokesdef \toks@=\toks0}
{\skipdef \skip@=\skip0}
{\dimendef \z@=\dimen13}
{\dimendef \p@=\dimen14}
{\dimendef \oddsidemargin=\dimen15}
{\dimendef \evensidemargin=\dimen16}
{\dimendef \leftmargin=\dimen17}
{\dimendef \rightmargin=\dimen18}
{\dimendef \leftmargini=\dimen19}
{\dimendef \leftmarginii=\dimen20}
{\dimendef \leftmarginiii=\dimen21}
{\dimendef \leftmarginiv=\dimen22}
{\dimendef \leftmarginv=\dimen23}
{\dimendef \leftmarginvi=\dimen24}
{\dimendef \itemindent=\dimen25}
{\dimendef \labelwidth=\dimen26}
{\dimendef \fboxsep=\dimen27}
{\dimendef \fboxrule=\dimen28}
{\dimendef \arraycolsep=\dimen29}
{\dimendef \tabcolsep=\dimen30}
{\dimendef \arrayrulewidth=\dimen31}
{\dimendef \doublerulesep=\dimen32}
{\dimendef \@tempdima=\dimen33}
{\dimendef \@tempdimb=\dimen34}
{\dimendef \@tempdimc=\dimen35}
{\dimendef \footnotesep=\dimen36}
{\dimendef \topmargin=\dimen37}
{\dimendef \footskip=\dimen40}
{\dimendef \columnsep=\dimen41}
{\dimendef \columnseprule=\dimen42}
{\dimendef \marginparwidth=\dimen43}
{\dimendef \marginparsep=\dimen44}
{\dimendef \marginparpush=\dimen45}
{\dimendef \maxdimen=\dimen46}
{\dimendef \normallineskiplimit=\dimen47}
{\dimendef \jot=\dimen48}
{\dimendef \paperheight=\dimen49}
{\dimendef \paperwidth=\dimen50}
{\skipdef \topsep=\skip11}
{\skipdef \partopsep=\skip12}
{\skipdef \itemsep=\skip13}
{\skipdef \labelsep=\skip14}
{\skipdef \parsep=\skip15}
{\skipdef \fill=\skip16}
{\skipdef \@tempskipa=\skip17}
{\skipdef \@tempskipb=\skip18}
{\skipdef \@flushglue=\skip19}
{\skipdef \listparindent=\skip20}
{\skipdef \hideskip=\skip21}
{\skipdef \z@skip=\skip22}
{\skipdef \normalbaselineskip=\skip23}
{\skipdef \normallineskip=\skip24}
{\skipdef \smallskipamount=\skip25}
{\skipdef \medskipamount=\skip26}
{\skipdef \bigskipamount=\skip27}
{\skipdef \floatsep=\skip28}
{\skipdef \textfloatsep=\skip29}
{\skipdef \intextsep=\skip30}
{\skipdef \dblfloatsep=\skip31}
{\skipdef \dbltextfloatsep=\skip32}
{\countdef \m@ne=\count20}
{\countdef \c@FancyVerbLine=\count21}
{\countdef \c@enumi=\count22}
{\countdef \c@enumii=\count23}
{\countdef \c@enumiii=\count24}
{\countdef \c@enumiv=\count25}
{\countdef \c@footnote=\count26}
{\countdef \c@part=\count27}
{\countdef \c@chapter=\count28}
{\countdef \c@section=\count29}
{\countdef \c@subsection=\count30}
{\countdef \c@subsubsection=\count31}
{\countdef \c@paragraph=\count32}
{\countdef \c@subparagraph=\count33}
{\countdef \c@mpfootnote=\count34}
{\countdef \c@bottomnumber=\count35}
{\countdef \c@topnumber=\count36}
{\countdef \@tempcnta=\count37}
{\countdef \@tempcntb=\count38}
{\countdef \c@totalnumber=\count39}
{\countdef \c@dbltopnumber=\count40}
{\countdef \interfootnotelinepenalty=\count41}
{\countdef \interdisplaylinepenalty=\count42}
{\toksdef \@temptokena=\toks11}
{\chardef \@tempboxa=\char11}
{\chardef \voidb@x=\char12}


At the start of the run, some commands are created; we start with commands that take no argument, whose expansion is formed of characters only.

• \lq, \rq (left and right quotes). Expansion is ´ and '´.

• \lbrack, \rbrack (left and right brackets) expansion is [´ and ]´.

• \xscale, \yscale, \xscaley, \yscalex. Expansion is one, one, zero, zero (in fact 1.0´ and 0.0´).

• \textfraction, \floatpagefraction, \dblfloatpagefraction,\bottomfraction,       \dbltopfraction, \topfraction. Parameters for float placement. Expansion is 20%, 50%, 50%, 30%, 70%, and 70%, in the form of .7´ for instance.

• \@vpt, \@vipt, \@viipt, \@viiipt, \@ixpt, \@xpt, \@xipt, \@xiipt, \@xivpt, \@xviipt, \@xxpt, \@xxvpt. Font sizes. Expansion is 5, 6, 7, 8, 9, 10, 10.95, 12, 14.4, 17.28, 20.74 and 24.88.

• \@height, \@depth, \@width, \@plus, \@minus. Expansion is the name of the command without the at-sign. In the LaTeX kernel, you can see \vskip \z@ \@plus.2\p@´ instead of the more obvious \vskip 0pt plus 0.2pt´.

• \encodingdefault, \familydefault, \seriesdefault, \shapedefault: This default the current font as T1+cmr/m/n.

• \I, \J. Uppercase version of \i and \j. Expansion is I or J.

• \baselinestretch, \arraystretch: expansdion is 1.

• \space, \thinspace, \@headercr\headercr"@headercr: Expansion is a single space character.

• \refname expands to Bibliography´.

• \footcitesep, \citepunct. Expansion is comma space for both commands.

• \fmtname expands to Tralics´.

We continue with more complicated commands:

• \@spaces. Expansion is four \space.

• Space, sharp, underscore, newline, as active characters, are defined to be equivalent, respectively, to \space, \#, \_ and \par.

• An active & character produces &.

• An active form-feed character is an outer \par.

• The tilde and no-breakspace (character 160) expand to \nobreakspace.

• \obeyspaces makes the space character active.

• \@vobeyspaces makes the space character active, and defines it to be \nobreakspace.

• \obeylines makes newline character active (and defines it to be \par).

• The sloppypar environment expands to \par in the begin and end part.

• The command \hb@xt@ is a short hand for \hbox to.

• The \null command produces an empty box. This is invisible, but some rules will be applied differently (for instance it can inhibit ligatures).

• \labelitemi, \labelitemii, \labelitemiii, and \labelitemiv produce a bullet, endash, asterisk centered, and period centered, via \textbullet, etc.

• The guillemets environment produces \guillemotleft and \guillemotright

• \@thirdofthree reads three arguments, and expands to the last.

• \@carcube reads three arguments and returns them. Moreover, it reads and discards all tokens up to \@nil.

• The \date command takes an argument that LaTeX puts in \@date which is filled with \today. The \today command is defined in some classes using English month names, and some packages (using local names). In Tralics, the default is a numeric list like 2006/10/12 19:14:59´ (this is the same string that appears in the transcript file). The \date command produces a <date> element with the arguments.

• The commands \markright and \markboth take one or two arguments and call \mark; since \mark does nothing in Tralics, the implementation is oversimplified; it modifies the command \@themark.

• \mod, \bmod, \pmod, \pod are commands that take one argument,they are different implementation of the modulo operator.

• The six following commands \chaptermark, \sectionmark, \subsectionmark, \subsubsectionmark, \paragraphmark, and \subparagraphmark are defined by compatibility with LaTeX to take an argument and ignore it. These commands are redefined by standard classes(note: ) and typically call \markboth or \markright.

• The command \@addnl inserts a newline in the XML tree.

• \addto@hook takes two arguments A and B. First argument is assumed to be a reference to a token list (for instance \everypar). The tokens in the the list B are put at the end of A.

• \g@addto@macro takes two arguments A and B. First argument is assumed to be a macro that takes no argument. The tokens in the the list B are put at the end of A. Assignment is global.

• The command \@setmode scans an integer. Values outside the range 0-6 are replaced by 0. Other values correspond to argument mode (0), or horizontal mode (1), or vertical mode(2), no mode (3), bibliographic mode (4), array mode (5), mathmode (6). Do not use this command if you do not understand the consequences. In a case like 1\@setmode 2 \space3 4 5\par, there is no space between 1 and 3, because we are vertical mode, horizontal mode is entered when the the digit 3 is seen. In a case like 1\@setmode 4 \space3 4 5\par there is no space at all since they are ignored in bib mode. The \par command is ignored as well, so you had better to add \@setmode1 or enclose everything in a group.

• \x@tag and \y@tag are internal macros for equation tags.

We show here the meaning of \@sanitize, \@nnil and \do.

\@sanitize=macro: ->\@makeother \ \@makeother \\\@makeother \$\@makeother \&\@makeother \#\@makeother \^\@makeother \_\@makeother \%\@makeother \~. \dospecials=macro: ->\do \ \do \\\do \$\do \&\do \#\do \^\do \_\do \%\do
\~\do \{\do \}.
\@nnil=macro: ->\@nil .


The page counter is \count0. We first define \c@page, via \countdef, then \cl@page to be empty, \c@page to be one, and \thepage to use arabic numbers; the \pagenumbering command redefines the \thepage. The command \p@page is not defined because \p@foo is used only for printing the label associated to the counter (if you want the page number of reference foo´, use \pageref). Note that in Tralics, the page counter is never modified, \pageref is the same as \ref. Consider a reference to the page containing the start of the verbatim environment we are commenting: . In LaTeX, the value of \@currentlabel is considered, in Tralics, the current anchor is used instead; this works well for \ref. The current label is defined here:6.13, at the start of the section. For the HTML version of the document, we have cheated a bit. We have added an \index command, and this inserts an anchor after the word bootstrap´; the label follows the \index. The \pageref command uses this label. Note that the \anchor command adds an anchor, but this is not defined by LaTeX. The commands defined here produce a <pagestyle> element.

  \def\pagenumbering#1{\xmlelt{pagestyle}{\XMLaddatt{numbering}{#1}}}


We show now the remaining of the bootstrap code. We start with filling some registers.

[1] %% Begin bootstrap commands for latex
[2] \@flushglue = 0pt plus 1fil
[3] \hideskip =-1000pt plus 1fill
[4] \smallskipamount=3pt plus 1pt minus 1pt
[5] \medskipamount=6pt plus 2pt minus 2pt
[6] \bigskipamount=12pt plus 4pt minus 4pt
[7] \z@=0pt\p@=1pt\m@ne=-1 \fboxsep = 3pt %
[8] \c@page=1 \fill = 0pt plus 1fill
[9] \paperheight=297mm\paperwidth=210mm
[10] \jot=3pt\maxdimen=16383.99999pt


The two commands defined here take as argument either a character or a one character command.

[33] \def\@makeother#1{\catcode#1=12\relax}
[34] \def\@makeactive#1{\catcode#1=13\relax}


Other commands

[11] \def\newfont#1#2{\font#1=#2\relax}
[12] \def\symbol#1{\char #1\relax}
[16] \newenvironment{cases}{\left\{\begin{array}{ll}}{\end{array}\right.}%
[19] \def\stretch#1{\z@ \@plus #1fill\relax}
[21] \def\@namedef#1{\expandafter\def\csname #1\endcsname}
[22] \def\@nameuse#1{\csname #1\endcsname}
[23] \def\@arabic#1{\number #1}
[24] \def\@roman#1{\romannumeral#1}
[25] \def\@Roman#1{\Romannumeral#1}
[30] \def\LaTeXe{\LaTeX2$\epsilon$}
[32] \def\enspace{\kern.5em }
[35] \def\root#1\of{\@root{#1}}
[40] \def\eqref#1{(\ref{#1})}
[43] \def\on@line{ on input line \the\inputlineno}
[47] %% End bootstrap commands for latex


## 6.14. Standard packages

Version 1 of this document described the status of standard packages for Tralics2.9. It has been withdrawn. The list of all packages, with documentation, is be found on the web.

## 6.15. Images

We give here some examples of the \includegraphics command. We consider a file with the following content. Notice that the clip attribute is set to true if clip´ appears in the list, whether or not a value has been given. A colon and an underscore in a file name is never interpreted. The extension is always removed:

\let\IC=\includegraphics
\def\FILE{Logo-INRIA-couleur}
\IC[angle=0,width=3cm,clip=]{\FILE}
\IC[angle=20,width=.5\textwidth,height=.3\textheight]{\FILE.ducon}
\IC[angle=0,width=\columnwidth,height=\textheight]{\FILE.foo_bar}
{\language=1 a:c
\IC[angle=0, =foo,,width=3cm,scale=1,scale=2,clip]{../../a_b:c}
}
\framebox{\includegraphics{x_.ps}}


We continue with an example of \epsfbox.

{
\setlength\epsfxsize{50pt}
\setlength\epsfysize{60pt}
\epsfbox{x.ps}
\setlength\epsfysize{70pt}
\epsfbox{x.eps}
\epsfbox{x.epsf}
}


Tralics pretends that there are 4 different images. The translation is:

<figure rend='inline' clip='true' width='3cm' file='Logo-INRIA-couleur'/>
<figure rend='inline' height='6.cm' width='7.5cm'
angle='20' file='Logo-INRIA-couleur'/>
<figure rend='inline' height='20.cm' width='15.cm'
file='Logo-INRIA-couleur'/>
a :c
<figure rend='inline' clip='true' scale='2' width='3cm' file='../../a_b:c'/>
<figure framed='true' rend='inline' file='x_'/></p>
<figure height='60.0pt' width='50.0pt' rend='inline' file='x'/>
<figure height='70.0pt' rend='inline' file='x'/>
<figure rend='inline' file='x'/>


The file \jobname.img´ contains the following. The last number is the number of times the image was included. The second number explains in which format the file has been found. Whether or not the image file is found is irrelevant. The information given in the file is for information only.

# images info, 1=ps, 2=eps, 4=epsi, 8=epsf, 16=pdf, 32=png, 64=gif
see_image("Logo-INRIA-couleur",1+16,3);
see_image("../../a_b:c",0,1);
see_image("x_",0,1);
see_image("x",0,3);


## 6.16. The puzzle

The only requirements for the xii file is that ~ is an active character, \ has category code 0, % is a comment character, the end of line character is as usual. The file modifies the category code of 7, F, j and P, in such a way that jdefjx71F71P´ is the same as \def\x#1{#1}´. This is one way of making the code incomprehensible, the other is to use commands so that six´, geese´ and laying´ are replaced by /sx´, Yegse´ and RyalD´. The programs make the letter H active and defines it via AHHFLP´. For those who want to write puzzles like this one: is it possible to avoid doubling the H? Without using all these strange commands, the file could be written as

\let~\catcode ~A13 \defA#1{~#113\def}
AZZ{}APP{\par}AXX#1{\bigskip On the #1 day of Christmas my true love gave to me}
ABB{PZAZZ{and }a partridge in a pear tree.}
ACC{Ptwo turtle doves}
AEE{Pfour calling birds}
AFF{Pfive gold rings}
AGG{Psix geese a laying}
AHH{Pseven swans a swimming}
AII{Peight maids a milking}
AKK{Pten lords a leaping}
ALL{Peleven pipers piping}
AMM{Ptwelve drummers drumming}
\def\F#1#2#3{}AVV#1\fi{\fi#1}
ATT#1 #2,#3:{\if.#3.\elseT#3:\fiX{#1}\U#1 #2,#3:}
\def\U#1#2#3#4 #5,#6{\F#1#2#3#5\if:#6\elseV\U#6\fi}
Ttwelfth M,eleventh L,tenth K,ninth J,eighth I,seventh H,sixth G,fifth
F,fourth E,third D,second C,first B,:\bye


The size of the file is 698 characters (compare to the 767 of the xii file). Note how the double loop is constructed. The xii file is made obscure by replacing B, C, D etc., by expression that have the same expansion, using instead of \F a command that uses some characters (because nine´ and ninth´ start with the same letters, etc.) An interesting point is that we can write a smaller file, with all loops unrolled, replacing the last 5 lines by the following (this makes a total of 642 characters):

X{first}BX{second}CBX{third}DCBX{fourth}EDCBX{fifth}FEDCBX{sixth}GFEDCB
X{seventh}HGFEDCBX{eighth}IHGFEDCBX{ninth}JIHGFEDCBX{tenth}KJIHGFEDCB
X{eleventh}LKJIHGFEDCBX{twelfth}MLKJIHGFEDCB\bye
`
Back to main page