如何将文档从Latex转换为Microsoft Word 2003?

时间:2022-10-30 14:21:17

I need to find a way to quickly convert a latex document into a Microsoft Word 2003 document.

我需要找到一种方法来快速将乳胶文档转换为Microsoft Word 2003文档。

I'm using Kile to edit latex documents on Ubuntu at present.

我目前正在使用Kile在Ubuntu上编辑乳胶文件。

I can do it the following way:

我可以通过以下方式完成:

latex filename.tex
tex4ht filename.tex
mk4ht oolatex filename.tex

then I have to open the resulting filename.odt document in OpenOffice and save as a Word Document.

然后我必须在OpenOffice中打开生成的filename.odt文档并保存为Word文档。

Is there anyway I do this in a single step?

反正我是一步到位吗?

I can write a program to run the initial three lines, I'm more interested in the conversion from odt to doc without using openoffice.

我可以编写一个程序来运行最初的三行,我更感兴趣的是从odt到doc的转换而不使用openoffice。

It would be even better if I could find a way to convert straight from filename.tex to filename.doc

如果我能找到一种直接从filename.tex转换为filename.doc的方法,那就更好了

8 个解决方案

#1


All programs that allegedly convert a document from LaTeX to some word-processing format will lose some information that was there in the original, but apparently you're willing to live with that.

所有涉嫌将文档从LaTeX转换为文字处理格式的程序都会丢失原始信息,但显然您愿意接受这些信息。

Here's one trick that may or may not be suitable for your purposes: if latex2rtf does a good enough conversion (I have no idea how it compares to the converter you are using), just rename its output from whatever.rtf to whatever.doc, and Word will open it just fine. Now if the recipient of the document wants to edit it, she may notice that it is actually not in the usual Word format, but, hey, Word behaves strangely all the time anyway.

这里有一个可能适用于您的目的的技巧:如果latex2rtf转换得足够好(我不知道它与你正在使用的转换器相比如何),只需将其输出从whatever.rtf重命名为whatever.doc,和Word将打开它就好了。现在,如果文档的收件人想要编辑它,她可能会注意到它实际上不是通常的Word格式,但是,嘿,Word无论如何都表现得很奇怪。

Another trick is to convert the output of TeX into images of pages and embed them in a Word document one by one - this preserves the exact layout from TeX and will obviously be useless for anything other than printing (and the print quality will likely be worse than you get by just printing the original), but technically it is a Word document.

另一个技巧是将TeX的输出转换为页面图像并将它们逐个嵌入到Word文档中 - 这样可以保留TeX的精确布局,对于打印以外的任何其他内容显然都是无用的(打印质量可能会更差)而不是只打印原件),但从技术上讲它是一个Word文档。

#2


What is you open it in OpenOffice (with OOoLaTex) and saves as .doc?

你在OpenOffice中打开它(使用OOoLaTex)并保存为.doc?

As Tormod said, it would be nice with one step: may using OOo from command line like here.

正如Tormod所说,只需一步就可以了:可以在这里使用命令行中的OOo。

#3


I haven't used it, so I cannot comment on it, but this looks somewhat like what you're looking for: tex2word and LaTeX-to-Word (the latter one looks better).

我没有使用它,所以我无法评论它,但这看起来有点像你正在寻找的东西:tex2word和LaTeX-to-Word(后者看起来更好)。

#4


I'm using tex4ht to produce an HTML file. I open the resulting .html in Word. Afterwords, I save it as .docx. Gives good results.

我正在使用tex4ht来生成HTML文件。我在Word中打开生成的.html。后来,我把它保存为.docx。效果很好。

Based on that, there is the latex2docx project.

基于此,有latex2docx项目。

#5


I tried many free solutions, but my LaTeX document was too complicated. In the end, commercially available GrindEQ did the best job by far. If you only need to do this once, you can use the demo version.

我尝试了很多免费解决方案,但我的LaTeX文档太复杂了。最后,商业上可用的GrindEQ迄今为止做得最好。如果您只需要执行一次,则可以使用演示版。

#6


Lyx bundles away some of the command-line stuff so that you can export straight to the ODT file (assuming you have tex4ht installed on the path), so that might save you a few keystrokes. I'd be surprised if Kile doesn't have similar output helpers.

Lyx捆绑了一些命令行内容,以便您可以直接导出到ODT文件(假设您在路径上安装了tex4ht),这样可以节省一些键击。如果Kile没有类似的输出助手,我会感到惊讶。

#7


I've just installed GrindEQ. And it didn't convert any of my figures. I suspect that it ignores \graphicspath . latex2rtf doesn't like \autoref .

我刚刚安装了GrindEQ。并没有转换我的任何数据。我怀疑它忽略了\ graphicspath。 latex2rtf不喜欢\ autoref。

oolatex (tex4ht) failed to convert jpg images for me, though they work fine with both latex and pdflatex under MikTeX 2.9. Other images are not centered as requested by \centering.

oolatex(tex4ht)无法为我转换jpg图像,尽管它们在MikTeX 2.9下使用latex和pdflatex都可以正常工作。其他图像未按居中要求居中。

oolatex and GrindEQ flatten \marginpar by embeding it in the main text with slightly different font. latex2rtf simply ignores \marginpar.

oolatex和GrindEQ通过将其嵌入主文本中略微不同的字体来展平\ marginpar。 latex2rtf只是忽略\ marginpar。

I guess there is no perfect tool for somewhat complex document:(

我猜有些复杂的文档没有完美的工具:(

#8


If you want to use this commands in one unique line of call, could write a single bash script for that:

如果要在一个唯一的调用行中使用此命令,可以为此编写单个bash脚本:

  • Create a new file named tex2odt.sh
  • 创建一个名为tex2odt.sh的新文件

  • Write this lines in:

    写下这一行:

    #!/bin/bash
    latex $1.tex
    tex4ht $1.tex
    mk4ht oolatex $1.tex
    
  • Make the file executable: chmod +x tex2odt.sh

    使文件可执行:chmod + x tex2odt.sh

  • call the script with the name of tex file without the extension: tex2odt.sh FiletoConvert
  • 使用tex文件的名称调用脚本,不带扩展名:tex2odt.sh FiletoConvert

Hope this still helps

希望这仍然有帮助

Namastê

#1


All programs that allegedly convert a document from LaTeX to some word-processing format will lose some information that was there in the original, but apparently you're willing to live with that.

所有涉嫌将文档从LaTeX转换为文字处理格式的程序都会丢失原始信息,但显然您愿意接受这些信息。

Here's one trick that may or may not be suitable for your purposes: if latex2rtf does a good enough conversion (I have no idea how it compares to the converter you are using), just rename its output from whatever.rtf to whatever.doc, and Word will open it just fine. Now if the recipient of the document wants to edit it, she may notice that it is actually not in the usual Word format, but, hey, Word behaves strangely all the time anyway.

这里有一个可能适用于您的目的的技巧:如果latex2rtf转换得足够好(我不知道它与你正在使用的转换器相比如何),只需将其输出从whatever.rtf重命名为whatever.doc,和Word将打开它就好了。现在,如果文档的收件人想要编辑它,她可能会注意到它实际上不是通常的Word格式,但是,嘿,Word无论如何都表现得很奇怪。

Another trick is to convert the output of TeX into images of pages and embed them in a Word document one by one - this preserves the exact layout from TeX and will obviously be useless for anything other than printing (and the print quality will likely be worse than you get by just printing the original), but technically it is a Word document.

另一个技巧是将TeX的输出转换为页面图像并将它们逐个嵌入到Word文档中 - 这样可以保留TeX的精确布局,对于打印以外的任何其他内容显然都是无用的(打印质量可能会更差)而不是只打印原件),但从技术上讲它是一个Word文档。

#2


What is you open it in OpenOffice (with OOoLaTex) and saves as .doc?

你在OpenOffice中打开它(使用OOoLaTex)并保存为.doc?

As Tormod said, it would be nice with one step: may using OOo from command line like here.

正如Tormod所说,只需一步就可以了:可以在这里使用命令行中的OOo。

#3


I haven't used it, so I cannot comment on it, but this looks somewhat like what you're looking for: tex2word and LaTeX-to-Word (the latter one looks better).

我没有使用它,所以我无法评论它,但这看起来有点像你正在寻找的东西:tex2word和LaTeX-to-Word(后者看起来更好)。

#4


I'm using tex4ht to produce an HTML file. I open the resulting .html in Word. Afterwords, I save it as .docx. Gives good results.

我正在使用tex4ht来生成HTML文件。我在Word中打开生成的.html。后来,我把它保存为.docx。效果很好。

Based on that, there is the latex2docx project.

基于此,有latex2docx项目。

#5


I tried many free solutions, but my LaTeX document was too complicated. In the end, commercially available GrindEQ did the best job by far. If you only need to do this once, you can use the demo version.

我尝试了很多免费解决方案,但我的LaTeX文档太复杂了。最后,商业上可用的GrindEQ迄今为止做得最好。如果您只需要执行一次,则可以使用演示版。

#6


Lyx bundles away some of the command-line stuff so that you can export straight to the ODT file (assuming you have tex4ht installed on the path), so that might save you a few keystrokes. I'd be surprised if Kile doesn't have similar output helpers.

Lyx捆绑了一些命令行内容,以便您可以直接导出到ODT文件(假设您在路径上安装了tex4ht),这样可以节省一些键击。如果Kile没有类似的输出助手,我会感到惊讶。

#7


I've just installed GrindEQ. And it didn't convert any of my figures. I suspect that it ignores \graphicspath . latex2rtf doesn't like \autoref .

我刚刚安装了GrindEQ。并没有转换我的任何数据。我怀疑它忽略了\ graphicspath。 latex2rtf不喜欢\ autoref。

oolatex (tex4ht) failed to convert jpg images for me, though they work fine with both latex and pdflatex under MikTeX 2.9. Other images are not centered as requested by \centering.

oolatex(tex4ht)无法为我转换jpg图像,尽管它们在MikTeX 2.9下使用latex和pdflatex都可以正常工作。其他图像未按居中要求居中。

oolatex and GrindEQ flatten \marginpar by embeding it in the main text with slightly different font. latex2rtf simply ignores \marginpar.

oolatex和GrindEQ通过将其嵌入主文本中略微不同的字体来展平\ marginpar。 latex2rtf只是忽略\ marginpar。

I guess there is no perfect tool for somewhat complex document:(

我猜有些复杂的文档没有完美的工具:(

#8


If you want to use this commands in one unique line of call, could write a single bash script for that:

如果要在一个唯一的调用行中使用此命令,可以为此编写单个bash脚本:

  • Create a new file named tex2odt.sh
  • 创建一个名为tex2odt.sh的新文件

  • Write this lines in:

    写下这一行:

    #!/bin/bash
    latex $1.tex
    tex4ht $1.tex
    mk4ht oolatex $1.tex
    
  • Make the file executable: chmod +x tex2odt.sh

    使文件可执行:chmod + x tex2odt.sh

  • call the script with the name of tex file without the extension: tex2odt.sh FiletoConvert
  • 使用tex文件的名称调用脚本,不带扩展名:tex2odt.sh FiletoConvert

Hope this still helps

希望这仍然有帮助

Namastê