git.iko.soy/typeable/pandoc
on master help sign in
LaTeX/Beamer writer: allow hyperlinks to frames.
38c3a68John MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+13−4
@@ -390,10 +390,19 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts)
390 let options = if null optionslist
390 let options = if null optionslist
391 then ""
391 then ""
392 else "[" ++ intercalate "," optionslist ++ "]"
392 else "[" ++ intercalate "," optionslist ++ "]"
393− let slideStart = Para $ RawInline "latex" ("\\begin{frame}" ++ options) :
393+ let latex = RawInline (Format "latex")
394+ slideTitle <-
394− if tit == [Str "\0"] -- marker for hrule
395+ if tit == [Str "\0"] -- marker for hrule
395− then []
396+ then return []
396− else (RawInline "latex" "{") : tit ++ [RawInline "latex" "}"]
397+ else
398+ if null ident
399+ then return $ latex "{" : tit ++ [latex "}"]
400+ else do
401+ ref <- toLabel ident
402+ return $ latex ("{%\n\\protect\\hypertarget{" ++
403+ ref ++ "}{%\n") : tit ++ [latex "}}"]
404+ let slideStart = Para $
405+ RawInline "latex" ("\\begin{frame}" ++ options) : slideTitle
397 let slideEnd = RawBlock "latex" "\\end{frame}"
406 let slideEnd = RawBlock "latex" "\\end{frame}"
398 -- now carve up slide into blocks if there are sections inside
407 -- now carve up slide into blocks if there are sections inside
399 bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts
408 bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts