emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Jean Louis <bugs@gnu.support>
Cc: orgmode <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <87wntjowtz.fsf@posteo.net> (raw)
In-Reply-To: <YGRDniPgT4eUcxRW@protected.localdomain> (Jean Louis's message of "Wed, 31 Mar 2021 12:40:46 +0300")

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



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

Best regards,

Juan Manuel 

      parent reply	other threads:[~2021-04-03 21:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31  9:40 Jean Louis
2021-03-31 10:03 ` Eric S Fraga
2021-03-31 10:29   ` Jean Louis
2021-03-31 10:45     ` Eric S Fraga
2021-03-31 11:04       ` Jean Louis
2021-03-31 12:30         ` Eric S Fraga
2021-03-31 11:32 ` Greg Minshall
2021-03-31 20:04   ` Jean Louis
2021-04-01  3:47     ` Greg Minshall
2021-04-01  4:44     ` Greg Minshall
2021-04-03 21:57 ` Juan Manuel Macías [this message]

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:

  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=87wntjowtz.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=bugs@gnu.support \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: How to expand macro in LaTeX export? How to use different options per export type?' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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