From mboxrd@z Thu Jan 1 00:00:00 1970 From: coroa@online.de (Jonas =?utf-8?Q?H=C3=B6rsch?=) Subject: Re: table of contents and numbers Date: Thu, 12 Apr 2012 18:52:16 +0200 Message-ID: <87vcl428qn.fsf@gmail.com> References: <4F85ADBE.6000602@hafro.is> <4735.1334164345@alphaville> <4F86A7C7.60607@hafro.is> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SING7-0004CF-Ad for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 12:52:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SING1-0000ou-5c for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 12:52:34 -0400 Received: from plane.gmane.org ([80.91.229.3]:49069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SING0-0000oX-Uz for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 12:52:29 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SINFz-000523-I5 for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 18:52:27 +0200 Received: from dslb-178-008-208-204.pools.arcor-ip.net ([178.8.208.204]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Apr 2012 18:52:27 +0200 Received: from coroa by dslb-178-008-208-204.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Apr 2012 18:52:27 +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 On Thu, Apr 12 2012, Julian Burgos wrote: > Thanks for the answer Nick. So to get a TOC without numbers I would > need to edit the TEX file directly, right? > Hi there, another option might be to remove the num:nil org option and instead tell latex not to number any sections by setting secnumdepth to 0. so for instance ---start org file ----------- #+TITLE: Test #+OPTIONS: toc:t #+LATEX_HEADER: \setcounter{secnumdepth}{0} * Part 1 Some text * Part 2 Some more text ---end org file ----------- should do the trick. the only drawback is that one still needs the num:nil option for the other export formats. perhaps this could become another way to implement num:nil for the latex export in general. though i don't think it would work reliably for just a subtree then. Greets, Jonas > On miĆ° 11.apr 2012 19:00, John Hendy wrote: >> On Wed, Apr 11, 2012 at 12:12 PM, Nick Dokos wrote: >>> Julian Burgos wrote: >>> >>>> Dear list, >>>> >>>> My apologies for another very basic question. I'm wondering why I do >>>> not get a table of contents when exporting the following file as pdf >>>> >>>> ---start org file ----------- >>>> #+TITLE: Test >>>> #+OPTIONS: toc:t num:nil >>>> >>>> * Part 1 >>>> Some text >>>> >>>> * Part 2 >>>> Some more text >>>> ---end org file ----------- >>>> >>>> I do get the TOC when exporting as hmtl, though. >>>> >>> I believe it's because of a rather technical latex limitation: latex >>> writes TOC entries into a .toc file, which is then read back in when the >>> \tableofcontents macro is expanded. When you specify num:nil asking for >>> unnumbered sections, the latex exporter produces \section* markers, >>> instead of the standard \section markers. But when latex processes >>> those, it does not add anything to the .toc file. If org added a >>> \tableofcontents, you would get just the title and an empty TOC. In >>> order to prevent that, the latex exporter requires that both toc and num >>> be non-nil - see l.1487 ff in lisp/org-latex.el: >>> >>> ,---- >>> | ... >>> | ;; table of contents >>> | (when (and org-export-with-toc >>> | (plist-get opt-plist :section-numbers)) >>> | (funcall org-export-latex-format-toc-function >>> | ...)) >>> `---- >> One can work around this by manually adding sections under each headline. >> >> ----- >> #+options: num:nil toc:t >> >> #+text: \tableofcontents >> >> * Introduction >> \addcontentsline{toc}{section}{Introduction} >> ----- >> >> Tedious for long documents, but does work. >> >> >> John >> >>> The HTML exporter does this "by hand", so to speak, so it is not as >>> constrained and can do the "right" thing. >>> >>> Nick >>> >>> >>>