75 KiB
Summary
This How-To
tutorial provides a step by step guide on how to migrate the LaTeX template provided by an academic journal into org-mode
syntax.
Instructions
To complete this tutorial successfully, please follow all steps in the order presented of each section listed below:
- Requirements
- Create New
org-mode
File - Download LaTeX Template
- Migrate LaTeX Template Code into
file variables
- Migrate LaTeX Template Code into
SRC
blocks - Customize a
SRC
block using Literate Programming - Add Content to
org-mode
File - Export completed
org-mode
file asPDF
Requirements
Note: All the requirements must be completed successfully before continuing with the steps in this
How-To
tutorial.
Instructions
- Download, Install, and Configure LaTeX Software
Unfortunately, this requirement is beyond the scope of this
How-To
tutorial. - Download, Install, and Configure
emacs
Software Unfortunately, this requirement is beyond the scope of thisHow-To
tutorial. -
Download, Install, and Configure
org-mode
SoftwareNote: The
org-mode
application is already installed if you are using a recent version ofemacs
, i.e. versions 25 or greater.Unfortunately, this requirement is beyond the scope of this
How-To
tutorial. -
Export an
org-mode
file asPDF
via built-in LaTeX exporter.TIP: To export an
org-mode
document toPDF
:- Open the
org-mode
file inemacs
. - Position the cursor in the buffer of the
org-mode
document inemacs
. - Press the following key chords and keys,
C-c
C-e
l
p
to initiate the export process. - Open the exported
PDF
file to validate the export process succeeded.
If exporting an
org-mode
file toPDF
succeeded then continue following the steps in thisHow-To
tutorial. Otherwise troubleshoot each step in the requirements section and repeat until exporting anorg-mode
document toPDF
is successful. - Open the
Create New org-mode File
Instructions
-
Create a new
org-mode
file usingemacs
.For this tutorial, the filename will be
journal-template.org
-
To create the file in emacs do the following:
- Press the key chords
C-x
C-f
- Type
journal-template.org
- Press
Return
orEnter
key
- Press the key chords
-
-
Add
mode
line to top of the file.# -*- mode: org; org-confirm-babel-evaluate: nil; org-babel-noweb-wrap-start: "«"; org-babel-noweb-wrap-end: "»"; -*-
TIP: To insert
«
press key chordC-x
8
<
and to insert»
press key chordC-x
8
>
-
Add Template Utility Code Section to end of file.
* Template Utility Code :noexport:
-
Add Common Export Settings Section to end of the file.
* Common Export Settings :noexport: #+OPTIONS: ':nil *:t -:t ::t <:nil H:4 \n:nil ^:{} arch:headline #+OPTIONS: author:nil broken-links:nil c:nil creator:nil #+OPTIONS: d:(not "LOGBOOK") date:nil e:t email:nil f:t inline:t num:nil #+OPTIONS: p:nil pri:nil prop:t stat:nil tags:t tasks:nil tex:t #+OPTIONS: timestamp:nil title:nil toc:nil todo:nil |:t #+SELECT_TAGS: export #+EXCLUDE_TAGS: noexport nolatex # For Display when file is exported with org-ruby #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport
-
Save the file in
emacs
.-
To save the file in emacs do the following:
- Press the key chords
C-x
C-s
- Press the key chords
-
Self Check - Example 1
After completing the instructions in this section, the contents of journal-template.org should be similar to self-check-example-01.org.
Download LaTeX Template
For this How-To
tutorial, the LaTeX template1 provided by the European Physical Journal A (EPJ A)2 will be used.
The following 3 files provided by the EPJ A will be needed in this tutorial:
- template.tex
The
template.tex
file is provided as "[a] fill-in-form for a standard article with usage comments"3. The objective of thisHow-To
tutorial is migrate LaTeX code fromtemplate.tex
into the neworg-mode
file. - svepj.clo
The
svepj.clo
is the LaTeX "[c]lass option file for The European Physical Journal"4. - svjour.cls
The
svjour.cls
is the LaTeX "[c]ore document class file for Springer journals"5.
Instructions
-
Download template.tex file into same directory as
journal-template.org
. -
Download svepj.clo file into same directory as
journal-template.org
. -
Download svjour.cls file into same directory as
journal-template.org
.
Migrate LaTeX Template Code into file variables
In this section, the objective is migrate LaTeX code from LaTeX template into file varibles syntax at the bottom of the org-mode
file. The file varibles will be used when exporting from org-mode
back to LaTeX.
The LaTeX code that will be migrated into file variables syntax is located near the top of template.tex file:
%
\begin{filecontents}{leer.eps}
%!PS-Adobe-2.0 EPSF-2.0
%%CreationDate: Mon Jul 13 16:51:17 1992
%%DocumentFonts: (atend)
%%Pages: 0 1
%%BoundingBox: 72 31 601 342
%%EndComments
gsave
72 31 moveto
72 342 lineto
601 342 lineto
601 31 lineto
72 31 lineto
showpage
grestore
%%Trailer
%%DocumentFonts: Helvetica
\end{filecontents}
%
\documentclass[epj]{svjour}
TIP: When migrating the LaTeX code into
file variables
, you will need to double the backslashes\
, e.g.\end
will become\\end
.
Instructions
-
Add the following lines of file variables syntax to the end of the journal-template.org file.
# Local Variables: # eval: (require (quote cl-lib)) # eval: (require (quote ox)) # eval: (require (quote ox-publish)) # org-latex-with-hyperref: nil # eval: (add-to-list (quote org-latex-classes) (quote ("epj-svjour" "%%%%%%%%%%%%%%%%%%%%%%%% epj-svjour %%%%%%%%%%%%%%%%%%%%%%%%%% # % # \\begin{filecontents}{leer.eps} # %!PS-Adobe-2.0 EPSF-2.0 # %%CreationDate: Mon Jul 13 16:51:17 1992 # %%DocumentFonts: (atend) # %%Pages: 0 1 # %%BoundingBox: 72 31 601 342 # %%EndComments # # gsave # 72 31 moveto # 72 342 lineto # 601 342 lineto # 601 31 lineto # 72 31 lineto # showpage # grestore # %%Trailer # %%DocumentFonts: Helvetica # \\end{filecontents} # % # \\documentclass[epj]{svjour} # [NO-DEFAULT-PACKAGES] # [PACKAGES] # [EXTRA]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) # End:
-
Add the following line under the mode line near the top of the journal-template.org file.
#+LATEX_CLASS: epj-svjour
Self Check - Example 2
After completing the instructions in this section, the contents of journal-template.org should be similar to self-check-example-02.org.