[Tex/LaTex] How to control padding around standaloneframe content

beamerpdftexstandalonetikz-pgf

How te remove the white space on the right side of the figure? I need to crop the figure and control the padding around it..

Ex:
How to generate a series of \paused stand-alone TikZ images?

Best Answer

The standalone package by default crops the page to its contents. There is also a border option (also called margin, which I think is a better name) that allows you to put a white space margin around it. You can even specify all four margins differently. Here is an example:

\documentclass[tikz, margin=5mm]{standalone}

\begin{document}
\tikz \draw[thick,rounded corners=8pt]
(0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -- (0,0) -- (2,0);
\end{document}

enter image description here

N.B. The gray border is not part of the file. It is the background of the viewer, included to show the size of the resulting output.