[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] export to LaTeX with TOC but without numbers
From: |
Andreas Leha |
Subject: |
Re: [O] export to LaTeX with TOC but without numbers |
Date: |
Tue, 04 Jun 2013 21:56:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Hi Eric,
Eric S Fraga <address@hidden> writes:
> Andreas Leha <address@hidden> writes:
>> Eric S Fraga <address@hidden> writes:
>
> [...]
>
>>> There are workarounds but they involve using latex directly (to add
>>> entries to a TOC basically).
>>
>> I am aware of that. Sorry for being unclear. I would like to automate
>> exactly that.
>>
>> I use several LaTeX export classes and I would like that possibility
>> (TOC with unnumbered sections/subsections/...) in each of these classes.
>> Thus, I am searching for a (more) general approach, that I could 'switch on'
>> and have it insert the latex statement on its own.
>>
>> Best,
>> Andreas
>
> Ah, I see. Well, you could do something along these lines (completely
> untested and likely to be wrong...):
>
> #+latex_header:
> \newcommand{\mysection}[1]{\section*{#1}\addcontentsline{toc}{section}{#1}}
>
> and similar for subsection, subsubsection, ...
>
> Then customise org-latex-classes and replace, for instance,
> \\section*{%s} by \\mysection{%s}.
>
> However, you'll probably need to put a bit more TeX in the
> addcontentsline bit if you want some proper formatting (have a look at
> latex.ltx [around line 5659 in my version of this file] to see how
> content lines are handled by default...).
>
> Not trivial but also not impossible!
>
> I would suggest you look at latex-specific fora for answers to the more
> general question of generating tables of contents for unnumbered
> headings as I can imagine that there are simpler solutions.
>
Thanks for these hints! When I follow that route I'll have to do
more work I guess:
1. either I have to provide two versions of my org-latex-classes (one
for numbered and one for un-numbered cases)
2. or I have to provide a filter or sth similar to replace sections
with mysections, correct?
That's why I would prefer to follow Nick's suggestion.
Regards,
Andreas
- [O] export to LaTeX with TOC but without numbers, Andreas Leha, 2013/06/04
- Re: [O] export to LaTeX with TOC but without numbers, Nick Dokos, 2013/06/04
- Re: [O] export to LaTeX with TOC but without numbers, Andreas Leha, 2013/06/04
- Re: [O] export to LaTeX with TOC but without numbers, Nick Dokos, 2013/06/04
- Re: [O] export to LaTeX with TOC but without numbers, Andreas Leha, 2013/06/05