Until recently, one could redefine \textlatin
to expand to its argument in order to allow index entries using Roman numerals and babel when a non-ASCII encoding is loaded together with ASCII encodings.
The recent changes to babel now make that obsolete. If any non-ASCII encoding is present, an encoding selection is made, along with a font switch. This is done via \AtBeginDocument
and the process related to \ensureascii
.
Consider this MWE:
%!TEX program=pdflatex
\documentclass{memoir}
\usepackage[utf8]{inputenc}
\usepackage[LGR,T1]{fontenc}
\usepackage[greek,english]{babel}
\usepackage{makeidx}
\makeindex
\begin{document}
\frontmatter
\meaning\thepage
\index{\string\thepage}
\mainmatter
\meaning\thepage
\index{\string\thepage}
\backmatter
\printindex
\end{document}
The .idx
file will have:
\indexentry{\string\thepage}{{\fontencoding {T1}\selectfont i}}
\indexentry{\string\thepage}{1}
That will not play well with makeindex for similar reasons as the former use of \textlatin
. One will lose all one's index entries in the front matter.
Is there any elegant workaround that anyone has discovered? Or perhaps stick with an old version of babel?
I hesitate to use sed to stroke the .idx
file in conjunction with latexmk, which otherwise does a marvelous job at creating the document on which I am working.
Although I understand why this design decision is quite helpful in many places, it does complicate indexing.
LGR
encoding is used, just something like\renewcommand\BabelNonASCII{}
in the preamble could do the trick. Interestingly this issue has never been reported as a bug (and I think it's a bug). I'll investigate a general solution.\textlatin
so I assumed it simply is what it is.