.png)
ダウンロードしました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のデフォルトのLaTeXエンジン)を使用すると、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 が得られます。
警告:
epstopdf
pdflatex
およびlualatex
pdfエンジンのみをサポートします