emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: First steps exporting to tex


From: Tim Cross
Subject: Re: First steps exporting to tex
Date: Mon, 05 Apr 2021 15:05:25 +1000
User-agent: mu4e 1.5.11; emacs 28.0.50

> Hi Tim

> I have been exporting from orgmode to PDF time ago, but very basic PDFs, 
> playing with some basic options of orgmode. When I tried to produce a
> meeting minute with a logo in the heading, I decided that I should learn 
> better a way of exporting, because the minute meeting was a first
> challenge, but many more would come. For example, for that task I started 
> with this code, which I think it goes far beyond what the "LaTeX
> Defaults" can offer (I must yet "play around" a lot with it):

> #+BEGIN_SRC

> #+options: toc:nil
> #+options: num:1
> #+options: d:nil
> #+export_file_name: BORRAR
> #+options: broken-links:mark

> #+LaTeX_header_extra: \usepackage{fancyhdr}

> #+begin_export LaTeX
> \thispagestyle{fancy}
> \lhead{\includegraphics[width=4cm]{//192.168.1.2/f/LOGO-IMAGEN 
> CORPORATIVA/IMAGEN CORPORATIVA 2018/DEFINITIVO
> ANAGRAMAS/SELLO1_grueso.png}}
> \rhead{Student Name: John Doe\\
> Student ID: 1234\\
> Course: IDB 601 (Fall 2020)}
> #+end_export
> #+END_SRC

> The buffer I exported my meeting notes from has much more information which 
> is not related with meetings nor with the logo. So I foresaw 3 things:

> 1 A fast cluttering of the buffers with LaTeX headings would happen, as I 
> will learn more about LaTeX and I will want to add more and more
>  packages. 
> 2 A need for flexibility to be able to export different kinds of documents 
> from the same buffer, ideally achieved just by changing a line (or few lines)
>  in the buffer. Although, from my example, it seems that ~#+begin_export...~ 
> contents can't be added in that way.
> 3 A great potential if it were possible to use already existing, and well 
> curated, LaTeX templates frictionless through orgmode.

> I find quite useful to analyse the default generated TeX file though.

> Best regards

OK, now I understand your objectives a bit more there are a couple of
things I would recommend.

Org is already fully setup to provide a clean and consistent way to do
much of what you are currently achieving with export latex blocks and
which can avoid much of the clutter in your org files. The way you are
customizing the latex etc is OK for 'one off' type hacks, but isn't the
best solution for crating a standard format. 

Have a look at the documentation for org-latex-classes. In this
variable, you can define your own 'pseudo' classes, which you can then
use in your org file with a simple #+LATEX_CLASS: line. This will take
care of all the preamble stuff, plus more (it uses other org variables,
such as ones for listing default 'usepackage' lines and other preamble
lines, so read the documentation carefully).

So, you could add a 'meeting' class to that variable and when you need
to do an org file for meetings, just add #+LATEX_CLASS; meeting at the
top of your org file and your ready to go.

This is what I did for my 'work' class, which produces documents
that included my employers logo, branding colours, fonts, font sizes,
heading formats etc. Now when I need to produce a work document, I just
add the #+LATEX_CLASS: header and then just write a normal org file. I
actually had a number of these custom 'class' definitions. 

Really nice thing is that if I find something needs to be tweaked or
changed, I just have to fix the org-latex-classes and related
definitions and know that if I re-export any of my org files that use
them, they will all get the fix (no need to edit each individual org
file to apply the fix).


-- 
Tim Cross



reply via email to

[Prev in Thread] Current Thread [Next in Thread]