emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Sebastien Vauban <sva-news@mygooglest.com>, emacs-orgmode@gnu.org
Subject: Re: [BUG] New exporter exports TOC twice
Date: Thu, 02 May 2013 00:08:31 +0200	[thread overview]
Message-ID: <87r4hqic9s.fsf@gmail.com> (raw)
In-Reply-To: <5CD564EE-729C-4C08-A1AC-572025EEFC7A@gmail.com> (Carsten Dominik's message of "Wed, 1 May 2013 22:45:43 +0200")

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.

>> 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.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2013-05-01 22:08 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 [this message]
2013-05-02  3:22               ` Carsten Dominik

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=87r4hqic9s.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --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).