emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: "Albert Z. Wang" <azw@eml.cc>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Export: Override headline numbering via properties
Date: Thu, 23 May 2013 21:03:27 +0200	[thread overview]
Message-ID: <8761y98qo0.fsf@gmail.com> (raw)
In-Reply-To: <87wqqywawa.fsf@gmail.com> (Albert Z. Wang's message of "Thu, 16 May 2013 23:19:49 -0400")

Hello,

Thanks for your patch.

> An alternative would be to stick this into ox-latex.el, which then
> wouldn't interfere with other backends.
>
> I also think this functionality is good to have, since longer latex
> documents often have unnumbered sections (and there seem to be
> periodic questions on various boards on how to achieve this).  While
> one can mess around with the latex code, it's often a hassle when the
> "master" document is in org and you need to recompile often.
>
> For a recent project I needed a super-simple way to turn off numbering
> (for intro and references), so based on the above I made the following
> tiny modification to ox-latex.el, which looks up the "LATEX_NUMBERED"
> property to decide whether to insert a numbered or unnumbered heading.
> Since I didn't need it, inheritance isn't in here, but it should be
> simple enough to add.
>
> Since this wouldn't interfere with any other backends, perhaps there
> will be fewer reservations about merging something like this into the
> repo?

If it has to be implemented, I think that's the most reasonable solution
for now. For other back-ends, manual numbering specifications are just
too vague to lead to useful code.

> --
> diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
> index 41cf1d0..33a39c7 100644
> --- a/lisp/ox-latex.el
> +++ b/lisp/ox-latex.el
> @@ -1369,7 +1369,11 @@ holding contextual information."
>    (unless (org-element-property :footnote-section-p headline)
>      (let* ((class (plist-get info :latex-class))
>            (level (org-export-get-relative-level headline info))
> -          (numberedp (org-export-numbered-headline-p headline info))
> +          (latex-numbered (org-export-get-node-property :LATEX_NUMBERED headline))
> +          (numberedp
> +           (cond ((equal latex-numbered "n") nil)
> +                 ((equal latex-numbered "y") t)
> +                 (t (org-export-numbered-headline-p headline info))))

I'd rather have "nil", anything but "nil" and property not set.

It also needs proper documentation in org.texi.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2013-05-23 19:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13  3:07 [PATCH] Export: Override headline numbering via properties Mark Edgington
2013-05-13  6:18 ` Nicolas Goaziou
2013-05-13  9:42   ` Mark Edgington
2013-05-13 10:54     ` Nicolas Goaziou
2013-05-14  4:39       ` Mark Edgington
2013-05-17  3:19         ` Albert Z. Wang
2013-05-23 19:03           ` Nicolas Goaziou [this message]
2013-05-13 10:11   ` Mark Edgington
     [not found] ` <CAJcAo8u+pAqwuPtRDpDaLc7QE_1BvR7MXchgZRQDLRAv_iQ2Wg@mail.gmail.com>
2013-05-13 10:08   ` Mark Edgington

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=8761y98qo0.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=azw@eml.cc \
    --cc=emacs-orgmode@gnu.org \
    /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).