emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: First steps exporting to tex
Date: Mon, 05 Apr 2021 15:05:25 +1000	[thread overview]
Message-ID: <87v991z4h6.fsf@gmail.com> (raw)
In-Reply-To: <5d1bbedb-0332-d584-c6ef-9ca0d8351003@gmail.com>


> 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


  parent reply	other threads:[~2021-04-05  5:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-03  9:31 First steps exporting to tex Ypo
2021-04-03 10:15 ` Martin Steffen
2021-04-04 11:04   ` Ypo
2021-04-04 11:36     ` Juan Manuel Macías
2021-04-05  5:05     ` Tim Cross [this message]
2021-04-03 10:43 ` Dr. Arne Babenhauserheide
2021-04-03 12:10 ` Juan Manuel Macías
2021-04-03 13:31 ` Tim Cross
2021-04-03 16:55   ` Diego Zamboni
2021-04-03 17:07     ` William Denton
2021-04-03 17:49       ` Juan Manuel Macías
2021-04-03 18:36         ` Jean Louis
2021-04-03 20:46           ` Juan Manuel Macías

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v991z4h6.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).