There are many images I want to generate separately and import into my main tex document using \includegraphics
. However, using the standalone documentclass generates an extra blank page after the image produced. If I change to \documentclass{article}
(which I do not want as it doesn't crop to the correct size of the image), there is no extra page.
Here is a minimum working example.
\documentclass{standalone} % \documentclass{article} doesn't produce extra empty page
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[label={left: $x$}] (x) at (0,0) {};
\end{tikzpicture}
\end{document}
How do I generate the image without the extra page? I'm using the command latexmk -dvi <imageName>.tex
Notes:
- When opening the .dvi file, there is one page (with content), and a second empty page.
- I run
dvips <imageName>.dvi -o <imageName.eps
. When opening the .eps file, there is one page (with content), and a second empty page. - I use
\includegraphics
to import the .eps file. This displays without issue in my main document, but the question remains open as to why the output .dvi file has two pages.
pdflatex -dvi <imageName>.tex
and still had an extra page. My latexmk version is 4.67 and pdflatex is 3.14159265-2.6-1.40.21 (TeX Live 2020)\documentclass[tikz]{standalone}
or\standaloneenv{tikzpicture}
. Then the environment is correctly setup.