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 define a \newcommand that has a tabular in it, but I get an:

! You can't use `macro parameter character #' in restricted horizontal mode.

Here's an example:

    #1 \\\hline

Any way around this?

share|improve this question

closed as too localized by Martin Scharrer Aug 16 '11 at 15:23

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I'm not able to reproduce your error. Could please provide a full minimal working example (MWE). – N.N. Aug 16 '11 at 15:14
up vote 4 down vote accepted

Arguments of a command should be enclosed in [] and not {}.

    #1 \\\hline
share|improve this answer
Argh, I am an idiot. Thanks! – ynimous Aug 16 '11 at 15:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.