Pandoc & Markdown: Colored links in PDF output
Posted: 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:
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
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:
Better!
Links:
Why are my hyper references pink?
Pandoc Manual: Metadata Blocks
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}}
Change the "colorlinks=false" to "true" and you'll get the links colored in pink
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
Links:
Why are my hyper references pink?
Pandoc Manual: Metadata Blocks