org-mode-poster/src/org-mode-poster_poster.tex~

219 lines
5.9 KiB
TeX
Raw Normal View History

2018-04-04 12:21:17 +02:00
% Created 2018-04-04 Wed 12:05
2018-04-02 10:57:06 +02:00
% Intended LaTeX compiler: pdflatex
\documentclass[final]{beamer}
\usetheme{ph}
\usepackage[orientation=portrait,size=a0,scale=1.4]{beamerposter}
\usepackage[absolute,overlay]{textpos}
\usepackage[authoryear]{natbib}
\setlength{\paperwidth}{36in}
\setlength{\paperheight}{48in}
\setlength{\textwidth}{0.98\paperwidth}
\setlength{\textheight}{0.98\paperheight}
\graphicspath{{../output/figures/}{../lib/}}
\usepackage[export]{adjustbox}
\usepackage{graphicx,caption}
2018-04-02 19:40:42 +02:00
\usepackage{minted}
2018-04-02 10:57:06 +02:00
\usepackage{eurosym}
2018-04-02 19:40:42 +02:00
\usepackage{listings}
2018-04-02 10:57:06 +02:00
\usepackage{textcomp}
\usepackage{bibentry}
2018-04-03 00:45:58 +02:00
\newcommand\sumin{\sum_{i=1}^{n}}
\newcommand{\Xoi}[1]{#1(i)}
\newcommand{\frakPQ}[2]{\frac{\Xoi{#1}}{\Xoi{#2}}}
\newcommand{\DKLPQ}[3]{D_{\mathrm{KL}}(#1 #3 #2)}
2018-04-04 12:21:17 +02:00
\date{}
2018-04-03 15:37:28 +02:00
\newcommand{\auth}{Philipp Homan, MD, PhD}
\newcommand{\authemail}{phoman1@northwell.edu}
\newcommand{\authtwitter}{@philipphoman}
\newcommand{\authgithub}{github.com/philipphoman}
2018-04-02 10:57:06 +02:00
\author{
2018-04-03 15:37:28 +02:00
Philipp Homan$^{1}$
2018-04-02 10:57:06 +02:00
\\
\normalsize{$^{1}$Department of Psychiatry,}
\normalsize{The Donald and Barbara Zucker}
\normalsize{School of Medicine at Northwell/Hofstra,}
2018-04-02 19:40:42 +02:00
\normalsize{Hempstead, NY}
2018-04-02 10:57:06 +02:00
}
\usetheme{default}
2018-04-04 12:21:17 +02:00
\date{2018-04-04 12:05}
2018-04-03 15:37:28 +02:00
\title{Using org-mode for scientific posters}
2018-04-02 10:57:06 +02:00
\begin{document}
2018-04-04 12:21:17 +02:00
\begin{frame}[fragile,label={sec:org2d306a8}]{}
2018-04-02 19:40:42 +02:00
\begin{columns}
\begin{column}[t]{0.45\columnwidth}
2018-04-02 10:57:06 +02:00
\begin{block}{Background}
\begin{itemize}
2018-04-03 15:37:28 +02:00
\item Here we show how org-mode (version
2018-04-04 11:51:27 +02:00
9.1.7) and emacs (version
25.2.2) can be used to make decent looking scientific
posters
2018-04-03 15:37:28 +02:00
\item With org-mode we can populate the poster with code, graphs and numbers
from inline code in languages such as R, python, Matlab and even shell
scripting
2018-04-04 12:21:17 +02:00
\item For example, this poster was created on 2018-04-04 12:05 on
2018-04-04 11:51:27 +02:00
Ubuntu 17.10.
2018-04-03 15:37:28 +02:00
\item Inline code could look like this (which will produce a graph;
2018-04-04 12:21:17 +02:00
Fig. \ref{fig:org1e6e9a8}):
2018-04-02 10:57:06 +02:00
\end{itemize}
2018-04-02 19:40:42 +02:00
\begin{columns}
2018-04-03 04:17:52 +02:00
\begin{column}[T]{0.68\columnwidth}
\begin{minted}[linenos=true,bgcolor=lightgray]{r}
set.seed(20180402)
2018-04-03 02:00:34 +02:00
x1 <- rnorm(100, 0, 1)
x2 <- rnorm(100, 0.5, 1)
hist(x1, col="red")
hist(x2, col="blue", add=TRUE)
2018-04-02 21:25:40 +02:00
\end{minted}
2018-04-02 19:40:42 +02:00
2018-04-02 10:57:06 +02:00
\begin{figure}[htbp]
\centering
2018-04-02 19:40:42 +02:00
\includegraphics[width=.9\linewidth]{3.png}
2018-04-04 12:21:17 +02:00
\caption{\label{fig:org1e6e9a8}
2018-04-02 19:40:42 +02:00
This is the output.}
2018-04-02 10:57:06 +02:00
\end{figure}
2018-04-02 19:40:42 +02:00
\end{column}
\end{columns}
2018-04-02 10:57:06 +02:00
\end{block}
2018-04-03 00:45:58 +02:00
\begin{block}{Inline code and tables}
2018-04-02 19:40:42 +02:00
\begin{itemize}
\item In addition to inline code, we can also produce tables
\item Tables are very powerful in org-mode, they even include spreadsheet
capabilities
2018-04-03 02:00:34 +02:00
\item Some code to process the first vector from above to make a table out
of its summary could look like this, which would result in a little
2018-04-04 12:21:17 +02:00
table (Table \ref{tab:org79ade92}) :
2018-04-02 19:40:42 +02:00
\end{itemize}
\begin{columns}
2018-04-03 04:17:52 +02:00
\begin{column}[T]{0.78\columnwidth}
\begin{minted}[linenos=true,bgcolor=lightgray]{r}
2018-04-03 02:00:34 +02:00
library(broom)
library(dplyr)
t1 <- tidy(round(summary(x1), 2))
t2 <- tidy(round(summary(x2), 2))
# This will export as a table
rbind(t1, t2) %>%
mutate(name=c("x1", "x2"))
2018-04-02 21:25:40 +02:00
\end{minted}
2018-04-02 19:40:42 +02:00
\vspace{2cm}
\begin{table}[htbp]
2018-04-04 12:21:17 +02:00
\caption{\label{tab:org79ade92}
2018-04-03 15:37:28 +02:00
A table summarizing the two distributions.}
2018-04-02 10:57:06 +02:00
\centering
2018-04-03 02:00:34 +02:00
\begin{tabular}{rrrrrrl}
\hline
minimum & q1 & median & mean & q3 & maximum & name\\
\hline
-2.29 & -0.49 & 0.11 & 0.14 & 0.8 & 2.47 & x1\\
-2.17 & -0.45 & 0.07 & 0.13 & 0.85 & 2.23 & x2\\
2018-04-02 19:40:42 +02:00
\hline
\end{tabular}
\end{table}
\end{column}
\end{columns}
2018-04-02 10:57:06 +02:00
\end{block}
\end{column}
2018-04-02 19:40:42 +02:00
\begin{column}[t]{0.45\columnwidth}
2018-04-03 00:45:58 +02:00
\begin{block}{Graphics}
2018-04-02 19:40:42 +02:00
\begin{itemize}
2018-04-03 02:00:34 +02:00
\item We can use shell scripting to grab an image with curl from the
2018-04-04 12:21:17 +02:00
internet (Fig. \ref{fig:orgf5c409c}):
2018-04-02 19:40:42 +02:00
\end{itemize}
\begin{columns}
\begin{column}[T]{0.78\columnwidth}
2018-04-03 00:45:58 +02:00
\footnotesize
2018-04-03 04:17:52 +02:00
\begin{minted}[linenos=true,bgcolor=lightgray]{bash}
2018-04-03 02:00:34 +02:00
# Download emacs icon from gnu.org
2018-04-02 19:40:42 +02:00
curl -0 https://www.gnu.org/software/emacs/images/emacs.png
2018-04-02 21:25:40 +02:00
\end{minted}
2018-04-02 19:40:42 +02:00
\normalsize
\vspace{2cm}
2018-04-02 10:57:06 +02:00
\begin{figure}[htbp]
\centering
2018-04-02 19:40:42 +02:00
\includegraphics[page=9,width=0.2\textwidth]{emacs.png}
2018-04-04 12:21:17 +02:00
\caption{\label{fig:orgf5c409c}
2018-04-02 19:40:42 +02:00
This is the downloaded image.}
2018-04-02 10:57:06 +02:00
\end{figure}
2018-04-02 19:40:42 +02:00
\end{column}
\end{columns}
2018-04-02 10:57:06 +02:00
\end{block}
2018-04-03 00:45:58 +02:00
\begin{block}{Math}
\begin{itemize}
2018-04-03 02:00:34 +02:00
\item We can easily include math
\item For example, let's describe how to compute the distance between the
two simulated distributions \(x1\) and \(x2\) from before:
2018-04-03 00:45:58 +02:00
\end{itemize}
\begin{columns}
\begin{column}[T]{0.78\columnwidth}
The Kullback-Leibler (KL) divergence measures the difference between two
probability distributions (i.e., the loss of information when one
distribution is used to approximate another). The KL divergence is thus
defined as
\begin{align}
\label{eq:KL}
\DKLPQ{P}{Q}{\|} = \sumin \Xoi{P} \log \frakPQ{P}{Q}
\end{align}
with \(P\) and \(Q\) being two probability distribution functions and \(n\)
the number of sample points. Since \(\DKLPQ{P}{Q}{\|}\) is not equal to
\(\DKLPQ{Q}{P}{\|}\), a symmetric variation of the KL divergence can be
derived as follows:
2018-04-03 02:00:34 +02:00
\begin{align}
\label{eq:KL2}
\DKLPQ{P}{Q}{,} = \sumin \Big(\Xoi{P} \log \frakPQ{P}{Q} + \Xoi{Q} \log \frakPQ{Q}{P} \Big).
\end{align}
2018-04-03 00:45:58 +02:00
\end{column}
\end{columns}
\end{block}
\begin{block}{Columns}
2018-04-02 10:57:06 +02:00
\begin{columns}
\begin{column}[T]{0.48\columnwidth}
2018-04-03 02:00:34 +02:00
\captionsetup{justification=justified,width=.85\linewidth}
2018-04-02 10:57:06 +02:00
\begin{figure}[htbp]
\centering
2018-04-03 02:00:34 +02:00
\includegraphics[width=.9\linewidth]{4l.png}
2018-04-04 12:21:17 +02:00
\caption{\label{fig:orgd7d362e}
2018-04-03 02:00:34 +02:00
This is the left figure of a two-column block, showing the density of \(x1\).}
2018-04-02 10:57:06 +02:00
\end{figure}
\end{column}
\begin{column}[T]{0.48\columnwidth}
2018-04-03 02:00:34 +02:00
\captionsetup{justification=justified,width=.85\linewidth}
2018-04-02 10:57:06 +02:00
\begin{figure}[htbp]
\centering
2018-04-03 02:00:34 +02:00
\includegraphics[width=.9\linewidth]{4r.png}
2018-04-04 12:21:17 +02:00
\caption{\label{fig:orgb7b3a82}
2018-04-03 02:00:34 +02:00
This is the right figure. It shows the density of \(x2\).}
2018-04-02 10:57:06 +02:00
\end{figure}
\end{column}
\end{columns}
\end{block}
\begin{block}{Conclusions}
\begin{itemize}
2018-04-03 15:37:28 +02:00
\item This little example is meant to show how versatile org-mode is
2018-04-03 02:00:34 +02:00
\item Scientific posters can be produced with a simple text editor
2018-04-02 10:57:06 +02:00
\end{itemize}
\end{block}
\end{column}
\end{columns}
\end{frame}
\end{document}