Quick boilerplate for when you need a LaTeX inline thing converted to an image.
Enter the expression in fig.tex
, and run:
pdflatex fig.tex < /dev/null && convert -density 600 fig.pdf -flatten -scale 50% -quality 90 fig.jpg
Things you may want to change:
- To render block content (i.e. an equation) instead of a float or inline content,
add
varwidth=40em
to the document options, or use\minipage
for a fixed width. - Tweak the
-density
,-quality
andborder
accordingly, or produce a.png
. - Change the language.
The standalone
class has a convert
option but this makes babel
go nuts for unknown reasons.