[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] Export: Override headline numbering via properties
From: |
Nicolas Goaziou |
Subject: |
Re: [O] [PATCH] Export: Override headline numbering via properties |
Date: |
Thu, 23 May 2013 21:03:27 +0200 |
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
Re: [O] [PATCH] Export: Override headline numbering via properties, Mark Edgington, 2013/05/13
Message not available