ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.

Home Page:https://ulyngs.github.io/oxforddown/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

if show-abstract-in-toc: true, Abstract TOC hyperlink is to Acknowledgements

mtthwborg opened this issue · comments

If show-abstract-in-toc in _index is made to be true, the Abstract is added to the TOC (table of contents). However, the hyperlink for the abstract moves to Acknowledgements instead. Acknowledgements is not included in TOC but is the page before the Abstract.

All I did was change show-abstract-in-toc in _index to true (default is false); nothing else was changed in oxforddown. However, I tested adding \phantomsection to template.tex, which did fix the hyperlink (source). Perhaps this could be incorporated into the template?

%%%%% ABSTRACT
$if(abstract)$

$if(show-abstract-in-toc)$
\phantomsection % NEW INSERTION, or \providecommand\phantomsection{}
\addcontentsline{toc}{chapter}{$if(abstract-heading)$$abstract-heading$$else$Abstract$endif$}
\renewcommand{\numberstyleabstract}{plain}
$endif$

\renewcommand{\abstracttitle}{$if(abstract-heading)$$abstract-heading$$else$Abstract$endif$}
\begin{abstract}
	$abstract$
\end{abstract}

$endif$

On a somewhat related note from adding sections before the main chapters (such as a list of keywords and presentations), I needed to use \phantomsection for each section, as well as \newpage before them. This solved the links. The roman numerals in the table of contents for the earlier sections did not align with the actual roman numeral page numbers, and the last section did not show despite being added to the ToC. These issues do not affect the unchanged oxforddown, but may be issues inherent to the template possibly for the same reasons that the abstract link is misaligned.

Fixed w/ dc80bb5 -- thanks for flagging this!