Try to fix \index-ed `||` getting LaTeX confused
authorHerbert Valerio Riedel <hvr@gnu.org>
Sat, 6 Jun 2015 11:24:23 +0000 (13:24 +0200)
committerHerbert Valerio Riedel <hvr@gnu.org>
Sat, 6 Jun 2015 11:29:45 +0000 (13:29 +0200)
Turns out that special care needs to be taken when escaping `|`s in
`\index{}`. See also
http://tex.stackexchange.com/questions/176931/how-to-escape-character-in-index

report/basic.verb
report/decls.verb
report/haskell.verb
tools/splitAndIndexPgm

index 13a7370..7f20252 100644 (file)
@@ -40,7 +40,7 @@ more readable.
 \label{prelude-bool}
 \indextycon{Bool}
 \indextt{False}\indextt{True}
-\index{""|""|@@{\tt  {\char'174}{\char'174}}}
+\index{\vert\vert@@{\tt  {\char'174}{\char'174}}}
 \index{&&@@{\tt  \&\&}}
 \indextt{not}
 \indextt{otherwise}
index 2f1aa74..82fbcb1 100644 (file)
@@ -1464,7 +1464,7 @@ edence & operators                & operators             & operators \\ \hline\hline
 \indextt{elem}
 \indextt{notElem}
 \index{&&@@{\tt  \&\&}}
-\index{""|""|@@{\tt  {\char'174}{\char'174}}}
+\index{\vert\vert@@{\tt  {\char'174}{\char'174}}}
 \indextt{>>}
 \indextt{>>=}
 \index{$@@{\tt  {\char'044}}}
index 03bd3f1..92d1eb0 100644 (file)
@@ -1,6 +1,7 @@
 % Formatting for double-sided
 \documentclass[twoside,10pt]{book}
 
+\usepackage[T1]{fontenc}
 \usepackage{times}
 \usepackage{makeidx}
 \usepackage{graphicx}
index c81dfb4..c063584 100644 (file)
@@ -114,10 +114,10 @@ sub printIndexEntries { # also re-sets $indexentries, specialentries
            #
            # there are a few "raw" chars that need fiddling, too...
            #
-           $raw =~ s/\|/""\|/g;
            $raw =~ s/!/""!/g;
            $raw =~ s/\@/""\@\@/g;
            $raw =~ s/\\/\\\\/g;
+           $raw =~ s/\|/\\vert/g;
 
            print "\\index\{$raw\@\@$processed\}%\n";
        } else {