1

Please refer to \index in \pagenote with splitindex option (for multiple index)

With the following MWE no epub could be made with tex4ebook.

\documentclass{report}
\usepackage{index}
\usepackage[texindy,splitindex]{imakeidx}
\usepackage[hyperindex,hidelinks]{hyperref}
\usepackage[page]{pagenote}

\input{pagenote-index-usageB.tex}% See code below \makeindex[program=texindy,name=Names,title=Names] \makeindex[program=texindy,name=Something,title=Something] \makepagenote

\begin{document}

First index.\index[Something]{First index} 

Sentence.\pagenote{First pagenote without index.}

\clearpage

Emph index.\index[Something]{Emph index@\emph{Emph index}} 

pagenote and index.\pagenote{Second pagenote with index.\protect\is[Something]{Index inside second pagenote|seealso{Emph index}}}

\clearpage

Third pagenote.\pagenote{\emph{Emph index word}.\protect\is[Something]{Emph index@\emph{Emph index}}\protect\is[Something]{Emph index@\emph{Emph index}|see{Index inside second pagenote}}}

Namenindex\index[Names]{Namenindex}

\printnotes

\printindex[Something]
\printindex[Names]

\end{document}

with help of the file pagenote-index-usageB.tex

\newcommand\pn[2]{\hyperpage{#2}\hyperlink{pn:#1}{A#1}}
\makeatletter
\let\if@nopnote\iffalse % just for the example
\renewcommand{\notenuminnotes}[1]{%
    \edef\tempnumber{#1}%
    \edef\temppgnumber{\thepage}%
    {\normalfont #1.} }
\ExplSyntaxOn
\NewDocumentCommand {\is} { om }{%
    \if@nopnote
    \IfValueTF { #1 } {
        \index[#1]{#2}
    }{
        \index{#2}
    }
    \else
    \hypertarget{pn:\tempnumber}{}%
    \IfValueTF { #1 } {
        \thomkrates_pagenoteindex:nene { #1 } { \tempnumber } { #2 } { \temppgnumber }
    }{
        \thomkrates_pagenoteindex:ene { \tempnumber } { #2 } { \temppgnumber }
    }
    \fi
}
\cs_new_protected:Nn \thomkrates_pagenoteindex:nnnn
{
    \index [#1] { #3 | pn {#2}{#4} }
}
\cs_generate_variant:Nn \thomkrates_pagenoteindex:nnnn { nene }
\cs_new_protected:Nn \thomkrates_pagenoteindex:nnn
{
    \index  { #2 | pn {#1}{#3} }
}
\cs_generate_variant:Nn \thomkrates_pagenoteindex:nnn { ene }
\ExplSyntaxOff
\makeatother

pdflatex does a good job and the multiple index is working as intended with index entries pageAnotenum: xAn ... 324A84 for example.

But when producing an epub with tex4ebook the first \index{} gives an error..."extra }"

Is there a chance to get an epub with multiple index and pagenote-indexing?

Thank your for support.

0 Answers0