[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [patch, ox] Unnumbered headlines

From: Rasmus
Subject: Re: [O] [patch, ox] Unnumbered headlines
Date: Tue, 23 Sep 2014 02:35:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)


Another couple of small changes.

Random observation: the patch is "almost" neutral due to the
headline-id function:

        88 insertions(+), 72 deletions(-)

Nicolas Goaziou <address@hidden> writes:

> I think it would be nice to keep "sec-NUM", with NUM matching current
> numbering, for numbered headlines. I'm not against a simple global
> counter for unnumbered headlines:
>   \label{sec-1}
>   \label{unnumbered-1}
>   \label{sec-2}
>   \label{unnumbered-2}
> or in the following example
>   * H1
>   ** H2
>      :UNNUMBERED: t
>      :END:
>   *** H3
>   *** H4
>   * H5
>   ** H6
> the labelling scheme
>  \label{sec-1}
>  \label{unnumbered-1}
>  \label{unnumbered-2}
>  \label{unnumbered-3}
>  \label{sec-2}
>  \label{sec-2-1}

Using this file:

    * h1
    :CUSTOM_ID: h1
    ** h2
    :unnumbered: t
    :CUSTOM_ID: h2
    *** h3
    *** h4
    * h5
    :CUSTOM_ID: h5
    [[*h1]] [[#h2]] [[*h4]] [[#h5]]
    ** h6

The output is now

    \ref{sec-1} \hyperref[unnumbered-1]{h2} \hyperref[unnumbered-3]{h4} 

Which I think is quite good.

I don't know if the global unnumbered counter is made in the best way.
I add another plist to info with the number.  This approach is cleaner
than before since it's the numbering of unnumbered headlines is not in
`org-export--collect-headline-numbering' which is complicated enough
as it is.

An alternative approach could be to just "count" the unnumbered
headlines place in the tree every time.

> Actually, there was a small bug in the code, now fixed. `latex' back-end
> is expected to use "hyperref" when headline in unnumbered.

Right I see.  The attached patch should merge against master.

>> To be clear: you are happy if it uses the \hyperref[·]{·} in LaTeX,
>> but not \ref{·} for unnumbered?
> You are the LaTeX expert. Isn't it reasonable?

It seems to work well, yes.

So I guess we should let the patch hang for a while and see if someone
cares to test it.  

Of course I'd appreciate more comments/bug reports.

Should I write tests for the new behavior?  If so, tests for each
backend or only for vanilla-ox functions?


If you can mix business and politics wonderful things can happen!

Attachment: 0001-ox-Support-unnumbered-headlines-via-property.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]