Roland's homepage

My random knot in the Web


This script “image for LaTeX” is meant for generating LaTeX figure environments of pictures.

It handles the same picture types that pdfLaTeX can handle; pdf, jpeg and png. To be able to do this, it requires the PostScript interpreter ghostscript and the identify program from the ImageMagick suite.

This script is available on github from my scripts repository.

An example command.

img4latex pdf/overview-drawing.pdf

This produces the following output.

\centerline{\includegraphics[viewport=0 0 1191 842,clip,scale=0.381]%

The caption should probably be replaced by something more descriptive. This code should be copied and pasted into the document you want to include the picture in.

This generated code should work with pdflatex as long as the document in which it is included uses \usepackage{graphicx}.

←  Managing configuration files with ‘deploy’ SHA256 in pure Python  →