Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with \renewcommand{\@biblabel}

759 views
Skip to first unread message

Shashi Mohan

unread,
May 20, 1996, 3:00:00 AM5/20/96
to

I am working on a paper for a journal which requires that the bibliography
labels be 1., 2., etc. instead of [1],[2], and so on. According to page 374
of the LaTeX companion, the way to do this is
\renewcommand{\@biblabel}[1]{#1.}
However, when i included this code in my LaTeX file, i keep getting the
following error message:
! You can't use 'macro parameter character #' in horizontal mode.
1.7 \renewcommand{\@biblabel}[1]{#
1.}
?

I have not been able to find out what is causing this problem, or even
what horizontal mode means. If anyone one else has run across this or
a similar problem and knows how to get around it, can they please let me
know. Thanks.


--
=============================================================================
Shashi Mohan email: mo...@pasture.ecn.purdue.edu
http://pasture.ecn.purdue.edu/~mohan (317) 743-7092 (evenings)
(317) 494-1215 (rest of the time)
"There is a theory that states that if the purpose of the universe were ever
discovered it would immediately be replaced with something even more bizzar-
ely inexplicable. There is a second theory that states that this has already
happened"
- Douglas Adams
=============================================================================

Robin Fairbairns

unread,
May 20, 1996, 3:00:00 AM5/20/96
to

In article <4nq5d0$p...@mozo.cc.purdue.edu>,
>[...] According to page 374

>of the LaTeX companion, the way to do this is
>\renewcommand{\@biblabel}[1]{#1.}
>However, when i included this code in my LaTeX file, i keep getting the
>following error message:
>! You can't use 'macro parameter character #' in horizontal mode.
>1.7 \renewcommand{\@biblabel}[1]{#
> 1.}
>?

This is because the command you're renewing looks to LaTeX like \@,
and it's getting thoroughly confused.

Either put your code in a .sty file, or change it to read:

\makeatletter
\renewcommand{\@biblabel}[1]{#1.}
\makeatother

(The Companion does talk about this requirement, somewhere early like
p.16)
--
Robin (Campaign for Real Radio 3) Fairbairns r...@cl.cam.ac.uk
U of Cambridge Computer Lab, Pembroke St, Cambridge CB2 3QG, UK
Home page: http://www.cl.cam.ac.uk/users/rf/robin.html

Mark Wooding

unread,
May 20, 1996, 3:00:00 AM5/20/96
to

Shashi Mohan <mo...@pasture.purdue.edu> wrote:
> I am working on a paper for a journal which requires that the bibliography
> labels be 1., 2., etc. instead of [1],[2], and so on. According to page 374

> of the LaTeX companion, the way to do this is
> \renewcommand{\@biblabel}[1]{#1.}
> However, when i included this code in my LaTeX file, i keep getting the
> following error message:
> ! You can't use 'macro parameter character #' in horizontal mode.
> 1.7 \renewcommand{\@biblabel}[1]{#
> 1.}
> ?

Ooops. This one again.

LaTeX uses lots and lots of internal commands that it doesn't like
people fiddling with. It puts an `@' sign in their names, as a sort of
warning: `if you want to use this command, make sure you know what
you're doing'. Just to make absolutely sure, it stops you using these
commands in your document, since command names can only contain letters
(except for single-character names like \[).

If you really do know what you're doing, you can tell LaTeX this by
saying \makeatletter. Then TeX will think that `@' is a letter, and
allow you to use it in command names. Once you've finished hacking
about, say \makeatother, to make everything safe again.

So, the solution is to say...

\makeatletter % Start hacking...


\renewcommand{\@biblabel}[1]{#1.}
\makeatother

Such hacking should generally be confined to the document preamble
which you haven't done, by the way. (Otherwise it would have said
`missing \begin{document}'.)

(Hmmm... would it be worth making @ a letter in the document preamble?
This sort of error seems to be amazingly common, and having to litter my
preambles with \makeatletters or do horrific \csname...\endcsname
contortions to avoid them is really getting me down. Too many LaTeX
commands are marked as private for there to be any real `safety' in
using @s in this way.)
--
(` t r a y l i g h t / `Beware of bugs in the above code; I
,_) cs...@csv.warwick.ac.uk / have only proved it correct, not actually
/ tried it.'
Mark Wooding / Donald Knuth


0 new messages