Commit 359c18c9 authored by G. Jay Kerns's avatar G. Jay Kerns

lot of work on julia beamer

parent edb172b0
#+TITLE: julia-beamer.org #+STARTUP: beamer
#+AUTHOR: G. Jay Kerns #+TITLE: Sample =julia= Presentation
#+EMAIL: jay@gandalfrodo.no-ip.org #+AUTHOR: G. Jay Kerns
#+DATE: 2013-02-25 Mon
#+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+LaTeX_CLASS: beamer #+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation, bigger] #+LaTeX_CLASS_OPTIONS: [presentation]
#+OPTIONS: H:2
#+BEAMER_THEME: default #+BEAMER_THEME: default
#+BEAMER_COLOR_THEME: beaver
#+BEAMER_HEADER: \institute{The Really Great Institute \\ Somewhere On, Earth}
#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_act(Act) %4BEAMER_col(Col) %8BEAMER_opt(Opt) #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_act(Act) %4BEAMER_col(Col) %8BEAMER_opt(Opt)
#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC
#+PROPERTY: exports both
#+PROPERTY: results output
#+PROPERTY: session *julia* #+PROPERTY: session *julia*
#+PROPERTY: tangle yes
* A Sample =julia= Beamer presentation
* Getting started
#+BEGIN_SRC emacs-lisp :results silent :eval no-export
(load "~/gitm/projects/ob-julia.el")
(org-babel-julia-initiate-session "*julia*" nil)
#+END_SRC
Read the following links.
- http://orgmode.org/worg/exporters/beamer/tutorial.html
- http://orgmode.org/worg/exporters/beamer/ox-beamer.html
- http://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export
Add the following to =.emacs=
#+BEGIN_SRC emacs-lisp :eval never
(require 'ox-beamer)
#+END_SRC
You also need to add the LaTeX class.
#+BEGIN_SRC emacs-lisp :eval never
(add-to-list 'org-latex-classes
'("beamer"
"\\documentclass[presentation]{beamer}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
#+END_SRC
** Exported title
:PROPERTIES:
:EXPORT_LaTeX_CLASS: beamer
:EXPORT_LaTeX_CLASS_OPTIONS: [presentation,smaller]
:EXPORT_BEAMER_THEME: default
:EXPORT_FILE_NAME: presentation.pdf
:END:
- amsdk
- kdsalk
- adkfa
- jlksa
* This is the first structural section
** Frame 1 ** Frame 1
#+BEAMER: \framesubtitle{with a subtitle} #+BEAMER: \framesubtitle{Two blocks with a pause in between, noweb reference}
*** Here is some =julia= code :BMCOL:B_block:
*** Thanks to Eric Fraga
:PROPERTIES: :PROPERTIES:
:BEAMER_env: block :BEAMER_env: block
:BEAMER_envargs: C[t] :BEAMER_envargs: C[t]
:BEAMER_col: 0.5 :BEAMER_col: 0.5
:END: :END:
for the first viable beamer setup in Org
*** Thanks to everyone else #+NAME: simple-code
#+BEGIN_SRC julia :exports code :eval never
2+3
print("hello, there!")
sqrt(5)
#+END_SRC
\pause
*** Here is the output :BMCOL:B_block:
:PROPERTIES: :PROPERTIES:
:BEAMER_col: 0.5 :BEAMER_col: 0.5
:BEAMER_env: block :BEAMER_env: block
:BEAMER_envargs: <2-> :BEAMER_envargs: <2->
:END: :END:
for contributing to the discussion
**** This will be formatted as a beamer note #+BEGIN_SRC julia :exports results :results output :noweb yes
:PROPERTIES: <<simple-code>>
:BEAMER_col: 0.5 #+END_SRC
:BEAMER_env: note
:BEAMER_envargs: <2-> *** This is a beamer note :B_note:
:END: :PROPERTIES:
:BEAMER_env: note
:END:
This subtree will not appear in the PDF. Notice the noweb call =<<simple-code>>= which is replaced by the named =simple-code= src block above (so we don't have to type the same code twice). It is activated by the =:noweb yes= header argument. You will notice those headline tags, such as =:BMCOl:B_block:= and =:B_note:=. Don't fret about those; they are just a visual aid.
** Frame 2 ** Frame 2
#+BEAMER: \framesubtitle{where we will not use columns} #+BEAMER: \framesubtitle{Horizontal block, text (list) animations, footnotes, hyperlinks}
*** Request
Please test this stuff! *** This block extends horizontally
Be sure to put
: #+PROPERTY: session *julia*
at the top of the org file to ensure =julia= code block session evalation by default.
*** This block heading text is ignored :B_ignoreheading:
:PROPERTIES:
:BEAMER_env: ignoreheading
:END:
#+ATTR_BEAMER: :options <+->
- Enter Column View[fn:1] with =C-c C-x C-c= on headline
- Might like =S-TAB= to collapse headlines first
- Handy for editing headline properties
- Set =ignoreheading= with =C-c C-b i= on headline
[fn:1] See [[http://thread.gmane.org/gmane.emacs.orgmode/5107/focus=5134][this message]] on Gmane for more about Column View.
** Frame 3
#+BEAMER: \framesubtitle{Images and captions, font tweaks for source code}
*** The =julia= code :B_block:BMCOL:
:PROPERTIES: :PROPERTIES:
:BEAMER_env: block :BEAMER_env: block
:BEAMER_envargs: [T]
:BEAMER_col: 0.6
:END: :END:
** Here is a graph \footnotesize
#+BEGIN_SRC julia :exports results :results graphics :file example1.pdf :eval no-export
#+BEGIN_SRC julia :exports code :results graphics :file example1.pdf :eval no-export
using Winston using Winston
x = linspace(0, 3pi, 100) x = linspace(0, 3pi, 100)
c = cos(x) c = cos(x)
...@@ -110,7 +97,42 @@ add(p, Curve(x, s, "color", "blue") ) ...@@ -110,7 +97,42 @@ add(p, Curve(x, s, "color", "blue") )
file(p, "example1.pdf") file(p, "example1.pdf")
#+END_SRC #+END_SRC
#+ATTR_LaTeX: :options "width=0.80\\textwidth" \normalsize
#+RESULTS:
*** The image :B_block:BMCOL:
:PROPERTIES:
:BEAMER_col: 0.4
:BEAMER_env: block
:END:
#+CAPTION: A =julia= graph
[[file:example1.pdf]] [[file:example1.pdf]]
** References
#+BEAMER: \framesubtitle{Write this one in pure LaTeX and \texttt{allowframebreaks}}
:PROPERTIES:
:BEAMER_opt: allowframebreaks
:END:
#+BEGIN_LaTeX
\begin{thebibliography}{10}
\beamertemplatearticlebibitems
\bibitem{Guy2013}
R. Smart Guy.
\newblock This theorem is hard to prove.
\newblock {\em Journal of Difficult Things}, 5(7):91--97, 2013.
\beamertemplatebookbibitems
\bibitem{Important2012}
Somebody R. Important.
\newblock {\em A Heavy Book}.
\newblock Bigtime-Publisher, 2012.
\beamertemplatearrowbibitems
\bibitem{beamerexport}
Beamer Class Export.
\newblock The Org Manual.
\newblock \url{http://orgmode.org/manual/Beamer-class-export.html}
\bibitem{beameroldengine}
Writing Beamer presentations in org-mode.
\newblock The link is on Worg \href{http://orgmode.org/worg/exporters/beamer/tutorial.html}{\emph{here}}. Also see \href{http://orgmode.org/worg/exporters/beamer/ox-beamer.html}{\emph{here}} for info regarding the new exporter.
\end{thebibliography}
#+END_LaTeX
No preview for this file type
% Created 2013-02-25 Mon 23:30 % Created 2013-03-02 Sat 16:43
\documentclass[presentation, bigger]{beamer} \documentclass[presentation]{beamer}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\usepackage{fixltx2e} \usepackage{fixltx2e}
...@@ -15,10 +15,12 @@ ...@@ -15,10 +15,12 @@
\usepackage{amssymb} \usepackage{amssymb}
\usepackage{hyperref} \usepackage{hyperref}
\tolerance=1000 \tolerance=1000
\institute{The Really Great Institute \\ Somewhere On, Earth}
\usetheme{default} \usetheme{default}
\usecolortheme{beaver}
\author{G. Jay Kerns} \author{G. Jay Kerns}
\date{2013-02-25 Mon} \date{\today}
\title{julia-beamer.org} \title{Sample \texttt{julia} Presentation}
\hypersetup{ \hypersetup{
pdfkeywords={}, pdfkeywords={},
pdfsubject={}, pdfsubject={},
...@@ -31,80 +33,122 @@ ...@@ -31,80 +33,122 @@
\end{frame} \end{frame}
\section[A Sample \texttt{julia} Beamer presentation]{A Sample \texttt{julia} Beamer presentation}
\section[Getting started]{Getting started}
\label{sec-1} \label{sec-1}
\begin{frame}[fragile,label=sec-1-1]{Frame 1}
\framesubtitle{Two blocks with a pause in between, noweb reference}
\begin{columns}
\begin{column}{0.5\textwidth}
\begin{block}{Here is some \texttt{julia} code}
\label{simple-code}
\begin{verbatim} \begin{verbatim}
(load "~/gitm/projects/ob-julia.el") 2+3
(org-babel-julia-initiate-session "*julia*" nil) print("hello, there!")
sqrt(5)
\end{verbatim} \end{verbatim}
Read the following links. \pause
\begin{itemize} \end{block}
\item \url{http://orgmode.org/worg/exporters/beamer/tutorial.html} \end{column}
\item \url{http://orgmode.org/worg/exporters/beamer/ox-beamer.html} \begin{column}{0.5\textwidth}
\item \url{http://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export} \begin{block}{Here is the output}
\end{itemize}
Add the following to \texttt{.emacs}
\begin{verbatim} \begin{verbatim}
(require 'ox-beamer)
5
hello, there!
2.23606797749979
\end{verbatim} \end{verbatim}
\end{block}
\end{column}
\end{columns}
\note{This is a beamer note
This subtree will not appear in the PDF. Notice the noweb call \texttt{<<simple-code>>} which is replaced by the named \texttt{simple-code} src block above (so we don't have to type the same code twice). It is activated by the \texttt{:noweb yes} header argument. You will notice those headline tags, such as \texttt{:BMCOl:B\_block:} and \texttt{:B\_note:}. Don't fret about those; they are just a visual aid.}
\end{frame}
\begin{frame}[fragile,label=sec-1-2]{Frame 2}
\framesubtitle{Horizontal block, text (list) animations, footnotes, hyperlinks}
You also need to add the \LaTeX{} class. \begin{block}{This block extends horizontally}
Be sure to put
\begin{verbatim} \begin{verbatim}
(add-to-list 'org-latex-classes #+PROPERTY: session *julia*
'("beamer"
"\\documentclass[presentation]{beamer}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
\end{verbatim} \end{verbatim}
\begin{frame}[label=sec-1-1]{Exported title} at the top of the org file to ensure \texttt{julia} code block session evalation by default.
\begin{itemize} \end{block}
\item amsdk \begin{itemize}[<+->]
\item kdsalk \item Enter Column View\footnote{See \href{http://thread.gmane.org/gmane.emacs.orgmode/5107/focus=5134}{this message} on Gmane for more about Column View.} with \texttt{C-c C-x C-c} on headline
\item adkfa \item Might like \texttt{S-TAB} to collapse headlines first
\item jlksa \item Handy for editing headline properties
\item Set \texttt{ignoreheading} with \texttt{C-c C-b i} on headline
\end{itemize} \end{itemize}
\end{frame} \end{frame}
\section[This is the first structural section]{This is the first structural section} \begin{frame}[fragile,label=sec-1-3]{Frame 3}
\label{sec-2} \framesubtitle{Images and captions, font tweaks for source code}
\begin{frame}[label=sec-2-1]{Frame 1}
\framesubtitle{with a subtitle}
\begin{columns} \begin{columns}
\begin{column}{0.5\textwidth} \begin{column}{0.6\textwidth}
\begin{block}{Thanks to Eric Fraga} \begin{block}{The \texttt{julia} code}
for the first viable beamer setup in Org
\footnotesize
\begin{verbatim}
using Winston
x = linspace(0, 3pi, 100)
c = cos(x)
s = sin(x)
p = FramedPlot();
setattr(p, "title", "title!")
setattr(p, "xlabel", L"\Sigma x^2_i")
setattr(p, "ylabel", L"\Theta_i")
add(p, FillBetween(x, c, x, s) )
add(p, Curve(x, c, "color", "red") )
add(p, Curve(x, s, "color", "blue") )
file(p, "example1.pdf")
\end{verbatim}
\normalsize
\end{block} \end{block}
\end{column} \end{column}
\begin{column}{0.4\textwidth}
\begin{block}{The image}
\begin{column}{0.5\textwidth} \begin{figure}[htb]
\begin{block}{Thanks to everyone else} \centering
for contributing to the discussion \includegraphics[width=.9\linewidth]{example1.pdf}
\note{This will be formatted as a beamer note \caption{A \texttt{julia} graph}
} \end{figure}
\end{block} \end{block}
\end{column} \end{column}
\end{columns} \end{columns}
\end{frame} \end{frame}
\begin{frame}[label=sec-2-2]{Frame 2} \begin{frame}[allowframebreaks,label=sec-1-4]{References}
\framesubtitle{where we will not use columns} \framesubtitle{Write this one in pure LaTeX and \texttt{allowframebreaks}}
\begin{block}{Request}
Please test this stuff! \begin{thebibliography}{10}
\end{block} \beamertemplatearticlebibitems
\end{frame} \bibitem{Guy2013}
\begin{frame}[label=sec-2-3]{Here is a graph} R. Smart Guy.
\includegraphics[width=0.80\textwidth]{example1.pdf} \newblock This theorem is hard to prove.
\newblock {\em Journal of Difficult Things}, 5(7):91--97, 2013.
\beamertemplatebookbibitems
\bibitem{Important2012}
Somebody R. Important.
\newblock {\em A Heavy Book}.
\newblock Bigtime-Publisher, 2012.
\beamertemplatearrowbibitems
\bibitem{beamerexport}
Beamer Class Export.
\newblock The Org Manual.
\newblock \url{http://orgmode.org/manual/Beamer-class-export.html}
\bibitem{beameroldengine}
Writing Beamer presentations in org-mode.
\newblock The link is on Worg \href{http://orgmode.org/worg/exporters/beamer/tutorial.html}{\emph{here}}. Also see \href{http://orgmode.org/worg/exporters/beamer/ox-beamer.html}{\emph{here}} for info regarding the new exporter.
\end{thebibliography}
\end{frame} \end{frame}
% Generated by Org mode 7.9.3f in Emacs 24.3.50.1. % Generated by Org mode 7.9.3f in Emacs 24.3.50.1.
\end{document} \end{document}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment