emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Gendre" <seb@k-7.ch>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Using Org-mode macros as LaTeX macros
Date: Sat, 01 Jun 2024 07:48:29 +0200	[thread overview]
Message-ID: <87v82tkyc2.fsf@k-7.ch> (raw)

[-- Attachment #1: Type: text/plain, Size: 1816 bytes --]


TL;DR: How can I use the Org-mode macros as LaTeX macros inside an
       export LaTeX bloc ?



Hello,


In a document I write for my school, using Org-mode, I have defined a
Org-mode macro. Named "orga" (for organization) and who have the name of
my school as value.


Example:

#+MACRO: orga School Name


It's very useful to re-use the name of my school in the entire document.
And I can also re-use the title, author name, etc, who are defined at
the top of my Org-mode document with "#+TITLE:", "#+AUTHOR:", etc.


But my school ask for a special title page in the PDF export, with a
specific design. Something very different from what I get by default
with an Org-mode to LaTeX/PDF export.


For now, I have disabled the auto title generation, with an "#+OPTIONS:
title:nil". And I created an export LaTeX bloc at the top of my Org
document. In this bloc, I can make a custom title page in LaTeX and
export to a PDF who have the design requested by the school.

Example:

#+begin_export latex
\begin{titlepage}
  Some custom LaTeX here…
\end{titlepage}
#+end_export


But, I cannot use Org-mode macros inside this export LaTeX bloc. If I
write "{{{title}}}" in this bloc, it is exported into LaTeX with no
Org-mode macro substitution. I also tried to define a LaTeX macros, that
use the Org-mode macro value, with "#+LATEX_HEADER:" like this:

#+LATEX_HEADER:  \newcommand{\orga}{{{{orga}}}}


But the result in the LaTeX export file is:
"\newcommand{\orga}{{{{orga}}}}". And not "\newcommand{\orga}{School
Name}". No Org-mode macro substitution.

How can I use the Org-mode macros as LaTeX macros inside my export LaTeX
bloc ?

I have searched on the web, but didn't success to found a solution.


Best regards

-------
Gendre Sébastien

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

             reply	other threads:[~2024-06-01  5:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-01  5:48 Sébastien Gendre [this message]
2024-06-01  7:36 ` Using Org-mode macros as LaTeX macros Bruno Barbier
2024-06-01 12:05   ` Sébastien Gendre
2024-06-01 18:06     ` Berry, Charles

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=87v82tkyc2.fsf@k-7.ch \
    --to=seb@k-7.ch \
    --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).