Some Misc Notes


You can use TikZ to draw diagrams using LaTeX-like commands. Note that “PGF” (portable graphics format) and TikZ are both part of the same project; the readme says that PGF is the TeX macro package and TikZ is the user-friendly syntax layer.

My goal here is to use TikZ to create a png file.


You’ll need to have graphicsmagick installed in order to convert the pdf (generated by pdflatex) to png.

apt install graphicsmagick


apt install texlive-pictures      # this gets you tikz
apt install texlive-latex-extra   # this gets you standalone (LaTeX cls)

Hello World

Create a foo.tex file:


\draw (0,0) -- (4,2);

Process it:

pdflatex foo.tex  # creates foo.pdf
gm convert -density 300 foo.pdf foo.png

(See also the docs on gm convert. If you leave out the -density 300, resulting image will be smaller.)

And view the resulting png. You should see a diagonal line:

diag line