aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-03-13 10:02:08 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-03-13 10:03:51 -0700
commit17725a0661dabd8d8b9203adbe08fe9e4c6780fe (patch)
treed710a78941784ec8294e90a75953b48e121601d2 /src/Text
parentf921b388699dc870d5190c55904d9732e9770874 (diff)
downloadpandoc-17725a0661dabd8d8b9203adbe08fe9e4c6780fe.tar.gz
Beamer: put hyperlink after `\begin{frame}`.
and not in the title. If it's in the title, then we get a titlebar on slides with the `plain` attribute, when the id is non-null. This fixes a regression from 1.9.x. Closes #4307.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index f61c878e5..58a4c4d86 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -411,15 +411,15 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts)
slideTitle <-
if tit == [Str "\0"] -- marker for hrule
then return []
- else
- if null ident
- then return $ latex "{" : tit ++ [latex "}"]
- else do
- ref <- toLabel ident
- return $ latex ("{%\n\\protect\\hypertarget{" ++
- ref ++ "}{%\n") : tit ++ [latex "}}"]
+ else return $ latex "{" : tit ++ [latex "}"]
+ ref <- toLabel ident
+ let slideAnchor = if null ident
+ then []
+ else [latex ("\n\\protect\\hypertarget{" ++
+ ref ++ "}{}")]
let slideStart = Para $
- RawInline "latex" ("\\begin{frame}" ++ options) : slideTitle
+ RawInline "latex" ("\\begin{frame}" ++ options) :
+ slideTitle ++ slideAnchor
let slideEnd = RawBlock "latex" "\\end{frame}"
-- now carve up slide into blocks if there are sections inside
bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts