emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to expand macro in LaTeX export? How to use different options per export type?
@ 2021-03-31  9:40 Jean Louis
  2021-03-31 10:03 ` Eric S Fraga
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jean Louis @ 2021-03-31  9:40 UTC (permalink / raw)
  To: Org mailing list

In this following peculiar setup, I wish to publish the macro value
{{{version}}} inside of the LaTeX source code export. That makes the
first page how I need it, as it displays logo and other matters. But I
cannot use macro replacements in src blocks, right?

That is why I have defined \def\version{ {{{version}}} } that it gets
expanded in LaTeX source code, that works fine, and all is good.

But then the line with \def\version{ {{{version}}} } gets shown in
HTML export, which is not what I want. How to resolve that?

Possible solution would be:

- to somehow be able to expand macros in LaTeX section? Is that
  possible?

- to somehow hide \def\version{ {{{version}}} }in HTML. But I do not
  know how.

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?

#+TITLE: My title
#+MACRO: version Time-stamp: <Wednesday, March 31 2021, 10:10>
#+AUTHOR: Jean Louis
#+SETUPFILE: /home/admin/Programming/git/org-html-themes/setup/theme-readtheorg.setup
#+OPTIONS: title:nil toc:nil todo:nil
\def\version{ {{{version}}} }

#+BEGIN_EXPORT latex
\begin{titlepage}
\begin{center}

{\Huge My title in LaTeX \\ Project by Jean Louis}

%{\Large Some other title, maybe}

\vspace{0.5cm}
{\large Revision: \version{} }

\includegraphics[width=12cm]{/home/graphics/my-logo.jpg}

\end{center}
\end{titlepage}
\tableofcontents
#+END_EXPORT


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns



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

end of thread, other threads:[~2021-04-03 21:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31  9:40 How to expand macro in LaTeX export? How to use different options per export type? 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

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