A sample file for Tralics

Author: José Grimm

Keywords: Latex, XML, HTML, UTF8, Hàn.


This document shows some commands of Tralics. We use it also to show that characters are converted into the right encoding in a lot of situations, including commands, titles, indices etc.

Short Table of Contents

Table of Contents
1. Who is Hàn
2. Short Verb, as in $_

Table of contents

1. Who is Hàn
2. Short Verb, as in $_

1. Who is Hàn

If you call tralics with options -te1a ou -te8a, the terminal should show ^^e0(note: ) for the section title; if you say -te1, there is a single byte, if you say -te8, there are two bytes. If you say -e1a or -e8a, the XML file should contain &#E0;, in the case -oe1 ou -oe8, the XML file contains the characters shown on the terminal.

The following lines try to demonstrate that Tralics handles 16bit characters. An error will be signaled because the argument is out of range; but the character with hex value 312 should be valid; the command defined here by csname has two characters in its name, it must be followed by an exclamation point (a space is allowed between the command an the exclamation point). 123! 123! 312!

This is standard verbatim: a _bç, a␣_bç, a _bç, \verb+ { } $$, +x+. Think about this last example. We index here a word. Location is just before period. This is a verbatim environment

{\let\rm\bf \bf totoé}

<!--this is a comment -->

&Dollar; not &Equals; &Euro;

{\let\rm\bf \bf totoé} $ not = €

Note. A verbatim environment neutralises meaning of some commands. The last line of the verbatim environment should start with an ampersand character; since this is a special character in XML, it is represented as &amp; or &#x26;. Lines can be numbered; spaces can be replaced by non-breaking ones; lines can use special fonts; paragraphs can be no-indented, etc.

On the other hand, a rawxml environment is left unchanged. Remember however that end-of-line characters and spaces are removed from the end of the line; a new line character is added at the end of the line. If you remove the comment between the two environments, replacing it by an empty line, then the second environment will be in vertical mode. Otherwise, the end of the verbatim environment inserts a \noindent, and the environment that follows is in horizontal mode. As a consequence, there will be a P element on the first line of the raw xml; moreover, since the final space in a paragraph is removed, you will find the end-P element at the end of the line.

The translation of the environement contains e-acute (its representation depends on the output encoding), three ampersand characters, a less than sign, a greater than sign. The second line is a valid XML comment, the third line is well-formed XML (it contains three entities, so that the XML is valid only if the DTD defines these entities); it is very easy to produce invalid and ill-formed XML.

The xmllatex command is to be used with care. It can produce Hàn Thế Thành(note: ). The second argument is meant to be translated by LaTeX, it is ignored by Tralics. Instead of \xmllatex{foo}{bar}, define a command, use it in the text, and overwrite it in a ult file (user configuratin file).

In the current version, you can say ế because the double-accent mechanism is implemented, or ế, this is a character, as valid as the other ones. This is possible and dangerous too TeX.

A verbatim test. We put some stuff in English and French before, in order to show how it is translated differently. The end of the environment can contain spaces (see example above), but nothing else. test ligatures: <<>>``´´– et — ! test ligatures : «  »«  »– et — !

1 test : !@#$%^&*()_$

2 test : {\foo\} et zxcvbnm,./

3 test ZXVBNM<>? ~

4 test \verb+\verb-xx-+

5 test ligatures: <<>>``''-- et --- !

6  \end{verbatim} Not this one

7 \end{notverbatim}

Verbatim without line numbers.

test : !@#$%^&*()_$

test : {\foo\} et zxcvbnm,./

test ZXVBNM<>? ~

test \verb+\verb-xx-+

test ligatures: <<>>``''-- et --- !

test BL : \\738! et \\838!.

The BL test is funny ; why should it fail ? a long long time ago, before it was called Tralics, our translator was written in Perl, and such a line was illegal ; the math was converted by Omega, see [2]. We cite also 2001, and Carlisle, Ion, Miner, Poppelier (editors).

We now test the verbatim extensions. We start with Verbatim and demonstrate the counting possibilites

1 test line 1a

2 test line 1b

and without numbers

[numbers=true]test line 2a

[numbers=true]test line 2b

1 The environment has an optional argument; spaces but no newlines are allowed

2 between brace and bracket; what follows the argument on the line is ignored

We put here the first character of the line in italics

5 5 we use here counter number 3

6 6 for counting lines

Define our Verbatim hook now.

7 7 we use here counter number 03 (the same)
8 8 but the HTML output differs a lot.
9 9 we use here counter named vbcounter
10 10 initialised to the value of the previous counter
11 11 yet another verbatim line (ok with é^^e9?)
1 note that, if no counter is specified, it is FancyVerbLine
2 and that the first line is numbered one by default.
3 Of course, options given the line have precedence over options
4 inherited from the definition.

In French, centré means centered.

2. Short Verb, as in $_

Test of \DefineShortVerb and \UndefineShortVerb. Normally the bar is used, but 16bit characters are possible. Example, with itrema : toto x +x- |t|, and without : toto ïxï +x- ïtï Spaces : like this + + or that +␣+ Verbatimfoo : +␣foo␣+*foo*foo*.

Test of useverb A}A, A}A,A|A, A$_A.




[1] David Carlisle, Patrick Ion, Robert Miner, Nico Poppelier (editors). Mathematical Markup Language (MathML) Version 2.0. http ://www.w3.org/TR/MathML2/, 2001.

[2] Yannis Haralambous, John Place. Produire du MathML et autres ...ML à partir d´Ω : Ω se généralise. in « Cahiers Gutenberg », number 33-34, pages 173-182, 1999.

[3] Michael Kay. XSLT, Programmer´s Reference. edition 2nd, Wrox Press Ltd, 2001.


- verb: , , .
- vérb: , , .
     vèrb: .


Note 1. Index here

Note 2. Hàn is the author of pdftex