emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Templating of PDF export
@ 2020-02-02  9:54 Florian Lindner
  2020-02-03 12:48 ` John Kitchin
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Lindner @ 2020-02-02  9:54 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Templating of PDF export
  2020-02-02  9:54 Templating of PDF export Florian Lindner
@ 2020-02-03 12:48 ` John Kitchin
  0 siblings, 0 replies; 2+ messages in thread
From: John Kitchin @ 2020-02-03 12:48 UTC (permalink / raw)
  To: emacs-orgmode

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 <mailinglists@xgm.de> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-03 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02  9:54 Templating of PDF export Florian Lindner
2020-02-03 12:48 ` John Kitchin

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).