General! Bad character code (256)

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
markito
Posts: 4
Joined: Mon Oct 08, 2007 4:15 pm

! Bad character code (256)

Post by markito »

Hi All!

I´m currently working on a large document where the following error occurs when I include more than 255 references:
(./paper.aux
! Bad character code (256).
<to be read again>
\relax
l.582 \global \chardef \firstnote@num256\relax


The respective part in paper.aux looks like:
...
\bibcite{schaefer:94a}{{256}{1994}{{Sch{\"a}fer et~al.}}{{Sch{\"a}fer, Huber,
and Ahlrichs}}}
\global \chardef \firstnote@num256\relax
\newlabel{LastBibItem}{{256}{23}{}{}{}}
\citation{finley:98b}
...


I´m using revtex4 document class with pdfeTeX, Version 3.141592-1.21a-2.2.
\documentclass[twocolumn,preprintnumbers,amsmath,amssymb,a4paper]{revtex4}

The funny thing is when I just ignore the error and keep on compiling everything looks ok. The 256th reference appears where it is supposed to and I don´t see any noticeable problems. I´ve no idea where the error comes from. There is actually no information in the web. All I could find was that it is maybe some kind of dimension problem in Latex.

Any idea where that comes from and how to work around? I would appreciate every idea or comment.

THX!
Last edited by markito on Mon Oct 15, 2007 11:48 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

markito
Posts: 4
Joined: Mon Oct 08, 2007 4:15 pm

! Bad character code (256)

Post by markito »

Hi Again!

I tried now with a dummy text and figured out that it works without problems with other classes. So the error obviously comes from the use of revtex4.
However, since I need to use the revtex I still need a workaround. Thank you for your help...
Class revtex4 Warning: Endnote numbers changed: rerun LaTeX.
Package natbib Warning: There were undefined citations.
[12] (./text.aux
! Bad character code (262).
<to be read again>
\relax
l.644 \global \chardef \firstnote@num262\relax
markito
Posts: 4
Joined: Mon Oct 08, 2007 4:15 pm

! Bad character code (256)

Post by markito »

Hi Again!

In the meanwhile the revtex support kindly provided a patch:

Code: Select all

The current class file 'revtex4.cls' limits the number of citations
   in the document to 255. The following fix avoids this limitation.

   -------------------------------------------------------
   'revtex4.cls' (line 5679) and 'revtex4.dtx' (line 5148)

   old:  \global\chardef\string\firstnote@num#1\relax
   new:  \global\mathchardef\string\firstnote@num#1\relax
   -------------------------------------------------------
Many thanks to them...

M.
Post Reply