How can I use following template in an org mode on latex. This will help me understand the org mode latex. Kindly explain the changes you make in the template so that I understand the org mode better (Teach me fishing!)
Regards
\documentclass{article}
\usepackage{eso-pic}
\usepackage{fancyhdr}
\usepackage{blindtext} % just for the example
\usepackage[headsep=3cm,top=5cm]{geometry}
\usepackage{datatool}
% create sample csv file
\begin{filecontents*}{test.csv}
Id,myauthor,mydate,myaddress
1,Sebastian,12.12.2012,XYZ road,XYZ city
2,Rose,12.12.2013,XYZ road,abc city
\end{filecontents*}
% load data
\DTLloaddb{mydata}{test.csv}
\AddToShipoutPicture{%
\AtTextUpperLeft{%
\makebox(420,75)[lt]{%
\footnotesize%
\begin{tabular}{@{}*{3}{p{4.5cm}}@{}}%
\textbf{Author}\newline\myauthor&%
\textbf{Date of birth}\newline\mydate&%
\textbf{Address}\newline\myaddress%
\end{tabular}%
}}}
\pagestyle{fancy}
\newcommand{\myauthor}{user34083}
\newcommand{\mydate}{December 26, 1997}
\newcommand{\myaddress}{26 Washington Ave., Manhattan, New York.\newline United States of America}
% Define a command that fetches data for the row with the ID
% given in the argument
\newcommand*{\fetchdata}[1]{%
% fetch the first matching row
\dtlgetrowforvalue{mydata}{\dtlcolumnindex{mydata}{Id}}{#1}%
% Lookup the required values from this row
\dtlgetentryfromcurrentrow{\myauthor}{\dtlcolumnindex{mydata}{myauthor}}%
\dtlgetentryfromcurrentrow{\mydate}{\dtlcolumnindex{mydata}{mydate}}%
\dtlgetentryfromcurrentrow{\myaddress}{\dtlcolumnindex{mydata}{myaddress}}%
}
% fetch data for Id=2
\fetchdata{2}
\begin{document}
\blinddocument % just for the example
\end{document}
Best Answer
I have only tested this in versions pre-8.0.
I would highly recommend to read the
org-mode
manual forLaTeX
exporting capabilities. It is very good: org-export-latex.org-mode
for Emacs has the optionalLaTeX
customization by using this:You can put as many header information lines as you please which in turn can build your custom
LaTeX
file on the fly.Note that you can also use the above command to add packages.
Classes
Choosing the class for your org-file determines the packages that is used by a certain setup in your
.emacs
file.To choose the org-class you do:
To change the settings of the org-class
article
you add this to your.emacs
file (example):You can also do:
which will let you do:
Default packages for all classes
For customization of the default packages you use, you can do something like:
which will add the
amsmath
package to all your classes.You can test with this small document and the above settings:
Which will give you something like this: