emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Cc: emacs-orgmode@gnu.org, Rasmus <rasmus@gmx.us>
Subject: Re: Target and link text normalised to `orgtargetn'
Date: Sun, 19 Apr 2015 14:57:09 +0200	[thread overview]
Message-ID: <87618smg2i.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <20150419121305.GZ14328@chitra.no-ip.org> (Suvayu Ali's message of "Sun, 19 Apr 2015 14:13:05 +0200")

Hello,

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Sorry, I don't think I quite understand.  AFAIU, targets like
> <<interesting>> have to be unique even inside the Org buffer for links
> like this to work: [[interesting][very cool]], regardless of export.  So
> then why rename them during export?

There's no guarantee that, e.g., \label{interesting} is a valid syntax.
Think about <<100%>> for LaTeX. Actually such links were broken for
non-ASCII characters before the patch.

Note that this is transparent for the user: if <<interesting>> becomes
\label{foo}, [[interesting][very cool]] automatically becomes
\hyperref[foo]{very cool}.

Your problem is different AFAIU. You are relying on the internal pattern
of generated labels, i.e., you are eating Org's dog food. I advise
against it.

If you need explicitly "\label{interesting}", ask Org to write it with,
e.g., "@@latex:\label{foo}@@" or even better

#+MACRO: lbl @@latex:\label{$1}@@

  {{{lbl(foo)}}}

> How does the above solve the issue?  I was not having problems with
> getting to export \label{foo}, my problem was what do I put as `foo'
> since in the exported TeX file foo was different.
>
> Hopefully I made myself clear, or I'm not misunderstanding something.

Again <<target>> are for [[target]], \label{...} are for
\whateverref{..}. IOW, you are mixing two different concepts. Since you
write "\secref{fig:1}" in your documents, you can also write
"\label{fig:1}" there.

Org can only ensures you that [[target]] always point to <<target>>. No
more, no less.

There is another data point to consider: internal label scheme must not
follow a simple pattern, as a user might use the same and introduce
a label collision. E.g., if <<foo>> becomes par:foo, the following
line is problematic:

  <<foo>> \label{par:foo} \ref{par:foo} [[foo]]

This is why I suggest to rever commit cf7d64f. It also introduces
a non-alphanumeric character ":", even though `org-export-get-reference'
uses only alphanumeric ones by portability concern (it is even specified
in its docstring).

Commit f1548e1 is different. I actually mostly agree with it (though
I was confused at first with the docstring change, which needs to be
fixed), but it breaks radio targets. It doesn't need to be reverted.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2015-04-19 12:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14  9:25 Target and link text normalised to `orgtargetn' Suvayu Ali
2015-04-14 12:08 ` Suvayu Ali
2015-04-14 12:59   ` Rasmus
2015-04-14 13:37     ` Andreas Leha
2015-04-15 22:57   ` Rasmus
2015-04-16  0:18     ` Suvayu Ali
2015-04-16 10:11       ` Rasmus
2015-04-18 21:53         ` Nicolas Goaziou
2015-04-19 12:13           ` Suvayu Ali
2015-04-19 12:57             ` Nicolas Goaziou [this message]
2015-04-19 13:24               ` Suvayu Ali
2015-04-19 13:40                 ` Nicolas Goaziou
2015-04-19 13:49                   ` Suvayu Ali
2015-04-19 13:56                     ` Nicolas Goaziou
2015-04-19 14:06                       ` Suvayu Ali
2015-04-19 14:02               ` Rasmus
2015-04-19 14:36                 ` Nicolas Goaziou
2015-04-19 14:55                   ` Rasmus
2015-04-19 15:17                     ` Nicolas Goaziou
2015-04-19 17:16                       ` Rasmus
2015-04-19 18:36                         ` Nicolas Goaziou
2015-04-20  8:55                           ` Rasmus
2015-04-20  9:09                             ` Nicolas Goaziou
2015-04-20  9:25                               ` Rasmus
2015-04-20  9:58                                 ` Nicolas Goaziou
2015-04-20 10:02                                   ` Rasmus
2015-04-20 10:33                                     ` Nicolas Goaziou
2015-04-20 13:13                                       ` Rasmus
2015-04-20 15:35                                         ` Nicolas Goaziou
2015-04-20 20:11                                           ` Rasmus
2015-04-20 21:03                                             ` Nicolas Goaziou
2015-04-24 13:35                                               ` Rasmus
2015-04-24 19:42                                                 ` Nicolas Goaziou
2015-04-27 22:08                                                   ` Rasmus
2015-04-27 22:15                                                     ` Nicolas Goaziou

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=87618smg2i.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=fatkasuvayu+linux@gmail.com \
    --cc=rasmus@gmx.us \
    /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).