1

I have LyX 2.3 installed, and my understanding is that LyX > 2.2 should have an option to export to *.docx out-of-the-box (e.g. "File > Export > MS Word Office Open XML"). But for me, that menu item is missing.

Interestingly, when I look in the "Preferences > File Handling > Converters" dialog, there is a converter for "LaTeX (plain) -> MS Word Office Open XML":

pandoc -s -f latex -o $$o -t docx $$i

If I have LyX export a *.tex file, and then use the above pandoc command on that *.tex file, I get a successful conversion to *.docx. So I know that pandoc is installed properly and that LyX is aware of it.

Also interestingly, if I add a new converter for "LaTeX (XeTeX) -> MS Word Office Open XML" with the exact same pandoc command (so the only difference is that it's converting from "XeTeX-style" latex instead of "plain" latex), the expected export menu item appears. The exported document has "@/path/to/directory/containing/lyx/file" on the first line (which wasn't present when I manually ran pandoc on the command line), but looks otherwise correct.

I also tried adding a "LyX -> LaTeX (plain)" converter (since there wasn't one to begin with) with the idea that maybe LyX just didn't know how to convert to LaTeX (plain) for some reason, but that had no effect.

So my question is: can anyone explain how to get LyX to recognize plain LaTex exporters? It's not a dire problem, I have the XeTeX hack (even if it adds a weird header for some reason), and I can always run pandoc from the command line. But it seems like something that should just work, no questions asked.

Edit:

Here are some relevant lines from my configure.log file:

INFO: checking for a LaTeX -> RTF converter...
INFO: +checking for "latex2rtf"...  yes
DEBUG: Add to RC:
\converter latex      rtf        "latex2rtf -p -S -o $$o $$i"   "needaux"


INFO: checking for a LaTeX -> Open Document (Pandoc) converter...
INFO: +checking for "pandoc"...  yes
DEBUG: Add to RC:
\converter latex      odt3        "pandoc -s -f latex -o $$o -t odt $$i"    ""


INFO: checking for a LaTeX -> MS Word Office Open XML converter...
INFO: +checking for "pandoc"...  yes
DEBUG: Add to RC:
\converter latex      word2       "pandoc -s -f latex -o $$o -t docx $$i"   ""
2
  • For me it works out of the box so I think your expectation is correct. In LyX go to Help > About and copy the directory location of your "user directory". Inside that directory there is a file "configure.log". What does that file say about Pandoc? For example, mine contains the line INFO: +checking for "pandoc"... yes
    – scottkosty
    May 2, 2018 at 20:34
  • As for the @path thing, that's because when LyX creates a temporary .tex file with the export to LaTeX (plain), it puts in it the LaTeX command \def\input@path{{/path/to/directory/containing/lyx/file}}. I guess Pandoc decides to convert it to actual text. You might want to ask for an enhancement and explain that that command should not correspond to any output. I think that's a reasonable feature request for Pandoc, but I'm not sure.
    – scottkosty
    May 2, 2018 at 20:42

1 Answer 1

0

I came across your post via google searching for the same issue and may have found an answer:

Try disabling non-Tex fonts in Document -> Settings -> Fonts. Once I did that the options magically reappeared in the menus.

enter image description here

(I found the solution here)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .