emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Templating of PDF export


From: John Kitchin
Subject: Re: Templating of PDF export
Date: Mon, 03 Feb 2020 07:48:26 -0500
User-agent: mu4e 1.3.6; emacs 26.3

I don't know of a nice Jinja like template for this.

I think what you need is a custom exporter. You can define template
function that is responsible for the latex source. In this function you
would check for the attachment, scale it as you want, and insert the
figure code in the latex source where you want it.

I have defined a template function for a memo that you might find some
inspiration from, you can see it at.

https://github.com/jkitchin/scimax/blob/master/ox-cmu/ox-cmu-memo.el

I guess somewhere around line 91 is where you would put the code to
insert attachments.

Yours might be quite a bit simpler if you don't need file keywords for
information.

Now that I am looking at this, you could use something like s-format or
mustache to get a reasonable template. I just used concat for the most
part. The trick would be finding the template system where escaping
characters wasn't too tedious, you already have to escape some things in
the template.



Florian Lindner <address@hidden> writes:

> Hello,
>
> I am collecting my cooking recipes in an org-mode file. While that
> certainly works for, I would like to have a nice LaTeX export for
> non-nerd mortals to look at. All recipes are in one file and each one
> looks like:
>
> * Pancakes
> ** Ingredients
> + 6 Eggs
> + 3 Apples
> ** Directions
> Just do it!
> ** Source
> My mother
>
> Sometimes I take a photo of the meal and ATTACH it.
>
> Most guides how to customize org export are about modifying the document
> class and latex snippets there there. However, the basic association
> with * Pancakes -> \section, ** Ingredients -> \subsection stays the same.
>
> Is there something builtin org-mode which allows to use a templating
> language that allows for a more freely combination of elements, similar
> to Jinja or alike?
>
> For example, I want to embed the attachment in the export, appropriately
> scaled and nicely placed and have a line break after each recipe.
>
> I know about org-chef, but AFAIK it's more about importing templates
> from websites, not about a nice export.
>
> Any ideas for that?
>
> Thanks!
> Florian


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

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