diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-10-13 21:48:14 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-10-13 21:48:14 -0700 |
commit | 198862ee40702c8844e4d0503329b69a3062c49b (patch) | |
tree | e26143864c28e72ca4d70a56b5667f55feca2552 | |
parent | 25e0e0bd2afb57cae2a43d668d20640dfbf3db88 (diff) | |
download | pandoc-198862ee40702c8844e4d0503329b69a3062c49b.tar.gz |
LaTeX writer: add `\protect` to `\hyperdef` in inline context.
This way we don't get an error when this is used as a moveable
argument.
Closes #2136.
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 0caa80795..b2e7dc1ba 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -748,7 +748,7 @@ inlineToLaTeX (Span (id',classes,kvs) ils) = do ref <- toLabel id' let linkAnchor = if null id' then empty - else "\\hyperdef{}" <> braces (text ref) <> + else "\\protect\\hyperdef{}" <> braces (text ref) <> braces ("\\label" <> braces (text ref)) fmap (linkAnchor <>) ((if noEmph then inCmd "textup" else id) . |