TransWikia.com

Pandoc unable to find images converting LaTeX do MS Doc

TeX - LaTeX Asked on June 11, 2021

I am experimenting with pandoc to convert a LaTeX document to the MS Doc format. The LaTeX document compiles without errors using pdflatex. However, when trying to convert into Doc format pandoc complains it cannot find the images files. An example:

$ pandoc main.tex --filter pandoc-crossref -o main.docx
[WARNING] Could not fetch resource 'figures/SPGZ00': PandocResourceNotFound "figures/SPGZ00"

This is the corresponding LaTeX segment:

begin{center}
begin{figure}[ht]
centering
  includegraphics[scale=0.4]{figures/SPGZ00}
end{figure}

What could be going wrong?

Update I: Making sure there is only one file with the corresponding name in the figures folder:

$ ls figures/SPGZ00*
figures/SPGZ00.png
$

Update II: Below a reproduction of this issue with the smallest document I could muster. A minimal non-working example.

$ 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.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP