summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/program/program.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/program/program.sty')
-rw-r--r--Master/texmf-dist/tex/latex/program/program.sty15
1 files changed, 15 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/program/program.sty b/Master/texmf-dist/tex/latex/program/program.sty
index 49d1e2ae9ae..10caef2ecad 100644
--- a/Master/texmf-dist/tex/latex/program/program.sty
+++ b/Master/texmf-dist/tex/latex/program/program.sty
@@ -15,6 +15,7 @@
% Changed \FOREACH \ATEACH to use \@typename
% Added \boldsubm (uses \boldsymbol instead of text \bf)
% 3.3.11: Changed the default style to \sfvariables, old style is \bfvariables
+% 3.3.12: Fixed the interaction with \index and \makeindex (which uses |)
%
%
% A LaTeX2e style file for typesetting algorithms.
@@ -991,3 +992,17 @@
\def\www{\bgroup\def~{\hskip 1pt plus 3pt minus 1pt\relax}\www@}
\def\www@#1{$\langle$#1$\rangle$\egroup}
+%% Fix the use of | in \index:
+
+\def\makeindex{%
+ \newwrite\@indexfile
+ \immediate\openout\@indexfile=\jobname.idx
+ \def\index{\@bsphack\begingroup
+ \catcode`\|=12
+ \@sanitize
+ \@wrindex}\typeout
+ {Writing index file \jobname.idx}%
+ \let\makeindex\@empty
+}
+\def\index{\@bsphack\begingroup\catcode`\|=12\@sanitize\@index}
+