# LaTeX

How does UDO create the LaTeX preamble?

UDO knows which language and which document style you use. Furthermore UDO knows if you are using indices or not. So UDO knows enough to create the LaTeX preamble on its own.

How can I make files for LaTeX2e?

By default UDO saves files for LaTeX 2.09. If you use the switch !tex_2e inside the preamble UDO will save a preamble and other special commands for LaTeX2e.

I want to use a userdefined preamble!?

In contrast to the previous UDO version UDO Release 6 will save a LaTeX preamble automatically for LaTeX 2.09 or LaTeX2e.

If you don't like the automatically generated preambles you tell UDO not to save them by using the switch !no_preamble [tex] inside the preamble of your UDO source file.

In this case you can enter the special LaTeX commands at the beginning of the UDO source file with !raw [tex] or a raw environment.

The following example shows how you can do this:

```!no_preamble [tex]

# Uncomment the following line for LaTeX 2.09
# !tex \documentstyle[12pt]{article}

# Uncomment the following lines for LaTeX2e
!tex_2e
!raw [tex] \documentclass[12pt,a4paper]{article}
!raw [tex] \usepackage{a4}

!begin_document
!node Example
This example uses a userdefined (!LaTeX) preamble.
!end_document

```
How can I use LaTeX formulas inside the text?

Use a raw environment for complete paragraphs or definitions for floating text. An example:

```!ifdest [tex]
!define ab2 \$(a+b)^2 = a^2 + 2ab + b^2\$
!else
!macro  ab2 (a + b)^2 = a^2 + 2ab + b^2
!endif
...
The first binomial theorem: (!ab2)
```
How does UDO translate special chars in indices?

Special characters are translated especially for makeindex. It is not necessary to adjust the UDO-generated LaTeX files.

You have to use a } for any { inside an index entry and vice versa. Otherwise LaTeX will print an error message.