A follow-up question to this one Aligning subcaptions with tikz pictures vertically
This is the code I am using, worked to a pretty minimal scenario:
\documentclass{article}
\usepackage{float, tikz, subfigure, array, caption, subcaption}
\usetikzlibrary{calc}
\newcommand{\alignedsublabel}[1]{%
\node at ($(current bounding box.south west)!(#1)!(current bounding box.south east)$) [anchor=base,text depth=0pt,yshift=-3ex] {\parbox{10em}{\subcaption[]{}}};%
}
\begin{document}
\begin{figure}
\begin{tikzpicture}[level/.style={sibling distance=35mm/#1}, scale=0.8]
\node [circle,draw] (z){1}
child {node [circle,draw] (a) {8}
child {node [circle,draw] (b) {6}
child {node [circle,draw] (c) {5}}
child[draw=white] {node [circle,draw,fill=gray] (d) {9}}
}
child {node [circle,draw] (g) {3}}
}
child {node [circle,draw] (j) {7}
child {node [circle,draw] (k) {2}}
child {node [circle,draw] (l) {4}}
};
\alignedsublabel{z.center}{}
\end{tikzpicture}
\caption{This is a picture of something.}
\end{figure}
\end{document}
The problem is with line 26 (\alignedsublabel
). This results in Missing numbers, treated as zero
errors. If I take it out, everything compiles fine. I'm not exactly sure what parts of the .log file could be relevant, but this is what it says:
<snip>
("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count132
\scratchdimen=\dimen181
\scratchbox=\box42
\nofMPsegments=\count133
\nofMParguments=\count134
\everyMPshowfont=\toks36
\MPscratchCnt=\count135
\MPscratchDim=\dimen182
\MPnumerator=\count136
\everyMPtoPDFconversion=\toks37
) ABD: EveryShipout initializing macros
Package caption Info: Begin \AtBeginDocument code.
Package caption Info: End \AtBeginDocument code.
! Missing number, treated as zero.
<to be read again>
\caption@c@figure
l.30 \alignedsublabel{z.center}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Missing = inserted for \ifnum.
<to be read again>
\caption@c@figure
l.30 \alignedsublabel{z.center}
I was expecting to see `<', `=', or `>'. Didn't.
! Missing number, treated as zero.
<to be read again>
\caption@c@figure
l.30 \alignedsublabel{z.center}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
[1
Non-PDF special ignored!{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}
]
<snip>
Any ideas? Please let me know if anything else in the .log file could be helpful as well, I only thought this would be the most relevant piece of information.
Best Answer
If you remove the
subfigure
package, the code compiles fine. I think this is a conflict betweensubcaption
andsubfigure
.