From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [patch, ox] Unnumbered headlines Date: Sun, 21 Sep 2014 22:13:46 +0200 Message-ID: <87tx4020lh.fsf@gmx.us> References: <87lhqzyubg.fsf@gmx.us> <87bnrrp0tb.fsf@nicolasgoaziou.fr> <87r40n6nrg.fsf@gmx.us> <87egwmaxte.fsf@nicolasgoaziou.fr> <87k34y701i.fsf@gmx.us> <87fvfl86ct.fsf@nicolasgoaziou.fr> <87k34xghtt.fsf@gmx.us> <87ppeon4mw.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVnWZ-0004tN-Tt for emacs-orgmode@gnu.org; Sun, 21 Sep 2014 16:14:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVnWT-0005lw-MW for emacs-orgmode@gnu.org; Sun, 21 Sep 2014 16:14:23 -0400 Received: from plane.gmane.org ([80.91.229.3]:48696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVnWT-0005ld-GI for emacs-orgmode@gnu.org; Sun, 21 Sep 2014 16:14:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XVnWM-0005p9-Qp for emacs-orgmode@gnu.org; Sun, 21 Sep 2014 22:14:10 +0200 Received: from 109.201.154.159 ([109.201.154.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Sep 2014 22:14:10 +0200 Received: from rasmus by 109.201.154.159 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Sep 2014 22:14:10 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Nicolas, Thanks for the comments. Nicolas Goaziou writes: >> Okay, I returned to my first hack (which never made it to this list). >> Basically, I ID everything. Unnumbered sections get the id >> "unnumbered-sec-COUNTER" and numbered sections get the id >> "sec-COUNTER". >> >> Perhaps you will find it too much of a hack. > > I don't think it is a hack. I am just pointing out that how we refer > internally to headlines has an effect on output clarity. I let you > strike a balance between clarity and easiness of implementation. Note > that the internal reference can be a bit cryptic (e.g. num-1-1 and > nonum-2). With the last patch it gets weird when you have mixed trees, like this: * numbered ** unnumbered :PROPERTIES: :UNNUMBERED: t :END: The LaTeX output is: \section{numbered} \label{sec-1} \subsection*{unnumbered} \label{unnumbered-sec-0-1} Perhaps it would be nicer to use a single counter rather than two? Right now, this * numbered1 * unnumbered2 :PROPERTIES: :UNNUMBERED: t :END: * numbered2 * unnumbered2 :PROPERTIES: :UNNUMBERED: t :END: produces \section{numbered1} \label{sec-1} \section*{unnumbered2} \label{unnumbered-sec-1} \section{numbered2} \label{sec-2} \section*{unnumbered2} \label{unnumbered-sec-2} But perhaps this is nicer? \label{sec-1} \label{unnumbered-sec-2} \label{sec-3} \label{unnumbered-sec-4} In particular for mixed, nested trees. >>> At the moment, referring to an unnumbered section displays its name. >> >> In some modes, yes. In LaTeX it produces a \ref{·} that LaTeX will >> laugh at. > > This is incorrect. > > #+options: num:nil > > * Headline > :PROPERTIES: > :CUSTOM_ID: test > :END: > This is a link to [[#test]]. > > will produce > > \section*{Headline} > \label{sec-1} > This is a link to \hyperref[sec-1]{Headline}. Is *my statement* incorrect or is the current *output* incorrect? On my PC, when I refer to an unnumbered headline I get \ref{UNNUMBERED}, but since it's after a \section* it will produce nothing or a subsequent element. But I *did* forget to try the patch with emacs -q and maybe that's why I'm not seeing \hyperref's. . . >> If you have a better idea than using the title I'm all ears! > > On the contrary, using the title is what is usually done. I'm all for > it. To be clear: you are happy if it uses the \hyperref[·]{·} in LaTeX, but not \ref{·} for unnumbered? >>> Comparing symbols with `equal' is a sin beyond redemption. Use `eq'. >> >> Why, out of curiosity? I though equal was like the meaner, tougher >> eq, that gets shit right, but is a bit more expensive. > > This is about using the right tool for the job. Unless you mess with the > obarray, two symbols with the same name are guaranteed to be `eq'. > There's really no reason to use anything else. OK. Thanks, Rasmus -- And I faced endless streams of vendor-approved Ikea furniture. . .