Improve formatting of footnotes. (#107)

- improve footnote formatting using package `footmisc`
- make the references from the footnotes at the bottom of the page into links back to the occurence of the footnotes in the main text and introduce an option `disable-footnote-backlinks` to disable this new behaviour.
- load pkg footnotebackref after pkg footnotehyper
- make footnote prettifying optional using template var
This commit is contained in:
Salim B 2019-10-03 19:20:22 +02:00 committed by Pascal Wagler
parent a24f339d6c
commit 43140ba043
2 changed files with 21 additions and 0 deletions

View File

@ -120,6 +120,14 @@ This template defines some new variables to control the appearance of the result
the text on the right side of the footer the text on the right side of the footer
- `footnotes-pretty` (defaults to `false`)
prettifies formatting of footnotes (requires package `footmisc`)
- `footnotes-disable-backlinks` (defaults to `false`)
disables making the reference from the footnote at the bottom of the page into a link back to the occurence of the footnote in the main text.
- `book` (defaults to `false`) - `book` (defaults to `false`)
typeset as book typeset as book

View File

@ -248,6 +248,14 @@ $endif$
\definecolor{default-citecolor}{HTML}{4077C0} \definecolor{default-citecolor}{HTML}{4077C0}
\definecolor{default-urlcolor}{HTML}{4077C0} \definecolor{default-urlcolor}{HTML}{4077C0}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
$if(footnotes-pretty)$
% load footmisc in order to customize footnotes (footmisc has to be loaded before hyperref, cf. https://tex.stackexchange.com/a/169124/144087)
\usepackage[hang,flushmargin,bottom,multiple]{footmisc}
\setlength{\footnotemargin}{0.8em} % set space between footnote nr and text
\setlength{\footnotesep}{\baselineskip} % set space between multiple footnotes
\setlength{\skip\footins}{0.3cm} % set space between page content and footnote
\setlength{\footskip}{0.9cm} % set space between footnote and page bottom
$endif$
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{ \hypersetup{
$if(title-meta)$ $if(title-meta)$
@ -342,6 +350,11 @@ $else$
\makesavenoteenv{longtable} \makesavenoteenv{longtable}
$endif$ $endif$
$endif$ $endif$
% add backlinks to footnote references, cf. https://tex.stackexchange.com/questions/302266/make-footnote-clickable-both-ways
$if(footnotes-disable-backlinks)$
$else$
\usepackage{footnotebackref}
$endif$
$if(graphics)$ $if(graphics)$
\usepackage{graphicx,grffile} \usepackage{graphicx,grffile}
\makeatletter \makeatletter