[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TOC and latex memoir class
From: |
Juan Manuel Macías |
Subject: |
Re: TOC and latex memoir class |
Date: |
Sat, 02 Apr 2022 07:21:49 +0000 |
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