10

I'm using the standalone document class. Here is a minimal working example:

\documentclass{standalone}

\usepackage[siunitx]{circuitikz}

\begin{document}
    Hello world
\end{document}

The problem lies with siunitx. Using any of the following preamble lines do not result in the extra whitespace:

\usepackage{tikz}        % or
\usepackage{circuitikz}

But the following preamble lines result in the extra whitespace:

\usepackage[siunitx]{circuitikz}  %or
\usepackage{siunitx}

The problem also appears when I draw figures in a circuitikz environment. Why is there extra whitespace to the left of the compiled PDF? How do I get rid of it?

Kit
  • 16,430

3 Answers3

12

As an alternative to using preview, the classical solution to all known spurious white space questions is to put a % at the end of a line somewhere. In this case, putting it here works:

\documentclass{standalone}

\usepackage[siunitx]{circuitikz}



\begin{document}%<<<<<<<<<<<<<<<<<<<<<<<<<<

  Hello world


\end{document}
David Carlisle
  • 757,742
12

The problem here is that siunitx needs to execute some code right at the end of the \document macro. Currently, this is done by adding a couple of items to the 'right' of the macro, but this messes up the \ignorespaces at the end of it. I will address this with an updated siunitx later today.


Fixed in v2.5k, sent to CTAN 2012-11-13.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
9

Use preview as the option (I don't know why it comes though):

\documentclass[preview]{standalone}

\usepackage[siunitx]{circuitikz}

\begin{document}
Hello world
\end{document}

enter image description here