From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julian Burgos Subject: Re: table of contents and numbers Date: Thu, 12 Apr 2012 10:00:39 +0000 Message-ID: <4F86A7C7.60607@hafro.is> References: <4F85ADBE.6000602@hafro.is> <4735.1334164345@alphaville> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIGpi-0003RV-7R for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 06:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIGpf-000557-4B for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 06:00:53 -0400 Received: from hafgarpur.hafro.is ([130.208.64.48]:47130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIGpe-00053G-NA for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 06:00:51 -0400 In-Reply-To: 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: John Hendy Cc: nicholas.dokos@hp.com, Org Mode Mailing List Thanks for the answer Nick. So to get a TOC without numbers I would=20 need to edit the TEX file directly, right? On mi=C3=B0 11.apr 2012 19:00, John Hendy wrote: > On Wed, Apr 11, 2012 at 12:12 PM, Nick Dokos wr= ote: >> 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 t= he >> \tableofcontents macro is expanded. When you specify num:nil asking fo= r >> 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 n= um >> 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 headlin= e. > > ----- > #+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 >> >> >> --=20 Julian Mariano Burgos, PhD Hafranns=C3=B3knastofnunin/Marine Research Institute Sk=C3=BAlagata 4, 121 Reykjav=C3=ADk, Iceland S=C3=ADmi/Telephone : +354-5752037 Br=C3=A9fs=C3=ADmi/Telefax: +354-5752001 Netfang/Email: julian@hafro.is