Simple question. I would like to do this:


Without the 0.9 it works. Is there a way to have 0.9 times a command variable?

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Aug 11, 2014 at 22:28
  • 4
    – egreg
    Aug 11, 2014 at 22:29
  • Typically one would use \newlength{\scatterplotwidth} ... \setlength{\scatterplotwidth}{0.5\linewidth}.
    – Werner
    Aug 11, 2014 at 23:36

1 Answer 1


You can define \scatterplotwidth to behave like a dimension parameter that loads a fraction of the current \linewidth by


Then \scatterplotwidth will be legal anywhere a length is needed, for instance in


By the way, the suggested


would not give the same result, because the value of \scatterplotwidth would be fixed to the size of \linewidth at the moment when \setlength is executed.

A different strategy based on length parameters would be defining a new command:


that will be used like




In the former case, 0.5\linewidth (with the current \linewidth) would be used, in the latter case, the scaling would be applied.

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.