Consider the MWE below, on a fully updated TeX Live 2015, this gives me this error:

de.tex:208: You can't use `\unskip' in vertical mode.
<recently read> \unskip 

l.208 }


% if xcolor is removed, file compiles
% if \SingleSpacing is removed, file compiles
% arrows.meta removed, file compiles



As listed remove one of the three, and the example compiles.

I'm guessing this is somehow related to \SingleSpacing, a memoir macro defined as

  \vskip\baselineskip% correction for coming into single spacing

if I remove the \vskip it works again.

Any idea what on earth is going on here?

Can others reproduce the problem?

  • tikz later calls xcolor. – Johannes_B Mar 14 '16 at 9:50
  • @Johannes_B, I know, but that does not explain the error. Also in my real document I need to pass options to xcolor, options that does not seem to be relevant here. – daleif Mar 14 '16 at 9:52
  • No, it doesn't explain the error. I can reproduce it, by the way. You can add the options globally when loading documentclass. They will be passed to xcolor. – Johannes_B Mar 14 '16 at 9:55
  • Yep, I can reproduce the problem. So, not something wrong with your installation. – Peter Grill Mar 14 '16 at 10:11
  • The problem is the \vskip\baselineskip. If you add it directly before loading the library you get the error. Not loading xcolor probably "hides" it as xcolor will be loaded by tikz. – Ulrike Fischer Mar 14 '16 at 10:14

As diagnosed by @UlrikeFischer, the problem originates in an \unskip issued by \pgfmathsetlength under certain circumstances.

I don't know the innards of TikZ, but here is a re-definition of the first branch of \pgfmathsetlength which uses a temporary box, as it apparently needs to issue a \selectfont and then an \unskip (presumably to get rid of some extraneous space following some dimension definition).




\typeout{Original meaning of pgfmathsetlength\meaning\pgfmathsetlength}


\def\pgfmathsetlength #1#2{\expandafter \pgfmath@onquick #2\pgfmath@ 
   \setbox\tempbox\hbox{\pgfmath@selectfont#1#2\relax\expandafter}\expandafter#1\the #1\relax 
  {\pgfmathparse {#2}\ifpgfmathmathunitsdeclared #1\pgfmathresult mu\relax 
                     \else #1\pgfmathresult pt\relax \fi }\ignorespaces }


% from the manual
\node [circle,draw] (A) {A};
\node [circle,draw] (B) [right=of A] {B};
\draw [draw = blue, thick,
              Computer Modern Rightarrow [sep]
              - Latex[blue!50,length=8pt,bend,line width=0pt]
      (A) edge [bend left=45] (B)
      (B) edge [in=-110, out=-70,looseness=8] (B);


  • That is one strange bug. Thanks for the run through – daleif Mar 15 '16 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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