emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: emacs-orgmode list <emacs-orgmode@gnu.org>
Subject: Re: #+LABEL: in HTML export
Date: Mon, 29 Mar 2010 14:20:54 +0200	[thread overview]
Message-ID: <EFFF7165-7182-4B38-8379-B1B00609A29A@gmail.com> (raw)
In-Reply-To: <BC29E586-0FBA-44F5-8818-1190E8CA8E56@tsdye.com>

Hi Thomas,

Are you talking about figures or about tables?

For figures, the label is attached to the figure as the id of
the div surrounding figure plus caption.  However, this only
works if you also specify a caption.  But I think that only
figures with caption should be targets for links.

For tables, I have just made a change so that the label
is inserted as an anchor just as you propose:

    <table border="2" cellspacing="0" cellpadding="6" rules="groups"  
frame="hsides">
    <a name="tab:yyy" id="tab:yyy"></a>
    <caption>This is a table</caption>

Finally, I am now converting \ref{xxx} macros into links
for the HTML backend.  One problem is that, so the same
\ref macro will lead to the figure in both backends.

Hope this helps.

- Carsten




On Mar 28, 2010, at 10:29 PM, Thomas S. Dye wrote:

> Aloha all,
>
> I am working to create a single org-mode file that exports (almost)  
> identically to HTML and LaTeX.  I haven't found a way to do this for  
> cross-references to figures.

Here you talk about figures

>  I'm wondering if it would be difficult to change the behavior of  
> the LaTeX exporter to recognize and appropriately export the  
> argument to #+LABEL:?
>
> This line above an org-mode table:
>
> #+LABEL: tab:xrf
>
> is correctly and usefully exported to LaTeX as:
>
> \label{tab:xrf}
>
> A link in the org-mode file like this:
>
>  [[tab:xrf][(table 2)]]
>
> behaves as expected in the pdf file compiled from the LaTeX export.   
> In situations where it is not difficult to live without LaTeX's  
> cross-referencing facility, this is great.  (I know that it is  
> possible to put \ref{tab:xrf} in the org-mode file and that this  
> works beautifully in the LaTeX export, but it does nothing in the  
> HTML export.)
>
> The #+LABEL: tab:xrf doesn't appear in HTML export from the same org- 
> mode file.  If it could appear there, perhaps like this:
>
> <a name="tab:xrf" id="tab:xrf"></a>
>
> then one org-mode file would correctly export these cross-references  
> to both LaTeX and HTML.
>
> All the best,
> Tom
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

  reply	other threads:[~2010-03-29 12:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28 20:29 #+LABEL: in HTML export Thomas S. Dye
2010-03-29 12:20 ` Carsten Dominik [this message]
2010-04-02 22:51   ` Baoqiu Cui
2010-04-03  6:33     ` Carsten Dominik
2010-04-03  7:15       ` Baoqiu Cui
2010-04-03  9:23         ` Carsten Dominik
2010-04-03 16:46           ` Baoqiu Cui
2010-04-04  6:53             ` Carsten Dominik

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=EFFF7165-7182-4B38-8379-B1B00609A29A@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /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).