From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Steve Downey <sdowney@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: TOC and latex memoir class
Date: Sat, 02 Apr 2022 07:21:49 +0000 [thread overview]
Message-ID: <87y20ogdbm.fsf@posteo.net> (raw)
In-Reply-To: <CAJEGDKqDgJ4eP3-mOyZ8E8moyHBcrcSYCmxjz+7u-eKybX2wHg@mail.gmail.com> (Steve Downey's message of "Fri, 1 Apr 2022 19:22:23 -0400")
Hi Steve,
Steve Downey writes:
> In order to place the table of contents without a section name
> "Contents" the memoir class uses \tableofcontents* rather than
> \tableofcontents.
> However, `org-latex-toc-command` is documented as:
> "LaTeX command to set the table of contents, list of figures, etc.
> This command only applies to the table of contents generated with
> the toc:nil option, not to those generated with #+TOC keyword."
> Which is confusing in two ways, first that toc:nil doesn't generate a
> table of contents, and that it doesn't seem to provide any way of
> getting the string to be used?
>
> As a workaround, I could use the latex command directly, but that
> means not having it available in, for example, an html export.
>
> Is there a workaround I'm missing?
One possible workaround would be to define a macro with a conditional:
if exporting to LaTeX, returns the string 'toc:nil'; otherwise, returns
'toc:t'. And the LaTeX command can be added via a export snippet.
Something like this:
#+MACRO: mytoc (eval (if (eq org-export-current-backend 'latex) "#+OPTIONS: toc:nil" "#+OPTIONS: toc:t"))
{{{mytoc}}}
@@latex:\tableofcontents*@@
* Heading 1
lorem ipsum dolor
* Heading 2
lorem ipsum dolor
------------
Best regards,
Juan Manuel
prev parent reply other threads:[~2022-04-02 7:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 23:22 TOC and latex memoir class Steve Downey
2022-04-02 7:21 ` 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:
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=87y20ogdbm.fsf@posteo.net \
--to=maciaschain@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=sdowney@gmail.com \
/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).