Hi Joel,

On Thu, Dec 23, 2010 at 8:14 AM, Joel Schwartz <j...@joelschwartz.com> wrote:
> Thanks for the suggestion Wolfgang. I installed elyxer and attempted to use 
> it, but I had a few problems. After installing elyxer from the command line, 
> I typed the following to try and convert a lyx document to html:
>
> > elyxer.py CSUS.lyx csus.html
>
> This gave the error message pasted just below (hopefully, you can see the 
> screenshot below):

Sure, it is just that eLyXer is not installed as an executable file.

> Then, based on the instructions in the readme file, I tried the following:
>
> > python -m elyxer csus.lyx csus.html
>
> This worked in the sense that it created the html file (Question: Why did the 
> first command give an error, while the second one worked?).

eLyXer tries several installation methods and uses the one best
suited. On Windows it works more reliable as a module than as an
executable file, based on the reports I have got, so a module (python
-m) is the default installation method there.

> The html file looked pretty good in a Firefox browser window. However, when I 
> opened it in MS-Word, Word decided it was an xml file and the file was filled 
> with all sorts of tags at the begining and end of each line of text. I can't 
> figure out what to do with it to turn it into a normal Word document (I don't 
> know how to process xml).

eLyXer exports XHTML by default, which Word does not understand. To
export HTML 4.0 (a different HTML dialect which word does understand)
just use:
  > python -m elyxer --html csus.lyx csus.html
and you will get a file which you can import in Word.

> Along with the document, Word opened an "xml data views" window in the 
> right-hand column of what would normally be the area where the document text 
> appears. The text at the top of this window reads "This XML document has 
> multiple data views. Before making changes to the document, choose the data 
> view (XSLT) to apply." I don't know where to go with that, so I'm stuck at 
> the moment.
>
> Is it really this hard to get an MS Word-compatible document from a lyx 
> document? Is there an easier way that I've missed?

It is easy once you get the hang of it. You can even configure LyX so
that it exports to Word using eLyXer, but it can be a bit tricky. In
case you want to do it, here's how:
* Open "Tools > Preferences".
* Select on the left menu: "File Handling > Converters".
* Select "LyX -> HTML".
* Change the "to" format from "HTML" to "HTML (Word)".
* Change the "converter" line from:
    python -m elyxer --directory $$r $$i $$o
  to:
    python -m elyxer --html --directory $$r $$i $$o
* Click on "Add".
* Click on "Save".

Right now I agree that using eLyXer to export to Word is unnecessarily
hard. It appears that the upcoming version 2.0 will use eLyXer by
default for Word export, so it will be quite simpler.

> Once again, thanks for any suggestions from the lyx (and elyxer) gurus on 
> this list.

Let us me know how it goes.

Alex.

Reply via email to