9

Is there any way to underline links with pandoc?

[Geogebra](http://google.com)

I get this

enter image description here

but I prefer __Geogebra__ (__ means underline)

  • 1
    Since pandoc is creating a beamer presentation which uses hyperref, you just need to pass the appropriate setup for hyperref to pandoc. See Underlined links with hyperref possible? for the hyperref solution. – Alan Munn Jul 13 '16 at 15:54
  • In my case, beamer don't load hyperref: pandoc -D beamer | grep hyperr gives me: % avoid problems with \sout in headers with hyperref:. But else latex templates gives me \usepackage{hyperref} in the results of grep – somenxavier Jul 14 '16 at 19:08
  • 1
    beamer loads hyperref itself, so you don't see it in the output of pandoc -D but it's definitely loaded. – Alan Munn Jul 14 '16 at 19:13
  • So, where does it load the hyperref package? How can I modify it? – somenxavier Jul 15 '16 at 11:49
  • Is there a solution for other output documents: like context or html? – somenxavier May 23 '19 at 16:03
10

The following document, when converted with pandoc generated underlined links in the resultant PDF. However, as noted in the comments to the linked question here Underlined links with hyperref possible? not all viewers can display the underlined links properly. On my machine (a Mac) only Adobe Reader displays the underlining correctly; both Skim and Preview show a box around the link instead of underlining.

Markdown document

---
header-includes:
  - \hypersetup{colorlinks=false,
            allbordercolors={0 0 0},
            pdfborderstyle={/S/U/W 1}}
---

## A frame title

* A list
* A list
* [A list with a link](http://tex.stackexchange.com)

Output PDF (Acrobat)

Acrobat Reader image of output

|improve this answer|||||
  • I want to include this code in my beamer template which I get from pandoc -D beamer. How can I include in my beamer template if beamer templates does not include usepackage{hyperref}? I want permanent solution – somenxavier Jul 15 '16 at 11:52
  • Just add them as you would any other LaTeX code to the template. Since beamer loads hyperref your beamer template will "understand" the \hypersetup command as it does in this document. – Alan Munn Jul 15 '16 at 12:15
  • I wanted to underline links in a straight Markdown to PDF pandoc conversion, and including this header worked. – François Leblanc Jun 29 '18 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.