From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/3738 Path: news.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: EPUB toc for whole book? Date: Sat, 28 Apr 2012 08:03:16 -0700 Message-ID: <20120428150316.GA405@protagoras.phil.berkeley.edu> References: <6465376.92.1335560944887.JavaMail.geo-discussion-forums@ynfi5> <4232951.768.1335608514852.JavaMail.geo-discussion-forums@vbbgl4> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1335625401 32058 80.91.229.3 (28 Apr 2012 15:03:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 Apr 2012 15:03:21 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncCO38oIeaEBC3jfD8BBoELfI4xw-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Apr 28 17:03:21 2012 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yw0-f58.google.com ([209.85.213.58]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SO9BA-0007MG-CP for gtp-pandoc-discuss@m.gmane.org; Sat, 28 Apr 2012 17:03:20 +0200 Original-Received: by yhfs35 with SMTP id s35sf1697957yhf.3 for ; Sat, 28 Apr 2012 08:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:date:from:to:subject:message-id:references :mime-version:in-reply-to:x-pgp-key:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type:content-disposition; bh=vNcLjGgcspRWnir+bv8iEmmZO15wX4f76f4FHeYea1k=; b=y4Mnx6pa3YNrk9fIWoBmLgxieJn6q80eN3bZ+efLpIiJHybuapt8+YdHcadxBUnx13 5n19fy5NY5cS3rRg80GKe/lQzFU89lH3B22usil8PT3i8fRSJm7hGe//iSco7X8tb44A dVW11jQlr3xmIxRua8YlHQjQIIBseTO3xVIQs= Original-Received: by 10.68.219.35 with SMTP id pl3mr702131pbc.15.1335625399328; Sat, 28 Apr 2012 08:03:19 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.68.242.40 with SMTP id wn8ls6933468pbc.1.gmail; Sat, 28 Apr 2012 08:03:18 -0700 (PDT) Original-Received: by 10.68.213.106 with SMTP id nr10mr12104055pbc.2.1335625398852; Sat, 28 Apr 2012 08:03:18 -0700 (PDT) Original-Received: by 10.68.213.106 with SMTP id nr10mr12104054pbc.2.1335625398841; Sat, 28 Apr 2012 08:03:18 -0700 (PDT) Original-Received: from cm06fe.IST.Berkeley.EDU (cm06fe.IST.Berkeley.EDU. [169.229.218.147]) by gmr-mx.google.com with ESMTPS id g5si5656235pbk.2.2012.04.28.08.03.18 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 Apr 2012 08:03:18 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 169.229.218.147 as permitted sender) client-ip=169.229.218.147; Original-Received: from protagoras.phil.berkeley.edu ([128.32.137.142]) by cm06fe.ist.berkeley.edu with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (auth plain:jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org) (envelope-from ) id 1SO9B6-0005Zl-MP for pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; Sat, 28 Apr 2012 08:03:18 -0700 Original-Received: by protagoras.phil.berkeley.edu (Postfix, from userid 1000) id B8B1323126; Sat, 28 Apr 2012 08:03:16 -0700 (PDT) In-Reply-To: <4232951.768.1335608514852.JavaMail.geo-discussion-forums@vbbgl4> X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.20 (2009-06-14) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 169.229.218.147 as permitted sender) smtp.mail=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Subscribe: , List-Unsubscribe: , Content-Disposition: inline Xref: news.gmane.org gmane.text.pandoc:3738 Archived-At: +++ niczero [Apr 28 12 03:21 ]: > Hi David, > I just joined this group for the very purpose of reporting that > internal links between chapters don't work > (in .epub). I haven't yet homed-in on why, but any internal links in > one chapter > ("see [Chapter 2](#ch2)") just get left as they are, so my .epub > contains original fragments of md > where the links should be. I tried moving the anchor away from the > heading, so the .md has > " > # Chapter 2 > . > " > but that didn't help. I'm now busy hunting for a workaround because > each chapter is littered with > references to other chapters, there are 108 chapters, and having > hyperlinking working is a big > part of why I'm building the ebook. Internal links between chapters do work in pandoc 1.9.2 -- but maybe not in the way you expect. You need to create the links using the implicit identifiers described in . So, to link to # Chapter 2 what you want is See [Chapter 2](#chapter-2) Try that. The reason the raw HTML anchors don't work is that the epub gets split over several different files. > By the way, all my chapter headings appear in the book's toc, but they > didn't originally. In my > first draft some of my headings were non-unique. When I fixed that, > the toc appeared. Are you > getting anything at all? Originally I had just two entries, the title > page and one 'chapter' for the > entire book. > When I say 'toc', I mean what I see when I click on 'contents' in the > calibre ebook reader; it > doesn't appear within the body of the book. Here's how pandoc currently handles these things. Your document is divided into chapters by level-1 headers. If you only have one level-1 header, you'll only get one chapter. Your epub reader will have a master table of contents showing these chapters. This is independent of whether you use --toc on the command line. If you use --toc, you'll *also* get a table of contents for each chapter, at the beginning of that chapter. It may be possible to change things so that the master table of contents shows all the sections and subsections; I can look into that if people are interested. (It would be helpful if someone gave me an example of an epub that worked that way, so I can see how it's done.) John