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.

Why does the following code fail to compile?

\documentclass[tikz]{standalone}
\begin{document}
\tikzset{every path/.style={line width=0.66em}}
\begin{tabular}{ll}
 $<$ 1 hour & \tikz \draw (0,0) -- (2.874cm,0) node[anchor=west] {28.74\%};
\end{tabular}
\end{document}
share|improve this question
    
Welcome to TeX.sx! In such cases you should always post the exact error message(s) you get. Also the version number of the package/class in question is also useful. –  Martin Scharrer Sep 16 '12 at 17:25
1  
Using \documentclass{standalone} \usepackage{tikz} instead of \documentclass[tikz]{standalone} fixes the problem. –  Peter Grill Sep 16 '12 at 17:28

1 Answer 1

up vote 5 down vote accepted

The tikz option of standalone generates one page for all tikzpictures it finds, because it also enables the multi option. For this it will box and discard everything which is outside of such environments. It is not intended to be used with \tikz inside a tabular. I recommend to drop the tikz option and load the tikz package manually instead.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\tikzset{every path/.style={line width=0.66em}}
\begin{tabular}{ll}
 $<$ 1 hour & \tikz \draw (0,0) -- (2.874cm,0) node[anchor=west] {28.74\%};
\end{tabular}
\end{document}
share|improve this answer

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.