I have a LaTeX file with some directives for my TeX documents (\usepackage
and such things). Now I want to reuse this file in different org-mode files. I know I can include files with #+include: 'path/to/some/file.tex'
, but this puts the content of the file after \begin{document}
.
Can I somehow include a file into the header?
As suggested, here an example:
A template.tex file that holds the header:
\documentclass[a4paper]{customClass}
\usepackage{etex}
\title{Some Title}
\supervisor{Someone}
As also shown here, this uses a custom document class, which is one of the reasons why I just want to be able to include it.
Then I have a file which contains all the content (content.org):
#+INCLUDE: template.tex
* Chapter 1
** Subchapter 1
Some content
** Subchapter 2
More content
Which currently outputs (content.tex):
\documentclass[11pt]{article}
\usepackage[latin1]{inputenc}
% a lot more org-mode standard header stuff
% ...
\begin{document}
\maketitle
\setcounter{tocdepth}{3}
\tableofcontents
\vspace*{1cm}
% my template.tex file
% not where I wanted it
\documentclass[a4paper]{customClass}
\usepackage{etex}
\title{Some Title}
\supervisor{Someone}
\section{Chapter 1}
% rest of the document
% ...
\end{document}
So in short: I want to reuse my template.tex
file in a few org documents to have consistent formatting. Is this possible?
LaTeX_HEADER: \input{template}
?org
, but don't you want to set this in your.emacs
? That is, with(add-to-list 'org-export-latex-classes <stuff> )
.