Go to page:

Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

LyX2OpenOffice

<< MifToLyx | Page list | SVG Files and Inkscape >>

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: ConvTex.zip

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

Windows XP: readme: ReadMeXP.txt needed files: ConvTexWin.zip

Windows 98: readme: ReadMe98.txt needed files: ConvTexWin98.zip

Documentation: To preview the documentation, download needed files: ConvTex.lyx.zip


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 (http://www.tug.org/applications/tex4ht/mn.html)

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, any further reports of this working should be placed here.

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

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 "ecrm1200.mf", 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 2008-04-09 06:01 CEST