emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Sebastien Vauban <sva-news@mygooglest.com>, emacs-orgmode@gnu.org
Subject: Re: [BUG] New exporter exports TOC twice
Date: Thu, 2 May 2013 05:22:17 +0200	[thread overview]
Message-ID: <6A0787CB-28B9-4B2C-BFDB-183DEA34D28B@gmail.com> (raw)
In-Reply-To: <87r4hqic9s.fsf@gmail.com>

Hi Nicolas,

On 2.5.2013, at 00:08, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>>> The problem is that #+TOC cannot be a strict equivalent to
>>> `org-export-with-toc', since the former cannot be introduced in the
>>> document template.
>> 
>> I am not sure I understand.  What do you mean?
> 
> A TOC keyword belongs to the contents of the document. On the other
> hand, :with-toc is handled in a "template" function, which has access to
> both the contents and the meta-data around it. Therefore, :with-toc can
> insert a table of contents in more places than TOC.
> 
> For example, in latex back-end, TOC cannot insert a \tableofcontents
> before \begin{document}, but toc:t can. Of course, this example doesn't
> make sense as per LaTeX syntax, but it is possible that some other
> back-end wants to allow this.

OK.

> 
>>> Also, this change would require each user back-end developer to check
>>> for the presence of a TOC keyword with "headlines" value in the parse
>>> tree when handling :with-toc property. This is not complicated, but
>>> there are already many uncomplicated issues to think about when writing
>>> a back-end.
>> 
>> An alternative would be that the parser already makes this change.  Upon
>> finding #+TOC, it would change the OPTION value in the parse tree.
> 
> The parser doesn't handle the OPTION keyword (it's just another
> keyword), and neither should it (export options mustn't influence how
> the parsing is done).
> 
> It belongs to the export framework to read export options and handle
> them. Upon reading the with-toc value, it is indeed possible to check
> for the presence of a TOC keyword in the parse tree.
> 
> However, in this case, I don't see the need to go out of our way just to
> interpret differently what the user specified. Getting two tables of
> contents is not surprising when you understand that "toc:t" and "#+TOC:
> headlines" are independent ways of requesting a table of contents.


This is clear enough.  I have pushed a fix to the manual which should
make this clearer.

Regards

- Carsten

      reply	other threads:[~2013-05-02  3:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 11:13 [BUG] New exporter exports TOC twice Thorsten Jolitz
2013-04-24 11:50 ` Nicolas Goaziou
2013-04-24 11:56   ` Thorsten Jolitz
2013-04-24 12:11     ` Nicolas Goaziou
2013-04-27  8:44   ` Carsten Dominik
2013-04-27  8:52     ` Sebastien Vauban
2013-04-27 11:14       ` Carsten Dominik
2013-04-27 14:15         ` Sebastien Vauban
2013-04-28  7:28         ` Nicolas Goaziou
2013-05-01 20:45           ` Carsten Dominik
2013-05-01 22:08             ` Nicolas Goaziou
2013-05-02  3:22               ` Carsten Dominik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6A0787CB-28B9-4B2C-BFDB-183DEA34D28B@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    --cc=sva-news@mygooglest.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).