3.5 Configuration

LaTeX export can be configured with a configuration file. The configuration is read from several sources:

The configuration file is an xml file, here are the default contents:

<config>

  <option name="create_document_config" value="true" />

  <option name="backend" value="generic" />

  <option name="inputencoding" value="ascii" />

  <option name="greek_math" value="true" />

  <option name="use_pifont" value="false" />

  <option name="use_ifsym" value="false" />

  <option name="use_wasysym" value="false" />

  <option name="use_bbding" value="false" />

  <option name="use_hyperref" value="true" />

  <option name="use_endnotes" value="false" />

  <option name="use_ulem" value="false" />

  <option name="use_bibtex" value="false" />

  <option name="bibtex_style" value="plain" />

  <option name="main_paragraph_style" value="" />

  <option name="ignore_unknown_paragraph_styles" value="false" />

  <option name="hard_paragraph_formatting" value="hard" />

  <option name="ignore_list_label_styles" value="false" />

  <option name="ignore_heading_styles" value="false" />

  <option name="ignore_footnotes_configuration" value="false" />

  <option name="ignore_page_formatting" value="false" />

  <custom-preamble />

</config>

The meaning of each part is explained in the following sections. Writer2LaTeX comes with four sample configuration files:

Basic options

Font and symbol options

Options for other packages

Options for BibTeX

Options to control export of formatting

In Writer, formatting is controlled by styles. Per default Writer2LaTeX will convert all styles to LaTeX while preserving as much formatting as possible. You can however change this behaviour in the configuration file.

Style maps

In addition you can specify maps from styles in Writer to your own LaTeX styles in the configuration. Currently this is possible for text styles, paragraph styles and list styles. For example the following confguration files overrides the text style Emphasis and the paragraph style Quotations as well as the list style theorem.

<?xml version="1.0" encoding="UTF-8"?>

<config>

  <style-map name="Emphasis" class="text" before="\emph{" after="}" />

  <style-map name="Quotations" class="paragraph" before="\begin{quotation}" after="\end{quotation}" />

  <style-map name="theorem" class="list" before="" after="" />

  <style-map name="theorem" class="listitem" before="\begin{theorem}" after="\end{theorem}" />

</config>

Note that there are two entries for a list style: The first one to specify the LaTeX code to put before and after the entire list. The second one to specify the LaTeX code to put before and after each list item. The example shows how to create theorem environments from a list in Writer.

When you override a style, all formatting specified in the original document will be igored.

Math symbols

In OOo Math you can add user-defined symbols. Writer2LaTeX already understands the predefined symbols such as %alpha. If you define your own symbols, you can add an entry in the confguration that specifies LaTeX code to use. The math-symbol-map element is used for this:

<math-symbol-map name=”ddarrow” latex=”\Downarrow” />

This example will map the symbol %ddarrow to the LaTeX code \Downarrow.

Custom preamble

The text you specify in the element custom-preamble will be copied verbatim into the LaTeX preamble. For example:

<custom-preamble>\usepackage{palatino}</custom-preamble>

to typeset your document using the postscript font palatino.