emacs-orgmode
[Top][All Lists]
Advanced

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

Using Org-mode macros as LaTeX macros


From: Sébastien Gendre
Subject: Using Org-mode macros as LaTeX macros
Date: Sat, 01 Jun 2024 07:48:29 +0200
User-agent: mu4e 1.12.1; emacs 29.3

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: signature.asc
Description: PGP signature


reply via email to

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