TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set the width for all my plots, that are defined in other files and imported into the main document, using a custom width, \sz. I'm trying to set this length because I want to change it for one or two columns. Like in this example, main.tex:








x tick label style={
/pgf/number format/1000 sep=},
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ybar interval=0.7,
cycle list name=color list
coordinates {(1930,50e6) (1940,33e6)
(1950,40e6) (1960,50e6) (1970,70e6)};
coordinates {(1930,38e6) (1940,42e6)
(1950,43e6) (1960,45e6) (1970,65e6)};
coordinates {(1930,15e6) (1940,12e6)
(1950,13e6) (1960,25e6) (1970,35e6)};
coordinates {(1930,15e6) (1940,12e6)
(1950,13e6) (1960,25e6) (1970,35e6)};


However, when I'm compiling it, the length of \sz is reset to zero. And I get the error: Error: Plot width '0.0pt' is too small. Is there any way of setting the length so that the figure in the other file is able to 'see' it?

share|improve this question
up vote 3 down vote accepted

This happens because you use the minimal documentclass, which doesn't define \linewidth. If you use a proper class, like article, your setup works.

share|improve this answer
Thanks, my bad. Actually, I was using a different class; but for the example I decided to use a minimal to reproduce the error. However, your answer give me the hint to why it wasn't working. :) – adn Nov 24 '11 at 13:00

Your Answer


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.