Re: Makeindex with german Umlaut
- From: Dieter Kilsch <kilsch@xxxxxxxxxxxx>
- Date: Wed, 04 Jul 2007 19:10:36 +0200
I broke the error down to a few lines.
To me it looks like an error in ngerman.sty:
======================================
\documentclass{book}
\usepackage{ngerman}
\newcommand{\Index}[1]{#1\index{#1}}
\makeindex
\begin{document}
\index{singulär}
\Index{singulär}
\end{document}
======================================
yields
======================================
\indexentry{singul"ar}{1}
\indexentry{singul\active@dq \dq@prtct{a}r}{1}
======================================
so my macro \Index{singulär} causes wrong output to index.idx
There is nor difference
- using german.sty instead of ngerman.sty,
- changing the name of the macro Index
- using \usepackage[ansinew]{inputenc} or \usepackage[latin1]{inputenc}
Not using \usepackage{ngerman} gives
======================================
\indexentry{singul"ar}{1}
\indexentry{singul"ar}{1}
======================================
wher I would expect \"a !
Do you have any idea to come around this problem?
I don't think the log gives more infornmation, but here it is:
======================================
This is TeX, Version 3.141592 (MiKTeX 2.4) (preloaded format=latex 2007.6.2) 4 JUL 2007 19:09
**Index
(Index.tex
LaTeX2e <2005/12/01>
Babel <v3.8g> and hyphenation patterns for english, french, german, ngerman, du
mylang, nohyphenation, loaded.
(C:\progInst\texmf\tex\latex\base\book.cls
Document Class: book 2005/09/16 v1.4f Standard LaTeX document class
(C:\progInst\texmf\tex\latex\base\bk10.clo
File: bk10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(C:\progInst\texmf\tex\latex\german\ngerman.sty v2.5e 1998-07-08
Package: ngerman 1998/07/08 v2.5e Support for writing german texts (br)
\grmnU@D=\dimen103
ngerman -- \language number for naustrian undefined, default 3 used.
)
\@indexfile=\write3
Writing index file Index.idx
(Index.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
[1
] (Index.aux) )
Here is how much of TeX's memory you used:
417 strings out of 95991
4164 string characters out of 1196311
49460 words of memory out of 1053154
3476 multiletter control sequences out of 60000
3993 words of font info for 15 fonts, out of 1000000 for 2000
14 hyphenation exceptions out of 4999
23i,4n,17p,136b,198s stack positions out of 5000i,500n,10000p,200000b,32768s
Output written on Index.dvi (1 page, 240 bytes).
======================================
Thanks for your help!
Dieter
Ulrich Diez schrieb:
Dieter Kilsch wrote:.
Hi,
I got the following problem with Makeindex:
\index{äquidistant}
yields an entry
\indexentry{\"aquidistant|hyperpage}{152}
which Makeindex sorts under Symbole (Symbols) and not under A.
The option -g of Makeindex would sort
\indexentry{"aquidistant|hyperpage}{152}
correctly but does not sort
\indexentry{\"aquidistant|hyperpage}{152} as I did expect!
There is the obvious way around
\index{aquidistant@äquidistant}
but there are a lot of these Umlaute, so I am looking fpr a better way.
Also I a made all Umlaute written as "a ... when writing the .tex to
disk. But then I got strange indexentries by Latex:
\newcommand{\Index}[1]{#1\index{#1}}
\Index{Vollst"andigkeit}
translated to
\indexentry{Vollst\active@dq \dq@prtct{a}ndigkeit|hyperpage}{2}
which Makeindex did not like:
!! Input index error (file = Skr.idx, line = 14):
-- Extra `@' at position 22 of first argument.
@ in the idx-file usually has a special meaning for \makeindex.
It does separate how the entry is to be sorted from how the
entry is to be written to the sorted index (ind-file).
I assume during writing-time " is active and expands to something
like \active@dq \dq@prtct{#1}.
What does your preamble look like?
Provide a minimal example which exhibits the undesired, possibly
erroneous behavior.
and I do not understand at all!
Any suggestions what could cause this and how to come around?
Suggestion:
Create a macro \umlindex which forms from its argument an index-entry of
pattern: \indexentry{<first part>@<second part>}{2}
In the <first part> Umlaut-stuff is replaced so that sorting is done correctly.
In the <second part> Umlaut-stuff is replaced so that printing is done correctly.
Here is some code I fiddled together. No warranties.
Ulrich
\documentclass{article}
\usepackage[ansinew]{inputenc}
\usepackage{german}
\usepackage{makeidx,hyperref}
\makeatletter
% The following macro \uml@ind is "derived" from the macro
% \Url@Edit which can be found in url.sty (ver 3.1, 15-Mar-2004)
% Copyright 1996-2003 Donald Arseneau, Vancouver, Canada.
{%
\catcode`Q=3
\toks@{%
\newcommand\uml@ind[4]{%
\begingroup
\def\uml@ind@b##1#1##2Q##3{%
\uml@ind@ifblank{##2}% if finished,
{%
\endgroup\uml@ind@c##1Q{#3}%
}%then remove\@empty's+act on replacement
{\uml@ind@b##1##3##2Q{##3}}% else, re-iterate
}%
\uml@ind@b\@empty#4\@empty#1Q{#2}%
}%
\@ifdefinable\uml@ind@c{%
\long\def\uml@ind@c#1\@empty Q#2{%
\expandafter\uml@ind@d\expandafter{#1}{#2}%
}%
}%
\newcommand*\uml@ind@d[2]{%
#2{#1}%
}%
\newcommand\uml@ind@ifblank[1]{%
\uml@ind@Ifbl@nk#1QQ\@secondoftwo\@firstoftwo!%
}%
\@ifdefinable\uml@ind@Ifbl@nk{%
\long\def\uml@ind@Ifbl@nk#1#2Q#3#4#5!{#4}%
}%
}%
\expandafter}\the\toks@ % restore Q catcode
\let\savedindex\index
\begingroup
\newcommand*\@wrindexdefiner[3]{%
\endgroup
\AtBeginDocument{%
\newcommand*\umlindex{}%
\ifx\index\savedindex
\let\umlindex\index
\else
\newcommand*\@joinwrindex[2]{%
\@wrindex{##1@##2}%
}%
\newcommand*\@spl{#1#2}%
\newcommand*\spls[1]{##1}%
\newcommand*\@splitwrindex[1]{%
\uml@ind{#2a}{\@spl a}{%
\uml@ind{#2o}{\@spl o}{%
\uml@ind{#2u}{\@spl u}{%
\uml@ind{#2A}{\@spl A}{%
\uml@ind{#2O}{\@spl O}{%
\uml@ind{#2U}{\@spl U}{%
\uml@ind{\string ß}{\string\spls{#1ss}}{%
\@joinwrindex{##1}%
}%
}}}}}}%
{##1}%
}%
\newcommand*\@umlwrindex[1]{%
\uml@ind{#1#2a}{#2a}{%
\uml@ind{#1#2o}{#2o}{%
\uml@ind{#1#2u}{#2u}{%
\uml@ind{#1#2A}{#2A}{%
\uml@ind{#1#2O}{#2O}{%
\uml@ind{#1#2U}{#2U}{%
\uml@ind{ä}{#2a}{%
\uml@ind{ö}{#2o}{%
\uml@ind{ü}{#2u}{%
\uml@ind{Ä}{#2A}{%
\uml@ind{Ö}{#2O}{%
\uml@ind{Ü}{#2U}{%
\uml@ind{ß#3}{\"s}{%
\uml@ind{ß}{#1ss}{%
\uml@ind{#1#2s}{\ss}{%
\uml@ind{#2s}{\string ß}{%
\uml@ind{#1ss#3}{\string ß}{%
\uml@ind{#1ss}{\string ß}{%
\uml@ind{\ss}{#1#2s}{%
\uml@ind{\"s}{\string ß#3}{%
\@splitwrindex
}%
}}}}}}}}}}}}}}}}}}}{##1}%
}%
\renewcommand*\umlindex{%
\@bsphack\begingroup\@sanitize\@umlwrindex
}%
\fi
}%
}%
\expandafter\@sanitize
\csname @wrindexdefiner\endcsname{\}{"}{ }%
\makeatother
\makeindex
\begin{document}
{?Frage} \index{?Frage}
{Abakus} \index{Abakus}
{Brom} \index{Brom}
{\"aquidistant} \umlindex{\"aquidistant}
{äquidistant} \umlindex{äquidistant}
{"aquidistant} \umlindex{"aquidistant}
{\"Olfeld} \umlindex{\"Olfeld}
{Ölfeld} \umlindex{Ölfeld}
{"Olfeld} \umlindex{"Olfeld}
{Soße} \umlindex{Soße}
{So\ss e} \umlindex{So\ss e}
{So"se} \umlindex{So"se}
{Man muß müssen} \umlindex{Man muß müssen}
\newpage
{So\"se kein Fehler} \umlindex{So\"se kein Fehler}
\printindex
\end{document}
- Follow-Ups:
- Re: Makeindex with german Umlaut
- From: David Kastrup
- Re: Makeindex with german Umlaut
- References:
- Makeindex with german Umlaut
- From: Dieter Kilsch
- Re: Makeindex with german Umlaut
- From: Ulrich Diez
- Makeindex with german Umlaut
- Prev by Date: Environments with " * ", how to replace them quickly?
- Next by Date: Re: Makeindex with german Umlaut
- Previous by thread: Re: Makeindex with german Umlaut
- Next by thread: Re: Makeindex with german Umlaut
- Index(es):
Relevant Pages
|