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 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."

share|improve this question
This is not what is typically considered "nested". What is it you're trying to do? – Werner Jul 24 '12 at 16:27
In particular, if you replace ##1 by #1 does it do what you want? – David Carlisle Jul 24 '12 at 16:32
up vote 8 down vote accepted


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

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.