Home

Contents

1 Introduction

2 Using the export filters

3 Using the command line utility

3.1 How to install Writer2LaTeX for command line usage

3.2 Using the command line utility

4 Configuration

5 Special features for the EPUB export

6 The LaTeX package ooomath.sty

7 Using Writer2LaTeX from another application

8 Troubleshooting

    

3 Using the command line utility

3.2 Using the command line utility

To invoke the command line utility, use the command line

w2l <options> <source document/path> [<target document/path>]

The available options are

Group

Option

Explanation

Format

-latex

Convert to LaTeX (default)

-bibtex

Convert to BibTeX

-xhtml

Convert to XHTML

-xhtml11

Convert to XHTML 1.1

-xhtml+mathml

Convert to XHTML + MathML

-xhtml+mathml+xsl

Convert to XHTML + MathML with xsl (see section 2.4)

-epub

Convert to EPUB

Config

-config <file>

Load configuration file (see section 4)

-ultraclean

Load the LaTeX format ultraclean

-clean

Load the LaTeX format clean

-pdfprint

Load the LaTeX format pdfprint

-pdfscreen

Load the LaTeX format pdfscreen

-cleanxhtml

Load the XHTML format cleanxhtml

xhtml

-template <file>

Load an XHTML template

-stylesheet <file>

Load a custom style sheet for inclusion in the document (EPUB export only)

-recurse

Recurse into subdirectories (batch conversion)

Options

-<option> <value>

Set a configuration options (see section 4)

 

Some of the options are explained in more detail in the examples below.

Examples converting to LaTeX

The command line

w2l mydocument.odt mypath/myoutputdocument.tex

will convert the document mydocument.odt in the current directory, and save the result in the subdirectory mypath in the document myoutputdocument.tex.

The command line

w2l -config myconfig.xml mydocument.odt

will convert the document using the configuration file myconfig.xml (You can read more about configuration in section 4). As no output file is specified, Writer2LaTeX will use the same name as the original document, but change the extension to .tex.

You can also specify any simple option described in section 4 directly on the command line. Eg. to produce a file suitable for processing with pdfLaTeX:

w2l -backend pdftex mydocument.odt

Instead of giving your own configuration file, you can use one of the standard configurations. For example to produce a clean LaTeX file (ie. ignoring most of the formatting from the source document):

w2l -clean mydocument.odt

Examples converting to BibTeX from the command line

Writer2BibTeX extracts bibliography data to a BibTeX file. For example

w2l -bibtex mydocument.odt

will extract all bibliographic references from the document and store them in a file named mydocument.bib. You can also extract the data as part of the conversion to LaTeX, see section 4.

Examples converting to XHTML from the command line

The command line

w2l -xhtml+mathml mydocument.odt

will convert the document to XHTML+MathML, using the filename mydocument.xhtml.

Likewise the commandline

w2l -xhtml -config myconfig.xml mydocument.odt myresult.html

will convert into XHTML using the specified configuration and file name.

To produce a clean xhtml file (see section 4.3), for example:

w2l -cleanxhtml mydocument.odt mypath/myoutputdoc.html

Examples converting to EPUB from the command line

The command line

w2l -epub -split_level 2 mydocument.odt

will convert to EPUB, divding the document at sections of level 2

Likewise the command line

w2l -epub -stylesheet mystyles.css -cleanxhtml -split_level 2

will create an EPUB file using the custom style sheet mystyles.css for formatting.