Text FormattingIllegal parameter in definition of \reserved@a. \crcr

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Illegal parameter in definition of \reserved@a. \crcr

Post by latexforever »

Hello,

I had decided to modify all my

Code: Select all

\vec{}
commands into

Code: Select all

\overrightarrow{}
in commands (I have evidently the amsmath package).

I applicated it in one of my big documents, and it worked perfectly. Anyway, in another document, it does not work at all, and I receive, at compilation:

Illegal parameter in definition of \reserved@a. \crcr every time I use

Code: Select all

\overrightarrow{}
command. As it is a Physics document, you understand why I directly receive 545 errors because of this.

Can somebody tell me why it displays this error message? Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Illegal parameter in definition of \reserved@a. \crcr

Post by Stefan Kottwitz »

Hi,

try \protect before \overrightarrow.

Stefan
LaTeX.org admin
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Re: Illegal parameter in definition of \reserved@a. \crcr

Post by latexforever »

Before all? It has no influence at all. :cry:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Illegal parameter in definition of \reserved@a. \crcr

Post by Stefan Kottwitz »

Yes, before each \overrightarrow. \overrightarrow is a fragile command that might need to be protected. Alternatively you could make it robust using fixltx2e:

Code: Select all

\usepackage{fixltx2e}
\MakeRobust{\overrightarrow}
Stefan
LaTeX.org admin
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Re: Illegal parameter in definition of \reserved@a. \crcr

Post by latexforever »

Yes, but it still changes nothing in my recurrent error. :|
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Illegal parameter in definition of \reserved@a. \crcr

Post by Stefan Kottwitz »

It could fix this error for instance if \overrightarrow was used in a \caption parameter.
If it's not working in your case then show us at least an line that's raising the error.

Stefan
LaTeX.org admin
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Illegal parameter in definition of \reserved@a. \crcr

Post by latexforever »

Simply

Code: Select all

$\overrightarrow{AB}$
.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Illegal parameter in definition of \reserved@a. \crcr

Post by Stefan Kottwitz »

Sure? Is this really a complete line of your code where that error occurs, right at that place? Not inside braces {} as parameter for other macros? This code piece itself shows no problem.

Stefan
LaTeX.org admin
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Illegal parameter in definition of \reserved@a. \crcr

Post by latexforever »

Yes, sure. That was weird, and that's why I posted my question.

It now works, but I still don't understand why.

I added

Code: Select all

\usepackage[protrusion=true,draft=false,final,verbose=true,babel=true]{microtype}
in my preamble, moved

Code: Select all

\usepackage[Rejne]{fncychap}
just after

Code: Select all

\usepackage[subfigure]{tocloft}
and put

Code: Select all

\usepackage{fixltx2e}
\MakeRobust{\overrightarrow}
just after the microtype call.

I also erased the .aux file, but I had already done this before writing this post (sometimes, the .aux file is not always ``clean'', and it needs to be completely re-generated, I think: can you confirm it?).

Thanks!
Post Reply