Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colorlinks options not working after recent update #8226

Closed
leowill01 opened this issue Aug 11, 2022 · 4 comments
Closed

colorlinks options not working after recent update #8226

leowill01 opened this issue Aug 11, 2022 · 4 comments

Comments

@leowill01
Copy link

PROBLEM

The colorlinks=true option isn't working for me as first discovered using colorlinks: yes in the YAML frontmatter when knitting with rmarkdown::render() in RStudio.

After some recent software updates including pandoc, none of the following commands I tried produce a PDF with red-colored TOC links or blue-colored hyperlinks:

pandoc -f markdown -o out.pdf -V colorlinks=true doc.Rmd
pandoc -f markdown -o out.pdf -V colorlinks=true -V urlcolor=blue doc.Rmd
pandoc -f markdown -o out.pdf -V colorlinks:true -V urlcolor:blue doc.Rmd
pandoc -f markdown -o out.pdf --variable=colorlinks:true --variable=urlcolor:blue Untitled.Rmd
pandoc -f markdown -o out.pdf -V colorlinks -V linkcolor=blue -V urlcolor=blue Untitled.Rmd

And this reprex Rmd doesn't work with knitting to PDF through RStudio:

---
title: 'Title'

output:
  bookdown::pdf_document2:
    latex_engine: xelatex

colorlinks: yes # doesnt work as it recently used to
urlcolor: blue # doesnt do anything
---

`[^ TOC LINKS NOT COLORED RED AS EXPECTED]`

# Header

Some text.
This is a [hyperlink to Google](www.google.com). `[<- HYPERLINK NOT COLORED BLUE AS EXPECTED]`

I've tried other things such as using urlcolor: blue, but it's worked for years previously without having to set this and it doesn't change anything when I've tried to use it now.
{Colorlinks option is not applied to some hyperlinks · Issue #6453 · jgm/pandoc · GitHub; Colorlinks option failing when producing a beamer presentation · Issue #3877 · jgm/pandoc · GitHub}

SESSION INFO

pandoc --version

pandoc 2.19
Compiled with pandoc-types 1.22.2, texmath 0.12.5.2, skylighting 0.13,
citeproc 0.8.0.1, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4
User data directory: /Users/leo/.local/share/pandoc
Copyright (C) 2006-2022 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
macOS Monterey v12.5
RStudio 2022.07.1 Build 554
@leowill01 leowill01 added the bug label Aug 11, 2022
@tarleb
Copy link
Collaborator

tarleb commented Aug 11, 2022

Can you try calling pandoc with -V boxlinks? I believe the fix for #8198 is the cause for this issue.

@tarleb
Copy link
Collaborator

tarleb commented Aug 11, 2022

Thanks for the report – should be fixed now. Adding boxlinks: true to your YAML header should work as a workaround.

@jgm
Copy link
Owner

jgm commented Aug 13, 2022

Sorry about the regression -- we'll try to push out a point release in the near future.

@leowill01
Copy link
Author

Thanks for the report – should be fixed now. Adding boxlinks: true to your YAML header should work as a workaround.

Can confirm having both colorlinks: true and boxlinks: true (in YAML header) does in fact work for me and resolves the problem. Link text (toc=red, hyperlinks=blue) are colored as they had been previously, and there are no actual boxes that show around the link text as it would do if only boxlinks: true was enabled. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants