Search:   Help



LyX documentation


Shared groups



<< | Page list | >>

There are 3 main methods of converting LyX documents to Open Document Format (the format used by OpenOffice): By python script, bash script, and by a converter installed in LyX. More detailed information about both methods follows.

Via a Python script

Collection of Python scripts to convert LyX to OpenOffice (Linux on PC, Mac OS X or WINDOWS).

Version 4

Please refer to the version 4 directory and check out the ReadMe file. Version 3 is apparently no longer available at this site.

Version 3

LINUX: readme: readmelyx2oo.txt needed files:

Mac OS X: readme: ReadMeMac.txt needed files: ConvTex.dmg (PPC), ConvTex-intel.dmg (Intel)

Windows XP: readme: ReadMeXP.txt needed files:

Windows 98: readme: ReadMe98.txt needed files:

Documentation: To preview the documentation, download needed files:

Via a converter

The internal LyX converter works differently before and after LyX 1.5.3. Pre-1.5.3, everything must be configured manually, but post 1.5.3, everything is configured automatically if the Tex4ht package is installed.

requirements: Tex4ht (

LyX 1.5.3

As of LyX 1.5.3 (possibly even 1.5.1), when the "htlatex" program is installed (from the Tex4ht package), LyX can automatically detect the program and install the OpenDocument converter automatically. Nothing more is necessary, it's all configured automatically when LyX is reconfigured by [Tools]->[Reconfigure], and restarted.

This works on:

  • Debian's current Lenny release.
  • Ubuntu 9.10 (Karmic Koala)

It also works on Windows, but not out of the box. If you use MikTeX, tex4ht has to be properly configured by editing the file <MikTeX folder>\tex4ht\base\win32\tex4ht.env. An easier solution is copying the tex4ht folder from <MikTeX folder>\tex4ht to C:\tex4ht\texmf\tex4ht, as documented here: However, you have to take care of updating the copy whenever tex4ht is updated in MikTeX. This hassle can be avoided by using the junction program you find here: for creating a reparse point to the MikTeX folder as follows. Open a terminal (launch cmd.exe) ad issue the following two commands:

md C:\tex4ht
md C:\tex4ht\texmf
junction C:\tex4ht\texmf\tex4ht "C:\Program Files\MiKTeX 2.8\tex4ht"

where it is assumed that C:\Program Files\MiKTeX 2.8 is your <MikTeX folder>.

on XP you can try

md C:\tex4ht
md C:\tex4ht\texmf
linkd c:\tex4ht\texmf\tex4ht  "C:\Program Files\MiKTeX 2.8\tex4ht"

If you use the Cygwin teTeX, you can easily install tex4ht by following the instructions here:

Any further reports of this working should be placed here.

Tag me

LyX Pre-1.5.3

You just have to add the following converter in Tools->Preferences->Converters:

LaTeX (plain) -> Open Document

converter: htlatex $$i 'xhtml,ooffice' 'ooffice/! -cmozhtf' '-coo' '-cvalidate'

extra flag: needaux

When it Doesn't Work

First thing to try: disable "Use hyperref support" in Document -> Settings... -> PDF properties and/or delete any \usepackage{hyperref} in the preamble. This may solve the problem instantly.

If lyx presents you with a "file not found" error box every time you attempt to preview in OpenDocument, your LaTeX install may have a corrupt file. To diagnose the problem, have LyX export a document to LaTeX, and then attempt to export to DVI:

lyx --export latex (document).lyx
pplatex latex (document).tex

The last 2 or 3 lines of output from the second command are the most informative:

(/usr/share/texmf-texlive/tex/latex/base/t1enc.def)latex: ~/.texmf-var/fonts/tfm/jknappen/ec/ecrm1200.tfm: No such device or address
(document).dvi: (document).dvi: No such file or directory

At this point, you should remove the "No such device or address" file (in this case, rm ~/.texmf-var/fonts/tfm/jknappen/ec/ecrm1200.tfm), and have mktex remake the file (mktextfm ecrm1200). Importantly, the base command is "mktex", and the extension to add to mktex is based on the extension of the missing file (in this case, tfm). If we were missing "", we'd run "mktexmf ecrm1200" instead. It's effectively "mktex+missingFileExtension missingFileName". After running "mktex...", there should be a LOT of output, ending with a message that the file you're missing was successfully generated. You should now be able to preview and export to ODF again. If it continues to fail, go back to the beginning and try again, you might have more than 1 corrupt file.

Lyx file conversion

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2010-10-04 11:02 UTC