emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Toby Cubitt <tsc25@cantab.net>
To: emacs-orgmode@gnu.org
Subject: Re: [dev] Implement "ref" link types
Date: Sun, 19 Feb 2012 21:11:10 +0100	[thread overview]
Message-ID: <20120219201110.GA24742@c3po.home> (raw)
In-Reply-To: <87r4xqvcee.fsf@gmail.com>

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

  reply	other threads:[~2012-02-19 20:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 18:08 [dev] Implement "ref" link types Nicolas Goaziou
2012-02-19 19:28 ` Christian Moe
2012-02-19 19:41   ` Nicolas Goaziou
2012-02-19 20:11     ` Toby Cubitt [this message]
2012-02-19 20:20     ` Christian Moe
2012-02-19 19:41 ` Samuel Wales
2012-02-19 20:02   ` Nicolas Goaziou
2012-02-19 20:48     ` Samuel Wales
2012-02-19 20:10 ` Carsten Dominik
2012-02-20  0:51   ` Nicolas Goaziou
2012-02-20  7:09     ` Carsten Dominik
2012-02-20 10:59       ` Nicolas Goaziou
2012-02-20 22:06         ` Nicolas Goaziou
2012-02-21  1:26           ` Thomas S. Dye
2012-02-21  5:14           ` David Maus
2012-02-21  9:18             ` Nicolas Goaziou
2012-02-27 19:38               ` Nicolas Goaziou
2012-02-27 20:38               ` David Maus
2012-03-05  9:37         ` Jambunathan K

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=20120219201110.GA24742@c3po.home \
    --to=tsc25@cantab.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=toby-dated-1330891920.aa504e@dr-qubit.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).