Defekte Footnotebackref-Links zu Fußnoten im Glossar, erstellt mit longtable

Defekte Footnotebackref-Links zu Fußnoten im Glossar, erstellt mit longtable

Ich habe einen Glossarstil erstellt (basierend auf einem bestehenden Stil). Er weist nicht die schwerwiegenderen Probleme mit Fußnoten auf, die meine vorherigen Ansätze hatten. Dennoch besteht weiterhin ein fußnotenbezogenes Problem.

  • Links erstellt mitfootnotebackrefLink zum Anfang des Dokuments. Das erwartete Verhalten ist ein Link zurück zum Glossareintrag mit der Fußnote.

Q: Wie kann ich diese Links reparieren?

Andere Links, wie etwa der Link vom Fußnotenzeichen zum Seitenende, funktionieren einwandfrei.

Der neue Glossarstil basiert auf longtable, das Fußnoten besser handhabt als beispielsweise der Stil tabularoder alttreehypergroup. Fußnotentexte und Markierungen selbst werden durchsepfootnotes, wobei der Fußnotentext in der Präambel und die Fußnotenzeichen in einer .bibmit zu kompilierenden Datei erscheinen bib2gls.


Siehe minimal funktionierendes Beispiel. Der Stil selbst wurde ebenfalls vereinfacht.

\documentclass[12pt]{book}
\usepackage{tocloft}                                    % for cftdotfill
\usepackage{array}                                      % m-type column in longtable
\usepackage{longtable}                                  % longtable for glossary
%\usepackage[symbol*, multiple]{footmisc}               % (In real document, used primarily for changing footnote style)
\usepackage[global]{sepfootnotes}                       % for separation of footnotemark and text but toward still using hyperlinks
\usepackage[hypertexnames=false]{hyperref}
\usepackage{footnotebackref}
\usepackage[a4paper,showframe]{geometry}                % testing for boundaries
\newgeometry{margin=2.5cm}

%% Footnotetexts %%
\sepfootnotecontent{A}{long fake name's footnote}
\sepfootnotecontent{B}{short fake name's footnote}
\sepfootnotecontent{C}{subentry fake name's footnote}
\sepfootnotecontent{D}{different fake name's footnote}

%%%%% FOR GLOSSSARY (Begins below) %%%%%
\usepackage[record, stylemods={default}]{glossaries-extra}                  % main glossary package
\GlsXtrLoadResources[src={entriesTest}, break-at={none}]                    % loading glossary file entriesTest.bib (for bib2gls)
\usepackage{glossary-longbooktabs}                                          % glossary longtable styles, commands etc

% Some basic formatting of glossary %
\def\myglsdefaultnamefmt#1{\textbf{#1}}
\def\myglsnavigationfmt#1{\myglsdefaultnamefmt{#1}}
\def\myglsnavigationfmtSpecial#1{{\hspace{5em}\Large\myglsdefaultnamefmt{#1}}}
\newcommand\mySpaceInGlsSub{2em}
%%

% Dots in glossary %
\renewcommand{\cftchapleader}{\cftdotfill{\cftsecdotsep}}
\renewcommand*\glspostdescription{\cftdotfill{\cftsecdotsep}}
%%

%% Actual glossary style definition is here %%
\makeatletter
\ifcsdef{@glsstyle@longragged3col}
{%
    \renewglossarystyle{longragged3col}{%
        \renewenvironment{theglossary}%
        {\renewcommand*{\arraystretch}{1.4}
            \setlength\LTleft{0pt}
            \setlength\LTright{0pt}
            \begin{longtable}{@{\extracolsep{\fill}}m{5cm}>{\raggedright}m{\dimexpr\textwidth-5cm-2\tabcolsep}@{}}}%
            {\end{longtable}}%
        \renewcommand*{\glossaryheader}{%
            \par
            \def\@gls@prevlevel{-1}%
            \hangindent0pt\relax
            \parindent0pt\relax
            \myglsnavigationfmt{\makebox[0pt]{\hspace{0.98\textwidth}\glsnavigation}}
            \glsgroupskip
            \glsgroupskip
        }%
        \renewcommand*{\glsgroupheading}[1]{%
            \glsxtrgetgrouptitle{##1}{\glsxtr@grptitle}%
            \glstreePreHeader{##1}{\glsxtr@grptitle}%
            \myglsnavigationfmtSpecial{\glsnavhypertarget{##1}{\glsxtr@grptitle\,\MakeLowercase{\glsxtr@grptitle}}}%
            \def\@gls@prevlevel{-1}%
            \hangindent0pt\relax
            \parindent0pt\relax
            \glsgroupskip
        }%
        \renewcommand{\glossentry}[2]{%
            \glsentryitem{##1}{\glossentryname{##1}} & \glossentrydesc{##1} \glspostdescription\ ##2\tabularnewline
        }%
        \renewcommand{\subglossentry}[3]{%
            \hspace{\mySpaceInGlsSub}\hangindent\mySpaceInGlsSub\glssubentryitem{##2}{\glossentryname{##2}} &
            \hspace{\mySpaceInGlsSub}\hangindent\mySpaceInGlsSub{\glossentrydesc{##2}}\glspostdescription\ ##3\tabularnewline
        }%
        \ifglsnogroupskip
        \renewcommand*{\glsgroupskip}{}%
        \else
        \renewcommand*{\glsgroupskip}{&\tabularnewline}%
        \fi
    }
}
\makeatother
%%%%
%%%%% FOR GLOSSSARY (Ends above) %%%%%

\begin{document}
    Lala.\footnote{test} \newpage
    \gls*{test-entry}
    \gls*{test-entryII}
    \gls*{test-entryIII}
    \gls*{test-entryIV}
    \gls*{test-entryV}
    \gls*{test-entryVI}
    \newcommand{\TitleOfGlossary}{Title of Glossary}
    \setcounter{footnote}{0}
    {\footnotesize\printunsrtglossary[type=main,style={longragged3col},title={\protect\Large\centering\TitleOfGlossary\pagestyle{empty}},toctitle=\TitleOfGlossary]}
\end{document}

HilfsentriesTest.bib

@entry{test-entry,
name={fake name\sepfootnote{A}, but with a longish text to make sure there is some text wrapping},
text={},
description={fictional description}
}

@entry{test-entryII,
name={fake name\sepfootnote{B}},
text={},
description={fictional description B}
}

@entry{test-entryIII,
parent={test-entryII},
name={fake subname that also spans multiple lines\sepfootnote{C}},
text={},
description={fictional description C}
}

@entry{test-entryIV,
name={different fake name},
text={},
description={fictional description D\sepfootnote{D}}
}

@entry{test-entryV,
name={f' yet another fake name with longer text indeed},
text={},
description={Am I indented properly?}
}

@entry{test-entryVI,
parent={test-entryV},
name={f' yet another fake subname with long text yes},
text={},
description={But am I indented properly? Especially when I am also line broken? What about my vertical spacing?}
}

Ausgabe mit erläuternder Annotation

Ausgabe von MWE mit einer erläuternden Anmerkung

verwandte Informationen