LibreOffice编写器提供了一种将文档导出为LaTeX的方法。但是,我需要使用相应的终端命令批量处理许多文件:
soffice --convert-to tex my-file.odt --headless
或
soffice --convert-to tex:org.openoffice.da.writer2latex my-file.odt --headless
在我尝试遵循有关如何将某些选项传递给转换器的说明(参见http://writer2latex.sourceforge.net/doc1.6/user-manual7.html和enter link description here)之前,这种方法工作得很好:
soffice --convert-to tex:org.openoffice.da.writer2latex:inputencoding=utf8 my-file.odt --headless
上面的命令应该指向包含行\usepackage[utf8]{inputenc}
的tex代码,但实际上我得到的是\usepackage[ascii]{inputenc}
。使用Writer GUI,可以为导出设置编码和许多其他选项,并得到预期的结果。
由于writer2latex没有生动的开发人员社区,我希望在stackoverflow解决这个问题。
发布于 2020-08-21 22:09:28
出现上述问题的原因可能是LibreOffice (v6)和w2l (v1.0.2、v1.4.0、v1.2.1、v1.6.1)之间的版本冲突。使用w2l的当前alpha版本1.9.3至少对jar文件有效:
java -jar /some/path/writer2latex19/writer2latex.jar -latex \
-use_color=false \
-backend=pdftex \
-inputencoding=utf8 \
-multilingual=false \
-float_figures=true \
-ignore_hard_page_breaks=true \
-ignore_double_spaces=true \
-no_preamble=true \
-formatting=ignore_most \
your.odt
https://stackoverflow.com/questions/63523189
复制相似问题