Add example beamer document

pull/202/head
Matti Pastell 2019-03-10 20:10:30 +02:00
parent 3488af5534
commit 6f83f1abf5
3 changed files with 76 additions and 1 deletions

46
examples/beamer.tpl Normal file
View File

@ -0,0 +1,46 @@
\documentclass{beamer}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{microtype}
\usepackage{hyperref}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1.2ex}
\hypersetup
{ pdfauthor = { {{{:author}}} },
pdftitle={ {{{:title}}} },
colorlinks=TRUE,
linkcolor=black,
citecolor=blue,
urlcolor=blue
}
{{#:title}}
\title{ {{{ :title }}} }
{{/:title}}
{{#:author}}
\author{ {{{ :author }}} }
{{/:author}}
{{#:date}}
\date{ {{{ :date }}} }
{{/:date}}
{{ :highlight }}
\begin{document}
{{{#:title}}}
\begin{frame}
\titlepage
\end{frame}
{{{/:title}}}
{{{ :body }}}
\end{document}

View File

@ -0,0 +1,29 @@
---
title : A minimal beamer example using Weave markdown
author : Matti Pastell
options :
doctype : md2pdf
out_path : pdf
template : beamer.tpl
---
```julia; echo=false
struct Begin
text
title
end
struct End
text
end
Base.show(io::IO, m::MIME"text/latex", b::Begin) = write(io, "\\begin{$(b.text)}[fragile]\n\\frametitle{$(b.title)}\n")
Base.show(io::IO, m::MIME"text/latex", e::End) = write(io, "\\end{$(e.text)}")
```
! Begin("frame", "Random plot")
```julia; out_width="0.5\\textwidth"
using Plots
scatter(randn(1000), randn(1000))
```
! End("frame")

View File

@ -171,7 +171,7 @@ function format_chunk(chunk::DocChunk, formatdict, docformat::JMarkdown2HTML)
ioformat!(io, out, fun)
write(out, addspace(inline.rich_output, inline))
elseif !isempty(inline.figures)
write(io, inline.figures[end]))
write(io, inline.figures[end])
elseif !isempty(inline.output)
write(io, addspace(inline.output, inline))
end