我正在尝试pandoc
将 LaTeX 文档转换为 MS Doc 格式。使用 编译 LaTeX 文档时没有错误pdflatex
。但是,当尝试转换为 Doc 格式时,pandoc
提示无法找到图像文件。例如:
$ pandoc main.tex --filter pandoc-crossref -o main.docx
[WARNING] Could not fetch resource 'figures/SPGZ00': PandocResourceNotFound "figures/SPGZ00"
这是相应的 LaTeX 片段:
\begin{center}
\begin{figure}[ht]
\centering
\includegraphics[scale=0.4]{figures/SPGZ00}
\end{figure}
可能出了什么问题?
更新一:确保文件夹中只有一个具有相应名称的文件figures
:
$ ls figures/SPGZ00*
figures/SPGZ00.png
$
更新二:下面是这个问题的重现,用我能找到的最小文档。一个最小的非工作示例。
$ cat minimal.tex
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\section*{An image}
\begin{figure}[ht]
\centering
\includegraphics[scale=0.4]{figures/SPGZ00}
\end{figure}
\end{document}
$ pdflatex minimal.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./minimal.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./minimal.aux)
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <./figures/SPGZ00.png>]
(./minimal.aux) )</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/
cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.
pfb>
Output written on minimal.pdf (1 page, 230844 bytes).
Transcript written on minimal.log.
$ pandoc minimal.tex --filter pandoc-crossref -o minimal.docx
[WARNING] Could not fetch resource 'figures/SPGZ00': PandocResourceNotFound "figures/SPGZ00"
$ pandoc --version
pandoc 2.5
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.7.7
Default user data directory: /home/duque004/.pandoc
Copyright (C) 2006-2018 John MacFarlane
Web: http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.