diff options
| author | John MacFarlane <[email protected]> | 2022-03-13 10:48:09 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-03-13 10:48:09 -0700 |
| commit | f3fcdd52c8bc722862ea73958d41fe53ec03ec1d (patch) | |
| tree | 045a3cbb879d9826da1e7bebd36f5abc38b4080c /data | |
| parent | 6b79e944bb3fba348fc23455e00b18558f8e17ab (diff) | |
LaTeX template: move hyperref near end of preamble.
It now comes after header-includes and right before title, author, date,
abstract.
The hyperref documentation says: “Make sure it comes last of your loaded
packages”. The reason is that it redefines many LaTeX commands.
For example, loading it after titlesec (which might be loaded in
header-includes) causes links in the table of contents to point to
the wrong page (#7960).
Closes #5811.
Note: Users who presuppose hyperref in their header-includes
will now have to add `\usepackage{hyperref}` to their header-includes
to make it available there. (The redundant `\usepackage` will
do no harm in this case.)
Diffstat (limited to 'data')
| -rw-r--r-- | data/templates/default.latex | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/data/templates/default.latex b/data/templates/default.latex index 438f84690..e83806940 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -211,33 +211,6 @@ $if(verbatim-in-note)$ $endif$ \usepackage{xcolor} \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} -\hypersetup{ -$if(title-meta)$ - pdftitle={$title-meta$}, -$endif$ -$if(author-meta)$ - pdfauthor={$author-meta$}, -$endif$ -$if(lang)$ - pdflang={$lang$}, -$endif$ -$if(subject)$ - pdfsubject={$subject$}, -$endif$ -$if(keywords)$ - pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, -$endif$ -$if(colorlinks)$ - colorlinks=true, - linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$}, - filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$}, - citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$}, - urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$}, -$else$ - hidelinks, -$endif$ - pdfcreator={LaTeX via pandoc}} \urlstyle{same} % disable monospaced font for URLs $if(verbatim-in-note)$ \VerbatimFootnotes % allow verbatim text in footnotes @@ -409,6 +382,33 @@ $endif$ $if(csquotes)$ \usepackage{csquotes} $endif$ +\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} +\hypersetup{ +$if(title-meta)$ + pdftitle={$title-meta$}, +$endif$ +$if(author-meta)$ + pdfauthor={$author-meta$}, +$endif$ +$if(lang)$ + pdflang={$lang$}, +$endif$ +$if(subject)$ + pdfsubject={$subject$}, +$endif$ +$if(keywords)$ + pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, +$endif$ +$if(colorlinks)$ + colorlinks=true, + linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$}, + filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$}, + citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$}, + urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$}, +$else$ + hidelinks, +$endif$ + pdfcreator={LaTeX via pandoc}} $if(title)$ \title{$title$$if(thanks)$\thanks{$thanks$}$endif$} |
