Suppose that I have made aTikZ
picture using the standalone
class, is there an easy way to determine some fixed output dimension of this picture, say width=16cm, height=12cm
? This could be useful in the case I want to export this picture to a presentation, which only accepts PNG, hence when I need to convert the vector image to a raster image.
Example code of one of my TikZ pictures:
\documentclass[tikz]{standalone}
\usepackage{tikz-network}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.9]
\Vertex[x=0,y=1,label=\textbf{Genesis},shape=rectangle,size=3,color=blue!80!black,Math,fontsize=\large]{G1}
\Vertex[x=6,y=1,label=\textbf{Block 1},size=3,shape=rectangle,color=orange,Math,fontsize=\large]{b1}
\Text[x=0,y=0.5]{Index:0}
\Text[x=0,y=0]{Hash:a0}
\Vertex[x=12,y=1,label=\textbf{Block 2},size=3,shape=rectangle,color=orange,Math,fontsize=\large]{b2}
\Text[x=6,y=0.5]{Index:1}
\Text[x=6,y=0]{Hash:eaKvl}
\Vertex[x=18,y=1,label=\textbf{Block 3},size=3,shape=rectangle,color=orange,Math,fontsize=\large]{b3}
\Text[x=12,y=0.5]{Index:2}
\Text[x=12,y=0]{Hash:yezgLg1}
\Text[x=18,y=0.5]{Index:3}
\Text[x=18,y=0]{Hash:adLc2eZ}
\Edge[Direct=True,color=black,lw=2,bend=0](G1)(b1)
\Edge[Direct=True,color=black,lw=2,bend=0](b1)(b2)
\Edge[Direct=True,color=black,lw=2,bend=0](b2)(b3)
\end{tikzpicture}
\end{document}
foo
picture usingstandalone
you can insert the pdf output using\includegraphics[width=4cm]{foo.pdf}
in your main file.transform shape
to the options of thetikzpicture
to make the transformations "active".