From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toby Cubitt Subject: Re: [dev] Implement "ref" link types Date: Sun, 19 Feb 2012 21:11:10 +0100 Message-ID: <20120219201110.GA24742@c3po.home> References: <87r4xqvcee.fsf@gmail.com> Reply-To: Toby Cubitt Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzD75-0002Ok-84 for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 15:12:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzD74-0000F7-01 for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 15:12:03 -0500 Received: from sanddollar.geekisp.com ([216.168.135.167]:43546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzD73-0000F1-TK for emacs-orgmode@gnu.org; Sun, 19 Feb 2012 15:12:01 -0500 Content-Disposition: inline In-Reply-To: <87r4xqvcee.fsf@gmail.com> 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 On Sun, Feb 19, 2012 at 08:41:45PM +0100, Nicolas Goaziou wrote: > > Suggestion: On export, how about enabling automatic element > > descriptions for references following the type:name convention, so > > that e.g. just > > > > : in [[ref:tab:numbers]] we can see... > > > > would expand to > > > > in Table 2 we can see... > > > > If implemented, this should be user-customizable e.g. through an alist > > like > > > > (("fig" . "Figure") ("tab" . "Table") ("map" . "Map")) > > That's another possibility, but I'd rather follow LaTeX usage. I think > it gives user more latitude in the end. Indeed, You don't have to think > about a name prefix ; you can also have constructs like "Tables > [[ref:table1]], [[ref:table2]] and [[ref:table3]]" for "Tables 1, 2 and > 3", etc. > > Note that the behaviour you suggest can easily be implemented using > filters in the new exporter. Note that for LaTeX export, there's no need to explicitly add names to references -- LaTeX can figure them out for itself from the label alone, with a little of help. There are various CTAN packages implementing this, such as cleveref, hyperref's \autoref command, varioref's \labelformat command... Cleveref is arguably the most powerful of these, as you can just chuck references into a \cref command (which replaces \ref): \cref{figure1,table1,table3,table2}, and it sorts them all out for you, to produce "Figure~1, and Tables~1 to~3". (Disclaimer: I'm the author of cleveref.) Toby -- Dr T. S. Cubitt Mathematics and Quantum Information group Department of Mathematics Complutense University Madrid, Spain email: tsc25@cantab.net web: www.dr-qubit.org