[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Feature request: "Figure #:" in labels of listings
From: |
Clément Pit--Claudel |
Subject: |
Re: [O] Feature request: "Figure #:" in labels of listings |
Date: |
Mon, 22 Aug 2016 16:48:52 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 2016-08-22 16:27, Nicolas Goaziou wrote:
> Done. Thank you.
Works great; thanks!
One small difficulty is that html export uses two separate counters for figures
and listings, while LaTeX export calls both figures, and uses a single counter.
This makes it tricky to reference figures in a way that works with both HTML
and LaTeX: for HTML one needs to write "Figure [[fig:a]] shows x, Listing
[[lst:b]] shows y" (which exports into "Figure 1 shows x, Listing 1 shows y",
while for LaTeX one needs to write "Figure [[fig:a]] shows x, Figure [[lst:a]]
shows y" (which exports into "Figure 1 shows x, Figure 2 shows y"). I don't
know of an easy way to achieve this.
Potential solutions:
* Using a single counter in HTML, and calling listings "Figure"s, as in LaTeX
* Using two counters in LaTeX as well, though this will require changes to
existing Org documents, which is not ideal.
* Introducing an org-mode equivalent of \autoref that would insert (and
hyperlink, which would be nice) "Figure", "Listing", "Section", … as
appropriate based on the link's target.
Clément.
signature.asc
Description: OpenPGP digital signature