
Criei um estilo de glossário (baseado no estilo existente). Ele não apresenta os problemas mais graves com notas de rodapé que minhas abordagens anteriores apresentavam. No entanto, persiste um problema relacionado com as notas de rodapé.
- Links feitos com
footnotebackref
link para o início do documento. O comportamento esperado é vincular de volta à entrada do glossário com a nota de rodapé.
P: Como consertar esses links?
Outros links, como o link da nota de rodapé para a parte inferior da página, funcionam corretamente.
O novo estilo de glossário é baseado em longtable
, que lida melhor com notas de rodapé do que o estilo tabular
ou alttreehypergroup
, por exemplo. Os textos das notas de rodapé e as próprias marcas são separados porsepfootnotes
, com texto de nota de rodapé aparecendo no preâmbulo e notas de rodapé em um .bib
arquivo a ser compilado com bib2gls
.
Veja exemplo minimamente funcional. O estilo em si também foi simplificado.
\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}
AuxiliarentriesTest.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?}
}
Saída com anotação esclarecedora