Pandoc & Markdown: Colored links in PDF output

Step-by-Step descriptions of how to do things.

Pandoc & Markdown: Colored links in PDF output

Postby peter_b » Mon Aug 27, 2018 5:06 pm

I've become a big fan of using Markdown in combination with Pandoc for writing stuff of all sorts: documentation, articles, etc.

But when rendering to PDF output, the default for HTML-links is not optically distinguishable from regular text. So links are practically invisible in the resulting PDF :(

Here are different options for making the links visible (=formatting them):

1) Underline links
Add the following to the Pandoc YAML-header block in your Markdown file:
Code: Select all
header-includes:
  - \hypersetup{colorlinks=false,
      allbordercolors={0 0 0},
      pdfborderstyle={/S/U/W 1}}


This will give you black-colored, but underlined hyperlink references.
Change the "colorlinks=false" to "true" and you'll get the links colored in pink :P

2) Color links
If you don't want/need your links underlined, but simply want the visible - in a different color, just add the following option to the YAML-header block:
Code: Select all
linkcolor: blue


Better! 8)

Links:
Why are my hyper references pink?
Pandoc Manual: Metadata Blocks
  • 0

User avatar
peter_b
Chatterbox
 
Posts: 302
Joined: Tue Nov 12, 2013 2:05 am
Reputation: 3

Return to HowTo's

Who is online

Users browsing this forum: No registered users and 10 guests

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: No registered users and 22 guests

cron
Reputation System ©'