From 17725a0661dabd8d8b9203adbe08fe9e4c6780fe Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 13 Mar 2018 10:02:08 -0700 Subject: 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. --- src/Text/Pandoc/Writers/LaTeX.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3