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

-xhtml+mathml

Convert to xhtml + MathML

-xhtml+mathml+xsl

Convert to xhtml + MathML with xsl (see section 2.5)

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

-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