3

Consider this example:

\documentclass[margin=1cm]{standalone}
\usepackage{tikz}
\begin{document}

line1

line2

\begin{tikzpicture} \draw (0, 0) -- (2, 2); \end{tikzpicture} \end{document}

In the output everything is on one line:

enter image description here

How to have a new line in standalone?

Viesturs
  • 7,895

1 Answers1

9

The varwidth option will allow line breaks:

\documentclass[margin=1cm,varwidth]{standalone}
\usepackage{tikz}
\begin{document}

line1

line2

\begin{tikzpicture}
\draw (0, 0) -- (2, 2);
\end{tikzpicture}
\end{document}

enter image description here

wasa
  • 338