#+startup: beamer #+TITLE: A scientific poster entirely written in org-mode #+TITLE: using GNU emacs and the beamer library * Preamble :ignore: ** General comments :ignore: # ---------------------------------------------------------------------- # - Turn on synonyms by starting synosaurus-mode # - Look up words using C-c sr # - Turn on dictionary by starting flyspell-mode # - Count words by section using org-wc-display # ---------------------------------------------------------------------- ** Specific comments for this manuscript :ignore: # ---------------------------------------------------------------------- ** org specific settings :ignore: # ---------------------------------------------------------------------- #+OPTIONS: email:nil toc:nil num:nil author:nil date:t tex:t title:nil #+STARTUP: align fold #+SEQ_TODO: TODO(t) | DONE(d) #+TAGS: figure(f) check(c) noexport(n) ignore(i) #+LANGUAGE: en #+EXCLUDE_TAGS: noexport TODO #+DATE: {{{time(%Y-%m-%d %H:%M)}}} # ---------------------------------------------------------------------- ** Latex header :ignore: # ---------------------------------------------------------------------- #+LATEX_CLASS: mybeamerposter #+LATEX_HEADER: \setlength{\paperwidth}{36in} #+LATEX_HEADER: \setlength{\paperheight}{48in} #+LATEX_HEADER: \setlength{\textwidth}{0.98\paperwidth} #+LATEX_HEADER: \setlength{\textheight}{0.98\paperheight} #+LATEX_HEADER: \graphicspath{{../output/figures/}{../lib/}} #+LATEX_HEADER: \usepackage[export]{adjustbox} #+LATEX_HEADER: \usepackage{graphicx,caption} #+LATEX_HEADER: \usepackage{minted} #+LATEX_HEADER: \usepackage{eurosym} #+LATEX_HEADER: \usepackage{listings} #+LATEX_HEADER: \usepackage{textcomp} #+LATEX_HEADER: \usepackage{bibentry} #+LATEX_HEADER: \date{} # ---------------------------------------------------------------------- ** Authors and affiliations :ignore: # ---------------------------------------------------------------------- #+LATEX_HEADER: \author{ #+LATEX_HEADER: Philipp Homan$^{1}$, #+LATEX_HEADER: \\ #+LATEX_HEADER: \normalsize{$^{1}$Department of Psychiatry,} #+LATEX_HEADER: \normalsize{The Donald and Barbara Zucker} #+LATEX_HEADER: \normalsize{School of Medicine at Northwell/Hofstra,} #+LATEX_HEADER: \normalsize{Hempstead, NY} #+LATEX_HEADER: } # ---------------------------------------------------------------------- ** Buffer-wide source code blocks :ignore: # ---------------------------------------------------------------------- # Set elisp variables need for nice formatting We want no new lines in # inline results and a paragraph size of 80 characters Important: this # has to be evaluated witch C-c C-c in order to work in the current # buffer #+BEGIN_SRC emacs-lisp :exports none :results silent ; Nicer formatting for code (setq org-latex-listings t) (setq org-latex-listings 'minted) '(org-export-latex-listings-langs (quote ((emacs-lisp "Lisp") (lisp "Lisp") (clojure "Lisp") (c "C") (cc "C++") (fortran "fortran") (perl "Perl") (cperl "Perl") (python "Python") (ruby "Ruby") (html "HTML") (xml "XML") (tex "TeX") (latex "TeX") (shell-script "bash") (gnuplot "Gnuplot") (ocaml "Caml") (caml "Caml") (sql "SQL") (sqlite "sql") (R-mode "R")))) (setq org-latex-minted-options '(("linenos=true"))) ; set timestamp format ;(setq org-export-date-timestamp-format "%FT%T%z") (require 'org-wc) (flyspell-mode t) ;(evil-declare-change-repeat 'company-complete) (setq synosaurus-choose-method 'popup) (synosaurus-mode t) (auto-complete-mode t) ;(ac-config-default) ;(add-to-list 'ac-modes 'org-mode) (linum-mode t) (whitespace-mode t) (setq org-babel-inline-result-wrap "%s") (setq org-export-with-broken-links "mark") (setq fill-column 72) (setq whitespace-line-column 72) ;(setq org-latex-caption-above '(table image)) (setq org-latex-caption-above nil) (org-toggle-link-display) ; don't remove logfiles at export (setq org-latex-remove-logfiles nil) ; Keybindings ; (global-set-key (kbd " c") "#+CAPTION: ") (defun setfillcolumn72 () (interactive) (setq fill-column 72) ) (defun setfillcolumn42 () (interactive) (setq fill-column 42) ) (define-key org-mode-map (kbd "C-c c #") "#+CAPTION: ") (define-key org-mode-map (kbd "C-c l #") "#+LATEX_HEADER: ") (define-key org-mode-map (kbd "C-c f c 4 2") 'setfillcolumn42) (define-key org-mode-map (kbd "C-c f c 7 2") 'setfillcolumn72) (setq org-odt-category-map-alist '(("__Figure__" "*Figure*" "value" "Figure" org-odt--enumerable-image-p))) ; let ess not ask for starting directory (setq ess-ask-for-ess-directory nil) ;(setq org-latex-pdf-process '("latexmk -pdflatex='xelatex ;-output-directory=../output/tex/ -interaction nonstopmode' -pdf ;-bibtex -f %f")) (setq org-latex-logfiles-extensions (quote("bcf" "blg" "fdb_latexmk" "fls" "figlist" "idx" "log" "nav" "out" "ptc" "run.xml" "snm" "toc" "vrb" "xdv"))) ; deactivate link resolving (setq org-activate-links nil) #+END_SRC # # # # ---------------------------------------------------------------------- ** End preamble :ignore: # ---------------------------------------------------------------------- * The poster :PROPERTIES: :BEGIN: :BEAMER_env: fullframe :END: ** Code :ignore: # Babel code can go here to populate the poster with dynamic output from # statistical calculations ** Left column :BMCOL: :PROPERTIES: :BEAMER_col: 0.45 :BEAMER_opt: [t] :END: *** Background :B_block: :PROPERTIES: :BEAMER_env: block :END: - Org-mode is not only useful for producing blog posts and even scientific manuscripts; it is also perfectly suitable to make decent looking scientific posters - We combine a relatively simple custom \LaTeX style file and common org-mode syntax - The nice thing about org-mode is that we can populate the poster with code, graphs and numbers from inline code in languages such as R, python, Matlab and even shell scripting - Inline code would look like this, which will produce a graph (Fig. [[figcode1]]): **** Block :PROPERTIES: :BEAMER_col: 0.48 :BEAMER_opt: [T] :END: #+NAME: code1 #+BEGIN_SRC R :session :export both :results output graphics :file 3.png x <- rnorm(100, 0, 1) hist(x, col="gray") #+END_SRC #+RESULTS: code1 [[file:3.png]] #+NAME: figcode1 #+CAPTION: This is the output. [[file:3.png]] *** Methods: Inline code and tables :B_block: :PROPERTIES: :BEAMER_env: block :END: - In addition to inline code, we can also produce tables - Tables are very powerful in org-mode, they even include spreadsheet capabilities - Some code to process the vector from above to make a table out of its summary could look like this, which would result in a little table (Table [[tabcode2]]) : **** Block :PROPERTIES: :BEAMER_col: 0.48 :BEAMER_opt: [T] :END: #+NAME: code2 #+BEGIN_SRC R :session :exports both :results value :colnames yes :cache yes m <- round(mean(x), 2) s <- round(sd(x), 2) data.frame(Mean=m, SD=s) #+END_SRC \vspace{2cm} #+CAPTION: A table. #+NAME: tabcode2 #+RESULTS[31e41e0f8cc2db2fb601af81fe4f5e218ea48f57]: code2 |-------+------| | Mean | SD | |-------+------| | -0.07 | 0.97 | |-------+------| ** Right column :BMCOL: :PROPERTIES: :BEAMER_col: 0.45 :BEAMER_opt: [t] :END: *** Results: graphics :B_block: :PROPERTIES: :BEAMER_env: block :END: - Of course we can also include graphics - Here, we use shell scripting to grab an image with curl from the internet (Fig. [[figcode3]]): **** Block :PROPERTIES: :BEAMER_col: 0.78 :BEAMER_opt: [T] :END: \small #+NAME: code3 #+BEGIN_SRC sh :exports both :file emacs.png curl -0 https://www.gnu.org/software/emacs/images/emacs.png #+END_SRC \normalsize \vspace{2cm} #+ATTR_LATEX: :width 0.2\textwidth :options page=9 #+NAME: figcode3 #+CAPTION: This is the downloaded image. #+RESULTS: code3 [[file:emacs.png]] *** Results: columns :B_block: :PROPERTIES: :BEAMER_env: block :END: **** Left :PROPERTIES: :BEAMER_col: 0.48 :BEAMER_opt: [T] :END: \captionsetup{justification=justified,width=.8\linewidth} #+NAME: figge #+CAPTION: *This is the left figure of a two-column block* #+ATTR_LATEX: :width 0.9\textwidth :options page=3 [[file:org-mode-poster-4.png]] **** Right :PROPERTIES: :BEAMER_col: 0.48 :BEAMER_opt: [T] :END: \captionsetup{justification=justified,width=.8\linewidth} #+NAME: figclus #+CAPTION: *This is the right figure.* #+ATTR_LATEX: :width 0.9\textwidth :options page=9 [[file:org-mode-poster-4.png]] *** Conclusions :B_block: :PROPERTIES: :BEAMER_env: block :END: - This little example is meant to show how incredibly versatile org-mode is - One can now produce scientific posters with a simple text editor