A TikZ node "lives" in a TeX box. With latex
as the TeX engine these boxes are converted to PostScript directives. Use \showbox
to see how a box like this is implemented by following these steps.
Open the TikZ source file
<tex installation directory>/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
and add the instruction\showbox\tikz@figbox%
just after the comment
% Step 13: Add labels and nodes
Create the following LaTeX manuscript:
\documentclass{article} \usepackage{tikz} \begin{document} \tikz \path (0,0) node[draw] {}; \end{document}
Compile the manuscript with
latex
. The compilation will halt with a question mark:l.4 \tikz \path (0,0) node[draw] {}; ?
Entering
q<RET>
will end the session and flush the log buffer to the log file.Open the log file. The raw box will be found near the end of the file:
> \box33= \hbox(0.0+0.0)x0.0 .\hbox(0.0+0.0)x0.0 ..\special{ps:: save } ..\glue 0.0 ... ..\glue 0.0 ..\special{ps:: 6.64113 6.64113 -3.32056 -3.32056 pgfe } ..\special{ps:: pgfstr } ..\glue 0.0 ... ..\glue 0.0 ..\special{ps:: save } ..\special{ps:: [1.0 0.0 0.0 1.0 0.0 0.0 ] concat } ..\special{ps:: pgfs} ..\special{ps::[end]} ..\hbox(0.0+0.0)x0.0 ...\special{ps:: 0 setgray } ..\glue 0.0 ..\special{ps::[begin]} ..\special{ps:: pgfr} ..\special{ps:: restore } ..\special{ps:: restore } ! OK.
As can be seen, the PostScript operators used to render the box include save
, pgfe
, pgfstr
, and concat
. Now, save
and concat
are official operators documented in the PostScript manual, but pgfe
, pgfstr
and the other pgf...
operators are, I believe, PGF-specific and are not part of the PostScript language. How do PostScript interpreters, such as dvi viewers and utilities such as dvipdf
, know what to make of these operators and how to interpret them?