Commit 7eec898a authored by G. Jay Kerns's avatar G. Jay Kerns

added startup instructions to beamer presentation

parent 359c18c9
......@@ -13,6 +13,32 @@
* A Sample =julia= Beamer presentation
** Frame 0 :B_fullframe:
:PROPERTIES:
:BEAMER_env: fullframe
:END:
For this to successfully export to PDF you'll need
#+BEGIN_SRC emacs-lisp :eval no-export
(require 'ox-beamer)
#+END_SRC
and you'll need a Beamer entry similar to this
#+BEGIN_SRC emacs-lisp :eval no-export
(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
in your =.emacs=. Then open the org file and do: =C-c C-e l P=.
** Frame 1
#+BEAMER: \framesubtitle{Two blocks with a pause in between, noweb reference}
*** Here is some =julia= code :BMCOL:B_block:
......
No preview for this file type
% Created 2013-03-02 Sat 16:43
% Created 2013-03-02 Sat 17:25
\documentclass[presentation]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
......@@ -36,7 +36,30 @@
\section[A Sample \texttt{julia} Beamer presentation]{A Sample \texttt{julia} Beamer presentation}
\label{sec-1}
\begin{frame}[fragile,label=sec-1-1]{Frame 1}
\begin{frame}[fragile,label=sec-1-1]{}
For this to successfully export to PDF you'll need
\begin{verbatim}
(require 'ox-beamer)
\end{verbatim}
and you'll need a Beamer entry similar to this
\begin{verbatim}
(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{verbatim}
in your \texttt{.emacs}. Then open the org file and do: \texttt{C-c C-e l P}.
\end{frame}
\begin{frame}[fragile,label=sec-1-2]{Frame 1}
\framesubtitle{Two blocks with a pause in between, noweb reference}
\begin{columns}
\begin{column}{0.5\textwidth}
......@@ -56,8 +79,6 @@ sqrt(5)
\begin{block}{Here is the output}
\begin{verbatim}
5
hello, there!
2.23606797749979
......@@ -68,7 +89,7 @@ hello, there!
\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}
\begin{frame}[fragile,label=sec-1-3]{Frame 2}
\framesubtitle{Horizontal block, text (list) animations, footnotes, hyperlinks}
\begin{block}{This block extends horizontally}
......@@ -87,7 +108,7 @@ at the top of the org file to ensure \texttt{julia} code block session evalation
\item Set \texttt{ignoreheading} with \texttt{C-c C-b i} on headline
\end{itemize}
\end{frame}
\begin{frame}[fragile,label=sec-1-3]{Frame 3}
\begin{frame}[fragile,label=sec-1-4]{Frame 3}
\framesubtitle{Images and captions, font tweaks for source code}
\begin{columns}
......@@ -126,7 +147,7 @@ file(p, "example1.pdf")
\end{column}
\end{columns}
\end{frame}
\begin{frame}[allowframebreaks,label=sec-1-4]{References}
\begin{frame}[allowframebreaks,label=sec-1-5]{References}
\framesubtitle{Write this one in pure LaTeX and \texttt{allowframebreaks}}
\begin{thebibliography}{10}
......
......@@ -223,33 +223,10 @@ Then also add an entry for the beamer class in your =.emacs=. Here is a boilerp
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
#+END_SRC
Since beamer is such a special case I have tweaked a minimal =julia= beamer presentation in [[file:ob-julia-beamer.org][A julia beamer example]]. See there, see the Org manual, and see Worg too for more information.
Since beamer is such a special case I have tweaked a minimal =julia= beamer presentation in [[file:ob-julia-beamer.org][Sample =julia= Presentation]]. See there, see the Org manual, and see Worg too for more information.
* Other things
- You can extract all of the =julia= source code (also known as /tangling/ the Org document) with the keystrokes =C-c C-v t=. This will generate a =julia= script (with extension =.jl=) in the working directory. Note that this capability is turned off by default. You can activate it by adding the header argument =:tangle yes= to those code blocks you'd like to tangle or doing a buffer-wide header setting with the line =#+PROPERTY: tangle yes= near the top of the org file. See the Org manual for details.
- You may have noticed that those =julia= code lines with no output (for instance, lines with semicolons =;= at the end) generate an empty line in the =#+RESULTS= below the code block. Consequently, the first time you evaluate a =julia= code block without having previously initiated a =julia= session with =M-x julia= the =#+RESULTS= will have an extra mystery empty line. It is no mystery. The first statement executed by ESS when loading =julia= is an =include= command. That command has no output. If that empty line bothers you then execute the code block again; the mystery empty line will disappear.
- Be careful when executing code blocks with =:results value=. Code block evaluation in that case works by writing the =julia= commands to an external file in the =/tmp= directory, evaluating the commands with =julia=, writing the results to a comma-separated (=.csv=) file, then reading the =.csv= file and converting the result to =elisp= for insertion to the org buffer. Not all object types are supported by =julia= for writing to =.csv= files, in particular, =1x1= matrices and arrays of ASCII characters are not supported (yet). If you try to evaluate code blocks in those cases (or any other case where output to =.csv= is not supported) then you will get an error.
* Fitting (generalized) linear models
#+BEGIN_SRC julia
using RDatasets, DataFrames, Distributions, GLM
trees = data("datasets", "trees");
treeslm = lm(:(Girth ~ Height + Volume), trees);
coef(treeslm)
coeftable(treeslm)
#+END_SRC
#+RESULTS:
#+begin_example
3-element Float64 Array:
10.8164
-0.0454835
0.19518
3x4 DataFrame:
Estimate Std.Error t value Pr(>|t|)
[1,] 10.8164 1.9732 5.48165 7.44691e-6
[2,] -0.0454835 0.0282621 -1.60935 0.118759
[3,] 0.19518 0.0109553 17.8161 8.2233e-17
#+end_example
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