Following the Latex wiki page I tried \newcommand and \DeclareRobustCommand:





Both of which cause a myriad of compilation errors.

  • 3
    scale=\marginProportion should work, but not scale=\marginProportion{}. \DeclareRobustCommand does not work since it's not expandable
    – user31729
    Mar 17, 2015 at 7:53
  • 1
    The key-value syntax does not expand the key value \marginProportion, just copies content and in the case of \marginProporption{} it adds content to the value which shouldn't be there (the {} pair)
    – user31729
    Mar 17, 2015 at 7:57
  • 1
    It has to be added, from my point of view, that the {} issue is actually not limited to a 'numerical' variable
    – user31729
    Mar 17, 2015 at 13:07

1 Answer 1


Key-value approaches (often) do not expand the key values.

In this case scale=\marginProportion{} will just be copied, as can be shown from the verbatim output of \typeout of the dummykey definition. The second call with trailing {} will just have those {} as key value, conflicting with the expected input for the scale key from geometry package.





Printing the key value:  \FamKVMacroDummy






*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(./numvar.aux) )</usr/local/texlive/2014/texmf-dist/fonts/type1/public/amsfonts
Output written on numvar.pdf (1 page, 13994 bytes).
Transcript written on numvar.log.

\DeclareRobustCommand will not expand to 0.76 so this is useless here, as well as \newrobustcmd from etoolbox.

  • 1
    Such a great answer! Also, thank you for showing me that "debugging" technique! Mar 17, 2015 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .