Skip to content

Instantly share code, notes, and snippets.

@jackbaty
Last active January 7, 2025 14:25
Show Gist options
  • Save jackbaty/ee2d7ed288c3f4283bc49cea6c19a14e to your computer and use it in GitHub Desktop.
Save jackbaty/ee2d7ed288c3f4283bc49cea6c19a14e to your computer and use it in GitHub Desktop.
--- org LaTeX config ---
;; LaTeX ---------------------------------------------------------------------
;; My default LaTeX class
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("scrartcl"
"\\documentclass{scrartcl}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(add-to-list 'org-latex-classes
'("org-plain-latex"
"\\documentclass{article}
[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}"))))
(setq org-latex-caption-above nil)
(setq org-latex-pdf-process
(quote
("xelatex -interaction nonstopmode %f" "xelatex -interaction nonstopmode %f")))
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-start-server t)
(setq TeX-source-correlate-method 'synctex)
;; /LaTeX --------------------------------------------------------------------
--- at top of monthly journal ---
#+title: Journal - December 2024
#+date:
#+setupfile: ~/Documents/Notes/org/_SETUP/EXPORT
#+setupfile: ~/Documents/Notes/org/_SETUP/jack-latex-journal-twocolumn.setup
#+latex_class_options: [10pt,twocolumn]
#+startup: folded
#+latex_header: \usepackage[labelformat=empty]{caption}
#+latex_header: \captionsetup{format=plain, font=small}
#+latex_header: \renewcommand{\thefigure}{}
--- include: EXPORT ---
#+AUTHOR: Jack Baty
#+OPTIONS: toc:nil num:nil <:nil ':t
#+OPTIONS: *:t -:t ::t <:nil H:4 \n:nil ^:{} arch:headline
#+OPTIONS: broken-links:t c:nil creator:nil
#+OPTIONS: author:t title:t date:t
#+OPTIONS: d:t e:t email:nil f:t inline:t num:nil
#+OPTIONS: p:nil pri:nil prop:nil stat:nil tags:nil tasks:nil tex:t
#+OPTIONS: timestamp:nil toc:nil todo:nil |:t
#+SELECT_TAGS: export
#+EXCLUDE_TAGS: noexport nolatex
--- include: jack-latex-journal-twocolumn.setup ---
#+LaTeX_CLASS: org-plain-latex
#+LaTeX_CLASS_OPTIONS: [letterpaper, 10pt]
#+LATEX_HEADER: \usepackage{lmodern} % Ensures we have the right font
#+LaTeX_CLASS_OPTIONS: [twocolumn,portrait]
#+LATEX_HEADER: \usepackage[T1]{fontenc}
#+LATEX_HEADER: \usepackage[AUTO]{inputenc}
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{amsmath, amsthm, amssymb}
#+LATEX_HEADER: \usepackage[table, xcdraw]{xcolor}
% Colorizing links in a nicer way.
#+LATEX_HEADER: \definecolor{bblue}{HTML}{0645AD}
#+LATEX_HEADER: \usepackage[colorlinks]{hyperref}
#+LATEX_HEADER: \hypersetup{colorlinks, linkcolor=blue, urlcolor=bblue}
% Moving up the title.
#+LATEX_HEADER: \usepackage{titling}
#+LATEX_HEADER: \setlength{\droptitle}{-6em}
#+LATEX_HEADER: \setlength{\parindent}{0pt}
#+LATEX_HEADER: \setlength{\parskip}{1em}
#+LATEX_HEADER: \usepackage[stretch=10]{microtype}
#+LATEX_HEADER: \usepackage{hyphenat}
#+LATEX_HEADER: \usepackage{ragged2e}
#+LATEX_HEADER: \usepackage{subfig} % Subfigures (not needed in Org I think)
#+LATEX_HEADER: \usepackage{hyperref} % Links
#+LATEX_HEADER: \usepackage{listings} % Code highlighting
% Disables flush alighment on the right side. Personal preference.
#+LATEX_HEADER: \RaggedRight
% Page geometry
#+LATEX_HEADER: \usepackage[top=1cm, bottom=1.5cm, left=2.5cm, right=2.5cm,includehead,includefoot]{geometry}
#+LATEX_HEADER: \setlength{\columnsep}{7mm} % Column separation width
% Line spacing (enable to increase a tad)
% #+LATEX_HEADER: \renewcommand{\baselinestretch}{1.15}
% Page numbering - this disables it
# #+LATEX_HEADER: \pagenumbering{gobble}
% Spacing, titling, text setting.
#+LATEX_HEADER: \usepackage[explicit]{titlesec}
% Title customization
#+LATEX_HEADER: \pretitle{\begin{center}\fontsize{20pt}{20pt}\selectfont}
#+LATEX_HEADER: \posttitle{\par\end{center}}
#+LATEX_HEADER: \preauthor{\begin{center}\vspace{-6bp}\fontsize{14pt}{14pt}\selectfont}
#+LATEX_HEADER: \postauthor{\par\end{center}\vspace{-20bp}}
#+LATEX_HEADER: \predate{\begin{center}\fontsize{12pt}{12pt}\selectfont}
#+LATEX_HEADER: \postdate{\par\end{center}\vspace{0em}}
% Section/subsection headings:
%Section
#+LATEX_HEADER: \titlespacing\section{0pt}{5pt}{0pt} % left margin, space before section header, space after section header
%Subsection
#+LATEX_HEADER: \titlespacing\subsection{0pt}{5pt}{-2pt} % left margin, space before subsection header, space after subsection header
%Subsubsection
#+LATEX_HEADER: \titlespacing\subsubsection{0pt}{5pt}{-2pt} % left margin, space before subsection header, space after subsection header
% List spacing
#+LATEX_HEADER: \usepackage{enumitem}
#+LATEX_HEADER: \setlist{itemsep=-2pt} % or \setlist{noitemsep} to leave space around whole list
# %Section
# #+LATEX_HEADER: \titleformat{\section} {\Large}{\thesection}{1em}{\textbf{#1}} % Section header formatting
# #+LATEX_HEADER: \titlespacing\section{0pt}{5pt}{-5pt} % left margin, space before section header, space after section header
# %Subsection
# #+LATEX_HEADER: \titleformat{\subsection} {\large}{\thesubsection}{1em}{\textbf{#1}}
\titlespacing\subsection{0pt}{5pt}{-5pt} % left margin, space before subsection header, space after subsection header
# %Subsubsection
# #+LATEX_HEADER: \titleformat{\subsubsection} {\large}{\thesubsubsection}{1em}{#1}
\titlespacing\subsubsection{0pt}{5pt}{-5pt} % left margin, space before subsection header, space after subsection header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment