-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyperref shifts location of "see" and "see also" in index #243
Comments
Similar: Hyperref shifts location of "see" and "see also" in index. How to restore? on TeX-SX |
While the solution in the link doesn't work as before since it produces no hyperlinks on pagenoes any more. Also I think it should be a bug of |
No hyperlinks on page numbers, really? In some examples of that answer, although package option When two indices share the same entry are
The third case is the case when Inn the latex step which generates
But it's feasible to solve the problem in the makeindex step, which generates \begin{filecontents}[noheader, force]{hyperpage.ist}
delim_0 ", \\hyperpageIdx{"
delim_1 ", \\hyperpageIdx{"
delim_2 ", \\hyperpageIdx{"
delim_n "}\\nil, \\hyperpageIdx{"
delim_t "}\\nil"
encap_prefix "\\"
encap_infix "}{{"
encap_suffix "}"
\end{filecontents}
\documentclass{article}
\usepackage{makeidx}
\makeindex
\usepackage{etoolbox} % for \ifstrempty
\usepackage[hyperindex=false]{hyperref}
% no encap, e.g., \hyperpageIdx{1}\relax
% with encap, e.g., \hyperpageIdx{\seealso{bar}}{{2}}\relax
\def\hyperpageIdx#1#2\nil{%
\ifstrempty{#2}
{\hyperpage{#1}}
{\ignorespaces#1{\hyperpage#2}}%
}
\def\seexalso#1#2{\emph{see xalso} #1} % "a" < "x" so "seealso" < "seexalso"
\begin{document}
text\index{bar}
\index{diff pages I}
\index{diff pages II|seealso{bar}}
\index{same page, one encaped}
\index{same page, one encaped|seealso{bar}}
\index{same page, both encaped|seealso{bar}}
\index{same page, both encaped|seexalso{bar}}
\newpage
text
\index{diff pages I|seealso{bar}}
\index{diff pages II}
\printindex
\end{document} |
I don't know why this doesn't work in MacTeX 2022 which is used on my Mac. |
Did you specify |
First a minimal working example is as follows.
Index page output without the
\usepackage{hyperref}
line is as follows. The last output line correctly sees the pageno located before the see also reference.Index
bar, 1
foo, 1, see also bar
However, index page output including the
\usepackage{hyperref}
line incorrectly/undesirably relocates the see also reference before the pageno.Index
bar, 1
foo, see also bar, 1
Question: How can I have my cake and eat it too, i.e., include
hyperref
but locate pageno references before see and see also index entry text as in the output withouthyperref
?Could
hyperref
fix the question?The text was updated successfully, but these errors were encountered: