GeneralError with Code for "intelligent Comma"

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
koyki
Posts: 3
Joined: Sun Oct 16, 2011 3:17 pm

Error with Code for "intelligent Comma"

Post by koyki »

I use this package, which has been suggested by Claudio Beccari in PracTeX Journal.

Code: Select all

\makeatletter % not necessary when this code is in a .sty file

% 1st part
\DeclareMathSymbol{\punctcomma}{\mathpunct}{letters}{"3B}
\DeclareMathSymbol{\decimalcomma}{\mathord}{letters}{"3B}


% 2nd part
\AtBeginDocument{\mathcode‘\,="8000}
{\catcode‘\,=\active \gdef,{\futurelet\let@token\m@thcomma}}


% 3rd part
\def\m@thcomma{\let\@tempB\punctcomma
\@tfor\@tempA:=0123456789\do{%
  \expandafter\ifx\@tempA\let@token\let\@tempB\decimalcomma
  \@break@tfor\fi}\@tempB}
I get this error:

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   ‚
l.10 {\catcode‚
               Äò\,=\active \gdef,{\futurelet\let@token\m@thcomma}}
? 
Example:

Code: Select all

\documentclass{article}
\usepackage{intcomma}
\begin{document}
\end{document}
Note: The intcomma.sty file contains the code above.

As I do not write packages myself, any help is appreciated.

Recommended reading 2024:

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

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

koyki
Posts: 3
Joined: Sun Oct 16, 2011 3:17 pm

Error with Code for "intelligent Comma"

Post by koyki »

Solved. The problem was that the code I copied has been rendered by (La)TeX. As I just found out, TeX has the nice "feature" to render the character ` (ASCII+96, grave accent) as ‘ (U+2018, left single quotation mark). So you cannot just copy code from a document about TeX and expect to have TeX code. You still have to correct it for the completely unnecessary character substitutions.
Post Reply