ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.
https://ulyngs.github.io/oxforddown/
MIT License
221 stars 81 forks source link

Make page number, not text, be link in TOC #26

Closed shirdekel closed 2 years ago

shirdekel commented 3 years ago

Next to the linkcolor-rgb value in index.Rmd there is a comment that says that "In the coloring normal links looks a bit excessive, as it highlights also all links in the table of contents"

Adding linktocpage to hypersetup makes the links appear only for the page numbers, not the text, in the TOC. This makes the amount of link highlighting a little less excessive.

For instance:

\hypersetup{
  hidelinks,
  colorlinks,
  linktocpage,
  linkcolor=$if(linkcolor-rgb)$mylinkcolor$else$.$endif$,
  urlcolor=$if(urlcolor-rgb)$myurlcolor$else$.$endif$,
  citecolor=$if(citecolor-rgb)$mycitecolor$else$.$endif$
}

Obviously this could be made optional and be controlled from index.Rmd. Happy to submit a PR.

ulyngs commented 3 years ago

Agreed - I was thinking a bit about this when I was looking into the different ways to allow for customisation of link colouring etc.

Could you submit a PR and also add a suggested section that documents this to the new 'How to Use' chapter?

shirdekel commented 3 years ago

Just submitted the PR. Can you clarify what you expect for the 'How to Use' chapter, though? Currently it seems quite high level and it feels like adding something about TOC link highlighting would be out of place. Or do you eventually want to it be quite detailed?

ulyngs commented 2 years ago

Good question, I was wondering a bit about what would be best.

There's a couple of options:

  1. the 'How to Use' chapter remains high-level, and more detailed things such as TOC link highlighting go in the 'Customisations and Extensions chapter'
  2. the 'How to Use' chapter adds a section named something like 'setting layout options in index.Rmd' - this section has brief explanations for each of the setting that are available directly from index.Rmd's YAML header, without any further tweaking

I favour the second option - would you agree?

ulyngs commented 2 years ago

Merged pull request and tweaked

Zenahr commented 2 years ago

@ulyngs since this has been merged the issue can be closed.

shirdekel commented 2 years ago

Good question, I was wondering a bit about what would be best.

There's a couple of options:

  1. the 'How to Use' chapter remains high-level, and more detailed things such as TOC link highlighting go in the 'Customisations and Extensions chapter'

  2. the 'How to Use' chapter adds a section named something like 'setting layout options in index.Rmd' - this section has brief explanations for each of the setting that are available directly from index.Rmd's YAML header, without any further tweaking

I favour the second option - would you agree?

Sorry for the delayed response. Yes, I thought that something like option 2 is better!