![! Error de LaTeX: no se puede determinar el tamaño del gráfico en ../images/vi.gif (sin BoundingBox)](https://rvso.com/image/370291/!%20Error%20de%20LaTeX%3A%20no%20se%20puede%20determinar%20el%20tama%C3%B1o%20del%20gr%C3%A1fico%20en%20..%2Fimages%2Fvi.gif%20(sin%20BoundingBox).png)
he descargadohttps://hea-www.harvard.edu/~fine/Tech/vi.htmlarchivo usando wget -p -k https://hea-www.harvard.edu/~fine/Tech/vi.html
luego ejecute pandoc --latex-engine=xelatex -o vi.pdf vi.html
este producir -
pandoc: Error producing PDF from TeX source.
! LaTeX Error: Cannot determine size of graphic in ../images/vi.gif (no Boundin
gBox).
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.884 ...html}{\includegraphics{../images/vi.gif}}
Y cuando uso pdflatex
(motor de látex predeterminado en Pandoc) usando pandoc -o vi.pdf vi.html
este producto,
pandoc: Error producing PDF from TeX source.
! LaTeX Error: Unknown graphics extension: .gif.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.884 ...html}{\includegraphics{../images/vi.gif}}
También uso wkhtmltopdf https://hea-www.harvard.edu/~fine/Tech/vi.html
para hacer pdf desde un enlace web. Pero en wkhtmltopdf
la solución no tengo control sobre el color de fondo. Quiero hacer un pdf en blanco y negro.
Respuesta1
LlevarEl código de Herbert.y ponerlo en un archivo:
% file: gif2png.tex
% Herbert's code:
% https://tex.stackexchange.com/questions/7602/how-to-add-a-gif-file-to-my-latex-file/7608#7608
\usepackage{epstopdf}
\epstopdfDeclareGraphicsRule{.gif}{png}{.png}{convert gif:#1 png:\OutputFile}
\AppendGraphicsExtensions{.gif}
Ahora puedes llamar a pandoc con las opciones:--pdf-engine-opt=-shell-escape --include-in-header=gif2png.tex
Ejemplo:
Tome este sencillo archivo html:
<!-- file: test.html -->
<p>Here is a gif:</p>
<img src="test.gif" title="A dummy picture" alt="The gif" />
Y un gif llamado test.gif
:
Y ejecuta pandoc:
pandoc test.html --pdf-engine-opt=-shell-escape --include-in-header=gif2png.tex -o test.pdf
Obtendrá este pdf como resultado:
Advertencia:
epstopdf
solo admite pdflatex
y lualatex
como motor pdf