I am currently playing around with org-mode
in Spacemacs to render some file as LaTeX. I want to add a preamble and a new function to change the default \maketitle
org-mode
uses.
I am using a #+SETUPFILE
so my org file looks like:
#+SETUPFILE: ../setup_file.org
<-content here->
In my setup_file.org
I include all the headers, including some LATEX_HEADERS
that will call my custom preamble and my \psetheader
function:
#+OPTIONS: toc:nil
#+STARTUP: align fold nodlcheck hidestars oddeven lognotestate
#+LATEX_HEADER: \documentclass[11pt]{article}
#+LATEX_HEADER: \input{../header.tex}
#+LATEX_HEADER: \psetheader
#+KEYWORDS: orgmode pdf latex
#+LANGUAGE: en
Finally, the header.tex
file just includes the packages I need and the \psetheader
command. Now, the rendering fails, it produces a document, but is not quite there. When I open the .tex
file, I find that org
has included a preamble on top:
% Created 2023-04-07 Fri 19:37
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\documentclass[11pt]{article}
\input{../header.tex}
\psetheader
I have tried to just render just the body, as this post suggests, but then no preamble is rendered into the .tex
file and it fails to build. There is an option to just make nil
the default preamble temporarily? I have tried to create a org-latex-class
, but it does not play nice with my header command.