! LaTeX 오류: ../images/vi.gif(BoundingBox 없음)에서 그래픽 크기를 확인할 수 없습니다.

! LaTeX 오류: ../images/vi.gif(BoundingBox 없음)에서 그래픽 크기를 확인할 수 없습니다.

나는 다운로드했다https://hea-www.harvard.edu/~fine/Tech/vi.html파일을 사용하여 이 제품을 wget -p -k https://hea-www.harvard.edu/~fine/Tech/vi.html실행하세요 .pandoc --latex-engine=xelatex -o vi.pdf vi.html

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}}

그리고 이 제품을 pdflatex사용하여 (pandoc의 기본 라텍스 엔진)을 사용할 때 -pandoc -o vi.pdf vi.html

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}}

나는 또한 wkhtmltopdf https://hea-www.harvard.edu/~fine/Tech/vi.html웹링크에서 PDF를 만드는 데 사용합니다. 그러나 wkhtmltopdf솔루션에서는 배경색을 제어할 수 없습니다. 흑백 PDF를 만들고 싶습니다.

답변1

가져가다허버트의 코드파일에 넣으십시오.

% 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}

이제 다음 옵션을 사용하여 pandoc을 호출할 수 있습니다.--pdf-engine-opt=-shell-escape --include-in-header=gif2png.tex

예:

다음 간단한 HTML 파일을 사용하세요.

<!-- file: test.html -->
<p>Here is a gif:</p>
<img src="test.gif" title="A dummy picture" alt="The gif" />

그리고 다음과 같은 gif가 있습니다 test.gif.

여기에 이미지 설명을 입력하세요

그리고 pandoc을 실행하세요:

pandoc test.html --pdf-engine-opt=-shell-escape --include-in-header=gif2png.tex -o test.pdf

결과적으로 다음 PDF를 얻게 됩니다.

여기에 이미지 설명을 입력하세요


경고:

epstopdfPDF 엔진으로 pdflatex만 지원lualatex

관련 정보