[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to expand macro in LaTeX export? How to use different options pe
From: |
Juan Manuel Macías |
Subject: |
Re: How to expand macro in LaTeX export? How to use different options per export type? |
Date: |
Sat, 03 Apr 2021 23:57:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Jean Louis writes:
> Another issue related to this setup is that I would like:
>
> - for HTML export: title:t toc:t
>
> - for LaTeX PDF export: title:nil toc:nil
>
> Is there way to have options different for different exports?
You can do it with a macro like this:
#+MACRO: titletoc (eval (cond ((org-export-derived-backend-p
org-export-current-backend 'latex) "#+OPTIONS: title:nil\n#+OPTIONS:
toc:nil")((org-export-derived-backend-p org-export-current-backend 'html)
"#+OPTIONS: title:t\n#+OPTIONS: toc:t")))
{{{titletoc}}}
...
But maybe it would be better to use a block here:
#+begin_src emacs-lisp :exports results :results raw
(cond ((org-export-derived-backend-p org-export-current-backend 'latex)
"#+OPTIONS: title:t\n#+OPTIONS: toc:t")
((org-export-derived-backend-p org-export-current-backend 'html)
"#+OPTIONS: title:nil\n#+OPTIONS: toc:nil"))
#+end_src
Best regards,
Juan Manuel