Here are some the SETUPFILEs I use when I am writing documents that I will import into a
If you are using these templates for real work, check out the sections under Report.org for more detail on writing in org-mode and exporting to latex.
In the example-report
folder, check the bottom commented header in the org file (at the very bottom), and the .latexmkrc
.
You will need these to setup auto compiling of the org → tex → pdf.
#+title: Big title
#+subtitle: Subtitle
#+AUTHOR: Your name
#+SETUPFILE: ~/.config/doom/latex-templates/report.org
#+LATEX_HEADER: \fancyhead[C]{Title here}
#+LATEX_HEADER: \fancyfoot[C]{\thepage}
#+LATEX: \newpage
Start here...
To use it just add the setupfile line.
Setupfile should point to wherever you’re report.org
is on your disk.
A real example file is in the works and coming soon…
#+title: Big title
#+subtitle: Subtitle
#+AUTHOR: Your name
#+SETUPFILE: ~/.config/doom/latex-templates/report.org
#+LATEX_HEADER: \usepackage{titling}
#+LATEX_HEADER: \renewcommand{\maketitlehooka}{\vspace{-2em}}
#+LATEX_HEADER: \renewcommand{\maketitlehookb}{\begin{center}\large Optional Subtitle here \end{center}\vspace{-1em}}
#+LATEX_HEADER: \renewcommand{\maketitlehookd}{\newpage}
#+LATEX_HEADER: \AtBeginDocument{\thispagestyle{plain}}
#+LATEX_HEADER: \fancyhead[C]{Title here}
#+LATEX_HEADER: \fancyfoot[C]{\thepage}
#+LATEX: \newpage
Start here...
We are using fancyhdr
package to achieve this.
To get column lines add this to the line above your table.
c|c|c|c
is for a table with four columns, and each aligned to the center. You can changec
tol
orr
to change this. Adjust accordingly depending on how many columns you have.
#+ATTR_LATEX: :align c|c|c|c
When displaying figures you have control or its placement, size and orientation.
#+ATTR_LATEX: :width 60px :placement [H] :options angle=90
Have a look at the different placement
options below.
Specifier | Placement |
---|---|
h | Place float here. (approximately at the same point it occurs in source text.) |
t | Top of the page. |
b | Bottom of the page. |
p | Special page for figures only |
! | Override internal parameters |
H | Places precisely at the lcataion in the float package. |
If you are including code blocks in your document and you want it to be pretty than add this to your emacs config.
If you are using Doom Emacs it will be in your
config.el
(setq org-latex-listings 'minted
org-latex-packages-alist '(("" "minted"))
org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
To use this check out - uos-org-report.
To add bibliography to your org file, create a .bib
file. Let’s name ours bibliography.bib
.
We’ll now need to tell our org file about it.
To the top of the file let’s add a new property - #+BIBLIOGRAPHY: bibliography.bib
.
Imagine we had this entry in our bib file.
@article{example_citation,
title={Literate Programming},
author={Donald E. Knuth},
journal={The Computer Journal},
volume={27},
number={2},
pages={97--111},
year={1984},
publisher={Oxford University Press}
}
We can reference this either through this notation [cite:@example_citation]
.
Or an easier way to do it is through org-cite-insert
or SPC m @
.
A really use full resource for org citations - https://blog.tecosaur.com/tmio/2021-07-31-citations.html#cite-syntax
You can mention page or page range by [cite:@example_citation p. 5]
[cite:@example_citation pp. 5-10]
There are a LOT of options like chap.
, para.
, pp.
, v.
, … etc
A good style and variant option is [cite/t/cf:@example_citation]
in the format of [cite/style/variant:@thing]
.
You can create footnotes with SPC m f
. Create footnotes with citation for a clean look.
- Setup RefTex? https://karthinks.com/software/reftex-in-org-mode/