From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Include TOC in PDF export? Date: Fri, 02 Mar 2012 18:39:57 -0500 Message-ID: <8814.1330731597@alphaville> References: <1330727564.64930.YahooMailNeo@web161903.mail.bf1.yahoo.com> <8315.1330730515@alphaville> 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]:50314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3c5G-0007hy-2G for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 18:40:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3c4v-00067u-V5 for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 18:40:21 -0500 Received: from g4t0017.houston.hp.com ([15.201.24.20]:32721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3c4v-00066o-O0 for emacs-orgmode@gnu.org; Fri, 02 Mar 2012 18:40:01 -0500 In-Reply-To: Message from Nick Dokos of "Fri\, 02 Mar 2012 18\:21\:55 EST." <8315.1330730515@alphaville> 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: Michael Hannon , Org-Mode List Cc: nicholas.dokos@hp.com Nick Dokos wrote: > Michael Hannon wrote: >=20 > > Greetings.=C2=A0 I'm exporting a document to both HTML and PDF.=C2=A0 I= n the > > HTML version, I get a table of contents.=C2=A0 In the PDF version, I do= NOT > > get a table of contents.=C2=A0 The appended text illustrates the proble= m.=C2=A0 > > I'd like to get the TOC in both. > >=20 >=20 > num:nil causes unnumbered sections in latex (\section*{...}) which are > not entered into the .toc file (that's a latex limitation, not an > org-mode one), so the latex exporter wants both num: and toc: to be > enabled before it produces a table of contents. >=20 > I think the only way to get a TOC is to set num:t. You can probably > rewrite a chunk of latex code so that unnumbered sections etc end up in > the .toc file, but I think it would be a fairly major undertaking. >=20 There is a trick (I found it in the titlesec doc) that allows you to get unnumbered sections without using the \section* forms: --8<---------------cut here---------------start------------->8--- #+TITLE: #+OPTIONS: num:t ^:{} toc:5 #+LaTeX_HEADER: \setcounter{secnumdepth}{0} --8<---------------cut here---------------end--------------->8--- Since num: is t, the latex exporter will produce a TOC and the \setcounter will suppress section numbers. Unfortunately, that won't work with HTML though: the sections will be numbered (unless some other trick can be found there - maybe some CSS magic, although I wouldn't know where to start with= =20 that). Nick