├── .github └── workflows │ ├── ci.yml │ └── docker.yml ├── .gitignore ├── LICENSE.txt ├── Makefile ├── README.md ├── compiled-paper.pdf ├── docker └── Dockerfile └── paper ├── Makefile ├── code └── example1.py ├── content.org ├── extract_body.py ├── figures └── icon.png ├── latexmkrc ├── loop-make.sh ├── org-files-to-tex.el ├── paper.bib └── paper.tex /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci-build-pdf 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build-pdf: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." 15 | - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" 16 | - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." 17 | - run: echo "The user is $USER" 18 | - run: cat /etc/issue 19 | - run: echo "🖥️ Install dependencies" 20 | - run: sudo apt-get update -y && sudo apt-get install -y python3 python3-pip emacs texlive-xetex latexmk 21 | - run: pip3 install --user pygments 22 | 23 | - name: Check out repository code 24 | uses: actions/checkout@v4 25 | - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." 26 | - run: echo "🖥️ The workflow is now ready to test your code on the runner." 27 | - name: List files in the repository 28 | run: | 29 | ls ${{ github.workspace }} 30 | - run: echo "Build document" 31 | - run: cd paper 32 | - run: pwd 33 | - run: make paper.pdf 34 | - name: Archive paper.pdf 35 | uses: actions/upload-artifact@v3 36 | with: 37 | name: paper.pdf 38 | path: paper/paper.pdf 39 | - name: Archive content.tex 40 | uses: actions/upload-artifact@v3 41 | with: 42 | name: content.tex 43 | path: paper/content.tex 44 | 45 | - run: echo "🍏 This job's status is ${{ job.status }}." 46 | 47 | -------------------------------------------------------------------------------- /.github/workflows/docker.yml: -------------------------------------------------------------------------------- 1 | name: ci-in-docker 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | docker: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." 15 | - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" 16 | - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." 17 | - run: echo "The user is $USER" 18 | - run: cat /etc/issue 19 | 20 | - name: Check out repository code 21 | uses: actions/checkout@v4 22 | - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." 23 | - run: echo "🖥️ The workflow is now ready to test your code on the runner." 24 | - name: List files in the repository 25 | run: | 26 | ls ${{ github.workspace }} 27 | - run: echo "Build Docker image" 28 | - run: make docker-build 29 | - run: echo "Build paper.pdf in Docker container" 30 | - run: make docker-paper.pdf 31 | - run: echo "🍏 This job's status is ${{ job.status }}." 32 | 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | paper/_minted-paper 2 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2015, Hans Fangohr, Sam Sinayoko. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | (BSD 3-Clause license, from https://opensource.org/licenses/BSD-3-Clause) 31 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PYTHON?=python3 2 | 3 | docker-build: 4 | docker build -t orgmode2paper -f docker/Dockerfile . 5 | 6 | docker-paper.pdf: 7 | docker run -v `pwd`:/io orgmode2paper make paper.pdf 8 | 9 | docker-bash: 10 | docker run -ti -v `pwd`:/io orgmode2paper bash 11 | 12 | paper.pdf: 13 | cd paper && make paper.pdf 14 | 15 | force: 16 | cd paper && make force 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![ci-build-pdf](https://github.com/fangohr/template-latex-paper-from-orgmode/actions/workflows/ci.yml/badge.svg)](https://github.com/fangohr/template-latex-paper-from-orgmode/actions/workflows/ci.yml) [![ci-in-docker](https://github.com/fangohr/template-latex-paper-from-orgmode/actions/workflows/docker.yml/badge.svg)](https://github.com/fangohr/template-latex-paper-from-orgmode/actions/workflows/docker.yml) 2 | 3 | # Template for writing LaTeX documents from Emacs orgmode 4 | 5 | A set of (mostly) self-explaining files for using orgmode to author structure and content of a document, and then insert this into a latex template. Use cases are where the latex style, class, and detailed commands to be used are prescribed by the journal/publisher etc. 6 | 7 | Requirements: A recent Emacs (tested on Emacs 24.5, and 28.2), Python, make, pdflatex, latemk for `watch` target. 8 | 9 | ## Get started 10 | 11 | - clone this repository 12 | - change into the ``paper`` subdirectory 13 | - call ``make`` 14 | 15 | ## What does the final ``paper.pdf`` look like? 16 | 17 | We have committed this file for convenience to the repository, and it can be seen [here](compiled-paper.pdf), or downloaded as an artifact. 18 | 19 | Author: Hans Fangohr, University of Southampton, European XFEL, Max Planck Institute for the Structure and Dynamics of Matter 20 | 21 | ## Changes 22 | 23 | - 2018: Note the contribution that shows a one-file solution for this problem at https://github.com/fangohr/template-latex-paper-from-orgmode/issues/4 by @dineshadepu . 24 | - 2023: added target `make watch` to automatically recompile on change of sources (using `latexmk`) 25 | - 2024: activate Github actions to provide CI 26 | -------------------------------------------------------------------------------- /compiled-paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fangohr/template-latex-paper-from-orgmode/a6c9809e9c5452d48161b19b596f60056bb0edbd/compiled-paper.pdf -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get update -y && apt-get install -y python3 python3-pip python3-pygments python-is-python3 \ 6 | emacs texlive-xetex latexmk git 7 | 8 | RUN mkdir -p /io 9 | WORKDIR /io 10 | CMD ["/bin/bash"] 11 | -------------------------------------------------------------------------------- /paper/Makefile: -------------------------------------------------------------------------------- 1 | 2 | paper.pdf: paper.tex content.tex paper.bib 3 | latexmk --pdflatex -shell-escape paper.tex 4 | 5 | force: content.tex 6 | pdflatex -shell-escape paper.tex 7 | bibtex paper 8 | pdflatex -shell-escape paper.tex 9 | pdflatex -shell-escape paper.tex 10 | 11 | 12 | content.tex: content.org extract_body.py code/* 13 | @# Note: this target is used by latexmk (see latexmkrc) 14 | # Export file to LaTeX 15 | emacs --script ./org-files-to-tex.el *.org 16 | # Rename so that filename starts with underscore 17 | mv content.tex _content.tex 18 | # Extract body and save result to the original filename 19 | python extract_body.py _content.tex content.tex 20 | # Remove temporary file 21 | rm _content.tex 22 | 23 | clean: 24 | rm -f paper.aux paper.bbl paper.blg paper.log paper.out paper.pdf 25 | rm -f _content.tex content.tex todo.tex 26 | rm -rf _minted-paper/ 27 | 28 | update-compiled-paper.pdf: 29 | make force 30 | cp paper.pdf ../compiled-paper.pdf 31 | 32 | watch: 33 | @# use this to re-run automatically if sources. 34 | @# note the latexmkrc file to define the dependency on org files. 35 | latexmk --pdflatex -shell-escape -pvc -view=none paper.tex 36 | 37 | # skim is pdf viewer that updates automatically when the pdf file changes 38 | view: 39 | open -a skim paper.pdf 40 | -------------------------------------------------------------------------------- /paper/code/example1.py: -------------------------------------------------------------------------------- 1 | def adder(n): 2 | def add_n(x): 3 | return x + n 4 | return add_n 5 | 6 | f = adder(42) 7 | 8 | print("What is the answer?") 9 | print(f(0)) 10 | -------------------------------------------------------------------------------- /paper/content.org: -------------------------------------------------------------------------------- 1 | * Introduction 2 | 3 | Some introduction to the topic. Orgmode is cool, see http://orgmode.org fore details. URLs are converted into hyperrefs automatically (i.e. no need to use the \verb|\href{}{}| command). 4 | 5 | * Method 6 | ** This document 7 | \label{sec:method} 8 | 9 | The overall workflow is this: the main part of the paper is in the 10 | file ~content.org~. 11 | 12 | This is translated by an (Emacs) script into a full LaTeX document with 13 | name ~_content.tex~. 14 | 15 | An extra (python) script strips off the LaTeX preamble and the 16 | last few lines at the end of the document, and saves the 17 | remaining middle part of the document as ~content.tex~. 18 | 19 | The main latex file is ~paper.tex~, which contains the latex 20 | preamble, all the style the requirements we or the journal may have, 21 | the abstract, the bibliographystyle and bibliography uses the 22 | \verb|\input{content.tex}| command to include the autogenerated latex 23 | into the main document. 24 | 25 | There is a Makefile that automises all of these steps. It may be useful to run a pdf viewer that watches and automatically updates ~paper.pdf~ on any change, and to have a loop (or the ~watch~ command that repeatedly calls ~make~, so that the pdf is re-created when the modified ~content.org~ file is saved). 26 | 27 | ** Subsections 28 | 29 | Our document may well contain subsections. In fact, part of the joy of orgmode is that we can re-arrange sections and change their depth quite easily. 30 | 31 | ** Mention how to ignore a heading :ignoreheading: 32 | 33 | Using the ~:ignoreheading:~ tag, we can use section headings which do 34 | not appear in the final document. 35 | 36 | ** Say why this is useful :ignoreheading: 37 | 38 | This is useful to 'label' paragraphs or sections to draft a document 39 | while not wanting to reveal that label/title in the final version to the 40 | reader. 41 | 42 | 43 | ** Details 44 | 45 | We can use equations as if the orgmode source was \LaTeX{}, for example $f(x) = x^2$ or 46 | \begin{equation} 47 | \int f(x) \d x = C 48 | \end{equation} 49 | 50 | ** Italics, bold, underline 51 | 52 | Text can be emphasised using /italics/, *bold* or _underline_. 53 | In org-mode these are written as ~/italics/~, ~*bold*~ and ~_underline_~. 54 | 55 | ** COMMENT 56 | 57 | Note also the comment feature: sections that have titles starting with COMMENT are not included in the output, and can be used to record thoughts or drafts not to be shown in the LaTeX document. 58 | 59 | * Results 60 | ** Tables 61 | 62 | Tables are converted into tables: 63 | 64 | | name | # | 65 | |----------+----| 66 | | Apple | 4 | 67 | | Pears | 5 | 68 | | Tomatoes | 16 | 69 | 70 | 71 | ** Figures 72 | 73 | Figures can be included like this 74 | 75 | file:figures/icon.png 76 | 77 | Or we use the latex command directly: 78 | 79 | \includegraphics[width=2cm]{figures/icon.png} 80 | 81 | 82 | We can also provide guidance to orgmode how we would like the figure included (see http://orgmode.org/manual/LaTeX-specific-attributes.html for details): 83 | 84 | #+ATTR_LATEX: :width 2cm :options angle=90 85 | file:figures/icon.png 86 | 87 | If you prefer, you can inculde the full float figure environment as 88 | raw latex into the orgmode file. Here is an example for such a figure, 89 | and then we can refer to it through its figure number 90 | \ref{fig:myfigure}. 91 | 92 | \begin{figure} 93 | \centering 94 | \includegraphics[width=0.1\columnwidth]{figures/icon.png} 95 | \caption{The skyline\label{fig:myfigure}} 96 | \end{figure} 97 | 98 | ** Figure and Table environments 99 | 100 | The ~+CAPTION~ directive instructions orgmode to create a caption, and wrap up the following graphic or table into a Table or Figure environment. 101 | 102 | #+CAPTION: This is the caption for the next table (or link) 103 | #+NAME: tab:basic-data 104 | | Apples | 1 | 105 | | Bananas | 3 | 106 | |---------+---| 107 | | Fruit | 4 | 108 | 109 | #+CAPTION[Short form]: This is the caption for the next Figure 110 | #+NAME: fig:example 111 | #+ATTR_LATEX: :width 2cm :options angle=90 112 | file:figures/icon.png 113 | 114 | We have just created figure \ref{fig:example}. 115 | 116 | 117 | ** Code 118 | 119 | We can also include code. Again, it can be done directly from orgmode (and the option to also execute the code from within orgmode and include the output is exciting, but goes beyond the purpose of this template for document writing in orgmode. If you want to explore this further, look here: http://orgmode.org/manual/Working-with-source-code.html#Working-with-source-code 120 | 121 | \begin{figure} 122 | \footnotesize 123 | \inputminted[bgcolor=white,frame=lines]{python}{code/example1.py} 124 | \normalsize 125 | \caption{An example script in Python. \label{fig:code-example1}} 126 | \end{figure} 127 | 128 | Figure \ref{fig:code-example1} shows some code. 129 | 130 | ** Include literal LaTeX 131 | 132 | #+LATEX: If necessary, we can use the \verb|#+LATEX:| directive, to send a string directly to LaTeX, i.e. unmodified by orgmode. 133 | 134 | #+BEGIN_EXPORT latex 135 | We can also create a literal \LaTeX{} block like this one.\footnote{See \href{http://orgmode.org/manual/Quoting-LaTeX-code.html}{http://orgmode.org/manual/Quoting-LaTeX-code.html} for more details}. 136 | #+END_EXPORT 137 | 138 | ** More results 139 | 140 | Of course we can cite work \cite{authorX2016}. 141 | 142 | * Discussion 143 | Coming back to the method outlined in section \ref{sec:method}, it may 144 | well be possible to achieve a similar setup without the Python script 145 | extracting the main part of the autogenerated document etc, and 146 | include all the required latex setup, extra packages, into special #+ 147 | commands in the orgmode file. However, I have found it efficient to be 148 | able to use journal latex templates directly, and thus came up with 149 | this arrangement. Not perfect, but a functional start. 150 | 151 | * Summary 152 | 153 | I like using orgmode to author documents as the orgmode mark up is less intrusive (and overall fewer characters to type!) than the \LaTeX{} mark up. Rearranging sections, and changing the depth (i.e. move sections to subsections etc) are trivial in orgmode. Overall, orgmode allows me to focus more on the content of the document and its structure. 154 | 155 | * Acknowledgements 156 | Thanks to Sam Sinayoko for introducing me to his way of creating 157 | beamer latex slides from orgmode, and who wrote the original elisp 158 | script that executes the conversion of orgmode files to LaTeX. Thanks 159 | also to Maximilian Albert, who helped tidying up the Makefile. 160 | \newpage 161 | * TODO 162 | Sometimes, a section with things to do is useful; with the understanding that this is completed and removed before the document is finished. (Or changed into a COMMENT section, so that it doesn't export to latex.) 163 | 164 | An orgmode todo list (which can be nested) looks like this 165 | 166 | - TODO [2/3] 167 | - [X] create github repository 168 | - [X] write up the setup for this document 169 | - [ ] Save planet [0/3] 170 | - [ ] understand challenge 171 | - [ ] find solution 172 | - [ ] implement it 173 | -------------------------------------------------------------------------------- /paper/extract_body.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import sys 3 | 4 | 5 | def chop_off_header(s): 6 | assert s.count(r'\tableofcontents') == 1 7 | return s.split(r'\tableofcontents')[1] 8 | 9 | 10 | def chop_off_footer(s): 11 | assert s.count('\end{document}') == 1 12 | return s.split('\end{document}')[0] 13 | 14 | 15 | def extract_body(s): 16 | s = chop_off_header(s) 17 | s = chop_off_footer(s) 18 | return s 19 | 20 | 21 | def other_changes(s): 22 | # s = s.replace("section{", "section*{") 23 | s = s.replace("£", "$\pounds$") 24 | return s 25 | 26 | 27 | def main(): 28 | input = sys.argv[1] 29 | output = sys.argv[2] 30 | content = open(input).read() 31 | result = extract_body(content) 32 | result = other_changes(result) 33 | open(output, 'w').write(result) 34 | 35 | 36 | if __name__ == '__main__': 37 | main() 38 | -------------------------------------------------------------------------------- /paper/figures/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fangohr/template-latex-paper-from-orgmode/a6c9809e9c5452d48161b19b596f60056bb0edbd/paper/figures/icon.png -------------------------------------------------------------------------------- /paper/latexmkrc: -------------------------------------------------------------------------------- 1 | add_cus_dep('org', 'tex', 0, 'orgmode2latex'); 2 | sub orgmode2latex { 3 | system("make content.tex"); 4 | } 5 | 6 | # inspiration from https://www.semipol.de/posts/2018/06/latex-best-practices-lessons-learned-from-writing-a-phd-thesis/ 7 | -------------------------------------------------------------------------------- /paper/loop-make.sh: -------------------------------------------------------------------------------- 1 | # "watch make" doesn't work somehow, use this instead 2 | while true; do 3 | make 4 | sleep 2 5 | done 6 | -------------------------------------------------------------------------------- /paper/org-files-to-tex.el: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env emacs --script 2 | ;; Emacs script for exporting all org files in current directory to pdf 3 | ;; using LaTeX and beamer. 4 | ; 5 | ;; Author: Sam Sinayoko, Hans Fangohr, 27/12/2015 6 | ;; Email: s.sinayoko@soton.ac.uk 7 | ;; Date: 05/10/2014 8 | 9 | (require 'ox-latex) 10 | 11 | ;; Define an interactive function for easy testing 12 | (defun org-beamer-export-to-pdf-directory (files) 13 | "Export all files to latex" 14 | (interactive "Export org files to tex") 15 | (save-excursion 16 | (let ((org-files-lst )) 17 | (dolist (org-file files) 18 | (message "*** Exporting file %s ***" org-file) 19 | (find-file org-file) 20 | (org-latex-export-to-latex) 21 | (kill-buffer))))) 22 | 23 | ;;;; Make the code blocks look nicer 24 | ;;(add-to-list 'org-latex-packages-alist '("" "minted")) 25 | ;;(add-to-list 'org-latex-packages-alist '("" "fancyvrb")) 26 | ;;(setq org-latex-listings 'minted) 27 | ;;(setq org-latex-pdf-process 28 | ;; '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 29 | ;; "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 30 | ;; "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) 31 | ;;(setq org-latex-minted-options 32 | ;; '(("bgcolor" "white") ("frame" "lines"))) 33 | ;; 34 | ;;;; Make the results block look nicer with package fancyvrb 35 | ;;;; The package fancyvrb must be included in the org-file header 36 | ;;(defun org-latex-filter-fancyvrb (text backend info) 37 | ;; "Convert begin/end{verbatim} to begin/end{Verbatim}. 38 | ;; Allows use of the fancyvrb latex package." 39 | ;; (when (or (org-export-derived-backend-p backend 'beamer) 40 | ;; (org-export-derived-backend-p backend 'latex)) 41 | ;; (replace-regexp-in-string 42 | ;; "\\\\\\(begin\\|end\\){verbatim}" 43 | ;; "\\\\\\1{Verbatim}" 44 | ;; text))) 45 | ;; 46 | ;;(add-to-list 'org-export-filter-final-output-functions 47 | ;; 'org-latex-filter-fancyvrb) 48 | 49 | 50 | ;; the next section allows to add :ignoreheading: to section headers, 51 | ;; and the heading will be removed in the latex output, but the section 52 | ;; itself be included. 53 | ;; 54 | ;; This is useful to 'label' paragraphs or sections to draft a document 55 | ;; while not wanting to reveal that label/title in the final version to the 56 | ;; reader. 57 | (defun org-ignore-headline (backend) 58 | "Remove headlines with :ignoreheading: tag." 59 | (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol))) 60 | "ignoreheading")) 61 | (add-hook 'org-export-before-processing-hook #'org-ignore-headline) 62 | 63 | ;; Use utf8x for LaTeX export to access more unicode characters 64 | (setq org-latex-inputenc-alist '(("utf8" . "utf8x"))) 65 | 66 | ;; Export all org files given on the command line 67 | (org-beamer-export-to-pdf-directory argv) 68 | -------------------------------------------------------------------------------- /paper/paper.bib: -------------------------------------------------------------------------------- 1 | @Article{authorX2016, 2 | author = {Sum Body}, 3 | title = {About orgmode}, 4 | journal = {elisp reviews}, 5 | year = {2016}, 6 | } 7 | -------------------------------------------------------------------------------- /paper/paper.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | % to include pdf/eps/png files 4 | \usepackage{graphicx} 5 | 6 | % useful to add 'todo' markers 7 | \usepackage{todonotes} 8 | 9 | % hyperrefs 10 | \usepackage{hyperref} 11 | 12 | % nice source code formatting 13 | \usepackage{minted} 14 | 15 | % change style of section headings 16 | \usepackage{sectsty} 17 | \allsectionsfont{\sffamily} 18 | 19 | % only required for orgmode ticked TODO items, can remove 20 | \usepackage{amssymb} 21 | 22 | % only required for underlining text 23 | \usepackage[normalem]{ulem} 24 | 25 | % often use this in differential operators: 26 | \renewcommand{\d}{\ensuremath{\mathrm{d}}} 27 | 28 | % allow more reasonable text width for most documents than LaTeX default 29 | \setlength{\textheight}{21cm} 30 | \setlength{\textwidth}{16cm} 31 | 32 | % reduce left and right margins accordingly 33 | \setlength{\evensidemargin}{-0cm} 34 | \setlength{\oddsidemargin}{-0cm} 35 | 36 | % reduce top margin 37 | \setlength{\topmargin}{0cm} 38 | 39 | % Increase default line spacing a little if desired 40 | \renewcommand{\baselinestretch}{1.2} 41 | 42 | % tailored float handling 43 | %\renewcommand{\topfraction}{0.8} 44 | %\renewcommand{\bottomfraction}{0.6} 45 | %\renewcommand{\textfraction}{0.2} 46 | 47 | \begin{document} 48 | 49 | \title{\sffamily \textbf{Title -- template for orgmode latex production}} 50 | 51 | \author{Hans Fangohr, Max Albert, University of Southampton} 52 | 53 | \maketitle 54 | 55 | \begin{abstract} 56 | This is an abstract abstract, in the sense of only providing a 57 | virtual abstract, also known as the interface. Somebody will have to 58 | provide an inherited class that provides the real abstract. 59 | 60 | We have placed the abstract in the paper.tex file, so that all the 61 | content in the orgmode file \texttt{content.org} is organised into 62 | sections, and they can be unfolded, re-arranged, etc (the abstract 63 | doesn't go well into a section because it appears even before the 64 | first section starts). If you prefer, you can move the abstract 65 | latex definition as is into the \texttt{content.org} file, and all 66 | will work as before. 67 | \end{abstract} 68 | 69 | 70 | % include body of the paper, auto generated from orgmode content.org file 71 | \input{content.tex} 72 | 73 | 74 | \bibliographystyle{abbrv} 75 | \bibliography{paper.bib} 76 | 77 | \end{document} 78 | --------------------------------------------------------------------------------