1

I'm presently modifying the default pandoc template for Beamer so that the email address of the presentation's author can be added. However, when I try to add a valid e-mail address the for statement ends up by repetitively embedding the value even though there is only a single value.

Take for example:

---
email: 'toad@gmail.com'
---

With the following templated variable:

$for(email)$ \href{mailto:$email$}{\nolinkurl{$email$}}$sep$ \and $endfor$

I end up receiving:

\href{mailto:\href{mailto:toad@gmail.com}{\nolinkurl{toad@gmail.com}}}{\nolinkurl{\href{mailto:toad@gmail.com}{\nolinkurl{toad@gmail.com}}}}

instead of the desired:

\href{mailto:toad@gmail.com}{\nolinkurl{toad@gmail.com}}

If instead I set email to be a non-valid address, e.g.

---
email: 'toad'
--- 

I receive the value toad embedded. Only when I begin to add the @ sign and an additional letter after does the repetitive embedding become present. I've searched through the docs to no avail as to what might be causing this behavior.

coatless
  • 20,011
  • 13
  • 69
  • 84
  • I cannot reproduce either with pandoc 17.1; it might have to do with where you set this in the template. Are you redefining `\titlepage`? – scoa Jan 19 '17 at 10:20

1 Answers1

0

When using for, the templating system expects an array. In YAML an array can be written e.g. like this:

---
email:
  - 'toad@gmail.com'
---

Edit: but that doesn't seem to be the issue, cannot reproduce with pandoc 1.18

mb21
  • 34,845
  • 8
  • 116
  • 142
  • I thought based on http://stackoverflow.com/questions/26483499/pandoc-template-with-yaml-metadata that the key approach above would be okay. – coatless Jan 19 '17 at 08:42
  • indeed, see my edit... can you try in the newest pandoc version? – mb21 Jan 19 '17 at 11:07