Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers 3

up vote 10 down vote accepted

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.