I thought that doubling hashes was sufficient to pass arguments to nested \newcommand.



What am I doing wrong here? The above produces the following error:

"You can't use `macro parameter character #' in vertical mode."

  • 3
    This is not what is typically considered "nested". What is it you're trying to do?
    – Werner
    Jul 24, 2012 at 16:27
  • 1
    In particular, if you replace ##1 by #1 does it do what you want? Jul 24, 2012 at 16:32

3 Answers 3



You'll need the double hashes only if you \def something in a \def.


What you've done is put the string #1 inside the quotation. Such an operation only makes sense if you are defining a macro inside of another one, and you want that macro to make reference to its own first argument rather than have the #1 of the outer macro substituted. For example, in:


the call \macroia{xyz} results in \macroii{#1} = xyz, i.e. it ignores its own argument and just prints whatever \macroia saw, while the call \macroia{xyz} results in \macroii{#1} = #1; i.e. it ignores the argument to \macroia and just echoes whatever it is passed when expanded.


I'm doing some guesswork here. I believe that you want a boldface header to some text typeset with narrower line width. What you need is a new environment, not a new command:


so that you can input somethin like

This is a very useful hint for solving the problem.

The result won't be pretty, though. I'd place the heading inside the text:


(same syntax as before). Also \hint should be an environment:


Don't use spaces at random (\vspace{10px}, for instance), but above all don't use px to specify lengths. This is a unit that doesn't have a fixed value and is definitely not analogous to what the similar unit does in HTML or CSS.

You must log in to answer this question.

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