3

I want to to produce a pdf-picture used in another document. Despite the usage of the standalone package, the image has a lot of white space on the left side.

MWE:

\documentclass[crop]{standalone}
\usepackage{tikz}
\usepackage{pythontex}
\begin{pycode}
a=17
\end{pycode}
\begin{document}
\begin{tikzpicture}
\node (node1) at (2,1) {1};
\node at (0,0) {\py{a}};
\end{tikzpicture} 
\end{document}
ees
  • 31

1 Answers1

5

pythontex creates a lot of spaces at the begin of the document. Use the tikz-option of standalone:

\documentclass[tikz]{standalone}

\usepackage{pythontex}
\begin{pycode}
a=17
\end{pycode}
\begin{document}

\begin{tikzpicture}
\node (node1) at (2,1) {1};
\node[draw] at (0,0) {\py{a}};
\end{tikzpicture}

\end{document}

enter image description here

Ulrike Fischer
  • 327,261