From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: export to LaTeX with TOC but without numbers Date: Tue, 04 Jun 2013 22:10:55 +0200 Message-ID: <871u8h63hs.fsf@med.uni-goettingen.de> References: <87hahe5nyc.fsf@med.uni-goettingen.de> <87sj0yt7v4.fsf@pinto.chemeng.ucl.ac.uk> <87a9n65bun.fsf@med.uni-goettingen.de> <878v2pn1ic.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjxZe-0006SK-Mb for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 16:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjxZZ-0001Ro-3Q for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 16:11:18 -0400 Received: from plane.gmane.org ([80.91.229.3]:45664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjxZY-0001RV-Sh for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 16:11:13 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UjxZV-00023j-P5 for emacs-orgmode@gnu.org; Tue, 04 Jun 2013 22:11:09 +0200 Received: from p5b35fdf2.dip0.t-ipconnect.de ([91.53.253.242]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 22:11:09 +0200 Received: from andreas.leha by p5b35fdf2.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 22:11:09 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Nick, Nick Dokos writes: > Andreas Leha writes: > >> Hi Eric, >> >> thanks for your answer. >> >> Eric S Fraga writes: >> >>> Andreas Leha writes: >>> >>>> Hi all, >>>> >>>> How can I export to LaTeX with the combined effect of toc:t and num:nil? >>>> >>>> Setting num:nil results in an empty TOC. >>>> >>>> I guess, I am looking for a way to automatically add >>>> #+begin_latex >>>> \addcontentsline{toc}{}{} >>>> #+end_latex >>>> to the exported document. >>>> >>>> Regards, >>>> Andreas >>> >>> Andreas, >>> >>> the problem is that setting num:nil tells org to use the second form of >>> sectioning, as specified in org-latex-classes. The unnumbered section >>> headings do not generate TOC information so no TOC is available. It's a >>> latex issue, not org. >>> >>> 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. >> > > Instead of adding toc entries, you can use latex to delete section > numbers: > > #+LATEX_HEADER: \setcounter{secnumdepth}{0} > > * foo > This is foo. > > ** subfoo1 > This is foo.1 > ** subfoo2 > This is foo.2 > > * bar > This is bar. > > The problem might be that the sections are not numbered in the TOC > either. But if you don't care about that, this is certainly simpler > than adding toc entries by hand. Thanks for that! That is really cool and having the entries in the TOC un-numbered is exactly what I want! As a follow-up, it would be nice if I could mix that now again with num:1. That way I could add a TOC with depth 1 (only sections) and have them un-numbered. But num:1 add its own '\setcounter{secnumdepth}{1}' (why?) which by default comes later than than the #+LATEX_HEADER definition: --8<---------------cut here---------------start------------->8--- #+OPTIONS: num:1 #+LATEX_HEADER: \setcounter{secnumdepth}{0} * foo This is foo. ** subfoo1 This is foo.1 ** subfoo2 This is foo.2 * bar This is bar. --8<---------------cut here---------------end--------------->8--- Regards, Andreas