From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: table of contents and numbers Date: Thu, 12 Apr 2012 10:30:28 -0400 Message-ID: <13040.1334241028@alphaville> References: <4F85ADBE.6000602@hafro.is> <4735.1334164345@alphaville> <4F86A7C7.60607@hafro.is> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIL2l-0003rV-M4 for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 10:30:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIL2f-0006cf-19 for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 10:30:39 -0400 Received: from g4t0015.houston.hp.com ([15.201.24.18]:40326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIL2e-0006c6-Nt for emacs-orgmode@gnu.org; Thu, 12 Apr 2012 10:30:32 -0400 In-Reply-To: Message from Julian Burgos of "Thu\, 12 Apr 2012 10\:00\:39 -0000." <4F86A7C7.60607@hafro.is> 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: Julian Burgos Cc: Org Mode Mailing List 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? >=20 You could do that, but you could also use John's idea below to add \addcontentsline after each heading in the org file. Nick > 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 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 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 >=20 > --=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 >=20 >=20