emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using Org-mode macros as LaTeX macros
@ 2024-06-01  5:48 Sébastien Gendre
  2024-06-01  7:36 ` Bruno Barbier
  0 siblings, 1 reply; 4+ messages in thread
From: Sébastien Gendre @ 2024-06-01  5:48 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

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

end of thread, other threads:[~2024-06-01 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-01  5:48 Using Org-mode macros as LaTeX macros Sébastien Gendre
2024-06-01  7:36 ` Bruno Barbier
2024-06-01 12:05   ` Sébastien Gendre
2024-06-01 18:06     ` Berry, Charles

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