From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Subject: Feature request: "Figure #:" in labels of listings Date: Fri, 12 Aug 2016 23:23:26 -0400 Message-ID: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OV4hq3v72ec6oRaEMjiPrmDBvAUjgKb2k" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYPXx-0003Mn-B2 for emacs-orgmode@gnu.org; Fri, 12 Aug 2016 23:23:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYPXt-0006gm-0A for emacs-orgmode@gnu.org; Fri, 12 Aug 2016 23:23:40 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:51844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYPXs-0006gh-Ls for emacs-orgmode@gnu.org; Fri, 12 Aug 2016 23:23:36 -0400 Received: from [18.189.49.49] ([18.189.49.49]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0LqZms-1b2uCz0DMA-00eJ8y for ; Sat, 13 Aug 2016 05:23:35 +0200 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" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OV4hq3v72ec6oRaEMjiPrmDBvAUjgKb2k Content-Type: multipart/mixed; boundary="erL7dQukPFAPok21xEfTahDjR7IIQ7qoR" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-orgmode@gnu.org Message-ID: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> Subject: Feature request: "Figure #:" in labels of listings --erL7dQukPFAPok21xEfTahDjR7IIQ7qoR Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This org file: #+CAPTION: Some C code #+NAME: fig:c #+BEGIN_SRC c int main() { return 0; } #+END_SRC See figure [[fig:c]]. produces HTML similar to this: =E2=80=A6
=E2=80=A6

See figure 1.

The link says "Figure (1)", but the figure label doesn't include the figu= re number. It would be great to have an option to include it! (or even to= always include it as is done for images, since it can be hidden from CSS= ). Thanks! Cl=C3=A9ment. (PS: btw, does anyone have tips for stepping through org-mode sources? Th= e `info` parameters are so large that they cause edebug to be very slow w= hen stepping around). --erL7dQukPFAPok21xEfTahDjR7IIQ7qoR-- --OV4hq3v72ec6oRaEMjiPrmDBvAUjgKb2k Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXrpKuAAoJEPqg+cTm90wjLlYQAKOpdc9hHzm1Aeuh0mky9mbF U4I2oDTK5Fl4b+o87tzF3tj44b7l5oc/esIRH86q/NtC1cBCC97yO5752wUnpVb7 CTSjGHCxgBE1Icbs0RRUhXs3wj7K2pbausa/ZgiSoEzIrcGNZJMfisFy+d7BVJNn TRto6Bk2fWAvTSVK+PtbrFGbFxdvbjG1+jETVhU0FU7a/SQqqYOBgxUhe3gmddR7 3I7bMiBhq+rSh6gXwmvxsV9vbdNj3GoBdhMMYI5tLgRc7LoFHsCEugHC8OU0jEii OGJl0N9Avd5jTHcyoRorTvB2QNHJWS9rpcNftgaSww8tIKmKYoNSzY+h0pjpWsGd Ez7ss4ulOm4ym4DUvz+1LfnALcJT5Whbb7e0hKisYEuvrddqj/iY0Rbk+5+Xj5St v3NZV15t2NdWhJ//9oIOt6q/bPE4wfSkCXtynYuxOQU7uj3k2HM9pv9LVjP41w6V yPygiJO+CmgnmI6AyuNZpzTNTB8jhkgCGna0aaA78V68CSve9HP6VMKPcjqullVG 6t7keXEwX3QUuEWOgqPLaZJ2nmGB0a/k2GHmwwGTUI/L5Dv+GmzkEBiSymR14qZq U1A7nxEBwlKqKtSR5GGNVKab8LEWgbV+naPN3KoYGkgmvZXcieDjHbZ+yzPnQ+jk DDd3reat5tSLrxRro+Zc =T2oz -----END PGP SIGNATURE----- --OV4hq3v72ec6oRaEMjiPrmDBvAUjgKb2k-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Feature request: "Figure #:" in labels of listings Date: Mon, 15 Aug 2016 17:43:31 +0200 Message-ID: <87bn0uujfg.fsf@saiph.selenimh> References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZK33-0002SO-2z for emacs-orgmode@gnu.org; Mon, 15 Aug 2016 11:43:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZK31-0006VF-8U for emacs-orgmode@gnu.org; Mon, 15 Aug 2016 11:43:32 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:37882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZK31-0006V3-2d for emacs-orgmode@gnu.org; Mon, 15 Aug 2016 11:43:31 -0400 In-Reply-To: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> (=?utf-8?Q?=22Cl=C3=A9ment?= Pit--Claudel"'s message of "Fri, 12 Aug 2016 23:23:26 -0400") 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" To: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel Cc: emacs-orgmode@gnu.org Hello, Cl=C3=A9ment Pit--Claudel writes: > This org file: > > #+CAPTION: Some C code > #+NAME: fig:c > #+BEGIN_SRC c > int main() { return 0; } > #+END_SRC > > See figure [[fig:c]]. > > produces HTML similar to this: > > =E2=80=A6 > >
=E2=80=A6
> > >

> See figure 1. >

> > The link says "Figure (1)", but the figure label doesn't include the > figure number. It would be great to have an option to include it! (or > even to always include it as is done for images, since it can be > hidden from CSS). I agreed we can add it unconditionally, using (org-html--translate "Listing %d:" info). What class do you suggest for the listing number, ""? If so, should `org-html-style-default' be mod= ified? Regards, --=20 Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Subject: Re: Feature request: "Figure #:" in labels of listings Date: Mon, 22 Aug 2016 09:33:42 -0400 Message-ID: References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t2LqdkgXMN6NQiU9ekkFXpmVoLdKHwdBm" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbpMZ-00044w-Rw for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 09:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbpMV-0008U1-M8 for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 09:34:02 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:54551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbpMV-0008TU-Cg for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 09:33:59 -0400 Received: from [18.189.127.88] ([18.189.127.88]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0M7VWZ-1bGQIV3gU3-00xLjb for ; Mon, 22 Aug 2016 15:33:57 +0200 In-Reply-To: <87bn0uujfg.fsf@saiph.selenimh> 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" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --t2LqdkgXMN6NQiU9ekkFXpmVoLdKHwdBm Content-Type: multipart/mixed; boundary="OsEqncOm8N7DTwlgjxv1635X2r0gaOe4O" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-orgmode@gnu.org Message-ID: Subject: Re: Feature request: "Figure #:" in labels of listings References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> In-Reply-To: <87bn0uujfg.fsf@saiph.selenimh> --OsEqncOm8N7DTwlgjxv1635X2r0gaOe4O Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-15 11:43, Nicolas Goaziou wrote: > Hello, > > [...] > > I agreed we can add it unconditionally, using (org-html--translate > "Listing %d:" info). Neat, thanks! > What class do you suggest for the listing number, " class=3D\"listing-number\">"?=20 Sounds good :)=20 > If so, should `org-html-style-default' be modified? Maybe? It currently doesn't mention the related "figure-number" class, so= it doesn't really need to mention "listing-number" class IMO; for backwa= rds compatibility, though, we could consider adding=20 .listing-number { display: none; } to it. I don't like this option too much, since it might create confusion= in the future (I'd wonder why such a default =E2=80=94 visible figure nu= mbers, but hidden listing numbers =E2=80=94 was chosen). It might be bett= er to add this snippet to the NEWS file if users want to revert to the ol= d behaviour.=20 Cheers, Cl=C3=A9ment. --OsEqncOm8N7DTwlgjxv1635X2r0gaOe4O-- --t2LqdkgXMN6NQiU9ekkFXpmVoLdKHwdBm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXuv9DAAoJEPqg+cTm90wjyMEP/0/Wq/oxCv3Xlb46OyIL31o9 dN/3rkan57LZQo20RBwhxzemtYrmdvCnwGvJ039l3fNNSNyJCjjNhe07v7RP/eSt yiNZgORnVrIGj+K5FnMU6EZ8mLoieKmOs04/ZFrd7Z2rtcKeAHfPtE6VCMmbxRI3 gqXS84CRC2G3q/MTOGtpi9lscCLVMsds0Dyc20aURaMTXQI4nTI7ru/WDgX7hhCY 4+LCWnokXfKGTrUMZ4HKWZdCDiPVOkGAJi5XMovf9FdcvGzAT1nKtGviLUhbKdmk lcdby3zV+PtQUosotCKaXfGr2a6rHaIX99raeZVwu730YwQWnVjEP5ln2XRN3ZEm Eqb1TWayNxsQoxODz8J7zV9C2XKaOGB1nwD3z62tafnZdyg0iOnFLTvepua/UEbi RjhConnWSnjvO5d/edDgw3THagoE/fNtrVYmPc7o2ivAeGO2o4iedmO5mKF0Glpu Y3p0StGZOr8iws/Aqic66uKhu4YHq2z/PsZ4+m0gHGNhswZHFqAYHAcDywkvNdHF jORkVLAocGyPtKyJldQW+npPhcfWIrxE500NSCuZWj+CXtGYXOJLkevlU6XeU3xK pE+HCTtqNm6kqA0Fvb9zlEBG1ero+91aOJoqjTeOPek0EwfXpzMgh8O/pe5Ace6s 9N5QVtb9G9Gg4gu5Td6H =9oJE -----END PGP SIGNATURE----- --t2LqdkgXMN6NQiU9ekkFXpmVoLdKHwdBm-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Feature request: "Figure #:" in labels of listings Date: Mon, 22 Aug 2016 22:27:42 +0200 Message-ID: <8737lwwnup.fsf@saiph.selenimh> References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbvpE-0007Qq-5v for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 16:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbvoy-0001eg-0M for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 16:28:03 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:46561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbvox-0001eM-Qj for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 16:27:47 -0400 In-Reply-To: (=?utf-8?Q?=22Cl=C3=A9ment?= Pit--Claudel"'s message of "Mon, 22 Aug 2016 09:33:42 -0400") 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" To: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel Cc: emacs-orgmode@gnu.org Hello, Cl=C3=A9ment Pit--Claudel writes: >> What class do you suggest for the listing number, "> class=3D\"listing-number\">"?=20 > > Sounds good :)=20 > >> If so, should `org-html-style-default' be modified? > > Maybe? It currently doesn't mention the related "figure-number" class, so= it doesn't really need to mention "listing-number" class IMO; for backward= s compatibility, though, we could consider adding=20 > > .listing-number { display: none; } > > to it. I don't like this option too much, since it might create > confusion in the future (I'd wonder why such a default =E2=80=94 visible > figure numbers, but hidden listing numbers =E2=80=94 was chosen). It migh= t be > better to add this snippet to the NEWS file if users want to revert to > the old behaviour. Done. Thank you. Regards, --=20 Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Subject: Re: Feature request: "Figure #:" in labels of listings Date: Mon, 22 Aug 2016 16:48:52 -0400 Message-ID: <2824f983-5494-371f-a969-bd1ea40b6810@gmail.com> References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> <8737lwwnup.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="v1PAgseLfxsMrWWrHBhgpIcBsQpXKHppT" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbw9X-0005NI-Nd for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 16:49:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbw9U-0005XQ-KN for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 16:49:03 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:50872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbw9U-0005XH-9c for emacs-orgmode@gnu.org; Mon, 22 Aug 2016 16:49:00 -0400 Received: from [18.189.127.88] ([18.189.127.88]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0M944P-1bRjOx3klh-00CTbT for ; Mon, 22 Aug 2016 22:48:59 +0200 In-Reply-To: <8737lwwnup.fsf@saiph.selenimh> 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" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --v1PAgseLfxsMrWWrHBhgpIcBsQpXKHppT Content-Type: multipart/mixed; boundary="7HpRBWGHSFO8B2D7tsmP5cHbCPtUl2sap" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-orgmode@gnu.org Message-ID: <2824f983-5494-371f-a969-bd1ea40b6810@gmail.com> Subject: Re: Feature request: "Figure #:" in labels of listings References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> <8737lwwnup.fsf@saiph.selenimh> In-Reply-To: <8737lwwnup.fsf@saiph.selenimh> --7HpRBWGHSFO8B2D7tsmP5cHbCPtUl2sap Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 f= igures and listings, while LaTeX export calls both figures, and uses a si= ngle counter. This makes it tricky to reference figures in a way that wor= ks 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 show= s 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 L= aTeX * Using two counters in LaTeX as well, though this will require changes t= o existing Org documents, which is not ideal. * Introducing an org-mode equivalent of \autoref that would insert (and h= yperlink, which would be nice) "Figure", "Listing", "Section", =E2=80=A6 = as appropriate based on the link's target. Cl=C3=A9ment. --7HpRBWGHSFO8B2D7tsmP5cHbCPtUl2sap-- --v1PAgseLfxsMrWWrHBhgpIcBsQpXKHppT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXu2U0AAoJEPqg+cTm90wjIT0QAK4rZGj3qpCE6SIcQZTIE1xO mfiyMty16o6DOuTcHkHZDiMjpm+aLsXNkeVlok+1q9J22H6EMxGJWVQkrV9Nt5Id 9deELFIANIcmRuPi61MaDSkV+UzATVOdV0iO2bIhtCVfnZqjvVzHbP5e340xq2m9 oBKv+tjdjqFi/f/EAzRHYTDM8kh7SWS6uUxAmbCcMZ+mm+dkHZhSm+CUi75VvxGo QJ0NlahQCQQJaMoQ3yQujhEOf/Fvpv1WWpmAH77ImApe5HS9WVsDCAKm2ac5aElH AnBnj80GpjKGnu2kSgU6RxK/nikrJ+EswGffTC2DL7XfQuOPyIop7ZolpFz4APNC omYWBHe2RARHu13+zv7qehbDa3LF5Rsta7NZXDGtJc+1B0hYJIZkMR+KjhL6Rj/E AdJSGTmG7GC6J1GNxcg3YHkUrjXTPlVkvpjOQ1uwgkIHJQ+97K4DY+1/5B4bjBIm G8NlGVysFNlRy7xDoD4beWmEmQLMPDyhezStN+Uj1015bwzu93kx2xRgG1a5qzob 1ymHFF8X9joNNA1d+bxT8JFOgwkry8BrLT6s2EJExSWk8ZvjeiKITEYX79CohLhN sYTz/2GccvYRtk+M89jY0OYy2cxUcYCacu0bYMtQTy2YEM0trcVPOPWCxfWwsltN cyf7t798qzMFlIvOtCSX =yLiL -----END PGP SIGNATURE----- --v1PAgseLfxsMrWWrHBhgpIcBsQpXKHppT-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Feature request: "Figure #:" in labels of listings Date: Wed, 24 Aug 2016 21:51:16 +0200 Message-ID: <87vayq0wuj.fsf@saiph.selenimh> References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> <8737lwwnup.fsf@saiph.selenimh> <2824f983-5494-371f-a969-bd1ea40b6810@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bceCq-0004zD-G2 for emacs-orgmode@gnu.org; Wed, 24 Aug 2016 15:51:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bceCm-0007cr-Bm for emacs-orgmode@gnu.org; Wed, 24 Aug 2016 15:51:23 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bceCm-0007cm-50 for emacs-orgmode@gnu.org; Wed, 24 Aug 2016 15:51:20 -0400 In-Reply-To: <2824f983-5494-371f-a969-bd1ea40b6810@gmail.com> (=?utf-8?Q?=22Cl=C3=A9ment?= Pit--Claudel"'s message of "Mon, 22 Aug 2016 16:48:52 -0400") 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" To: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel Cc: emacs-orgmode@gnu.org Hello, Cl=C3=A9ment Pit--Claudel writes: > 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 is not necessarily true. For example, when "listings" package is used, listings and floats get a different 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. You can use @@html:Listing@@@@latex:Figure@@ [[lst:a]], or with a macro #+macro: listing @@html:Listing@@@@latex:Figure@@ and {{{listing}}} [[lst:a]] > Potential solutions: > * Using a single counter in HTML, and calling listings "Figure"s, as in L= aTeX As stated above, this is not always correct. > * Using two counters in LaTeX as well, though this will require changes t= o existing Org documents, which is not ideal. Counters in "latex" back-end are handled on the LaTeX side, unlike to "html". > * Introducing an org-mode equivalent of \autoref that would insert > (and hyperlink, which would be nice) "Figure", "Listing", "Section", =E2= =80=A6 > as appropriate based on the link's target. I'm not sure about what you mean here, and to what export back-end it applies. In any case, I don't think there is a single satisfying solution. It really depends on one's needs. I guess we could introduce a variable to switch from one counting system to the other, if needed. Patches welcome. Regards, --=20 Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Subject: Re: Feature request: "Figure #:" in labels of listings Date: Wed, 24 Aug 2016 16:51:01 -0400 Message-ID: <3fce785b-e85a-992d-95a6-b5ad3b560e90@gmail.com> References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> <8737lwwnup.fsf@saiph.selenimh> <2824f983-5494-371f-a969-bd1ea40b6810@gmail.com> <87vayq0wuj.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iu6NDqf1buB0UXm4Kpd4fiPiHQmUwqedQ" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcf8r-00070m-On for emacs-orgmode@gnu.org; Wed, 24 Aug 2016 16:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcf8m-0006Jh-PO for emacs-orgmode@gnu.org; Wed, 24 Aug 2016 16:51:20 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:61032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcf8m-0006Jb-Ej for emacs-orgmode@gnu.org; Wed, 24 Aug 2016 16:51:16 -0400 Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MJnBU-1bbZDC2noq-0016Cq for ; Wed, 24 Aug 2016 22:51:14 +0200 In-Reply-To: <87vayq0wuj.fsf@saiph.selenimh> 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" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iu6NDqf1buB0UXm4Kpd4fiPiHQmUwqedQ Content-Type: multipart/mixed; boundary="bbjBMEft55Jav0xXj9cqdMVC2RPgGC4uD" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-orgmode@gnu.org Message-ID: <3fce785b-e85a-992d-95a6-b5ad3b560e90@gmail.com> Subject: Re: Feature request: "Figure #:" in labels of listings References: <092e6a31-51b1-8bb8-d8bc-3e1da66764da@gmail.com> <87bn0uujfg.fsf@saiph.selenimh> <8737lwwnup.fsf@saiph.selenimh> <2824f983-5494-371f-a969-bd1ea40b6810@gmail.com> <87vayq0wuj.fsf@saiph.selenimh> In-Reply-To: <87vayq0wuj.fsf@saiph.selenimh> --bbjBMEft55Jav0xXj9cqdMVC2RPgGC4uD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-24 15:51, Nicolas Goaziou wrote: > Hello, >=20 > Cl=C3=A9ment Pit--Claudel writes: >=20 >> 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. >=20 > This is not necessarily true. For example, when "listings" package is > used, listings and floats get a different counter. Ah, I see; thanks for pointing this out! >> 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. >=20 > You can use @@html:Listing@@@@latex:Figure@@ [[lst:a]], or with a macro= >=20 > #+macro: listing @@html:Listing@@@@latex:Figure@@ >=20 > and >=20 > {{{listing}}} [[lst:a]] Thanks! That's a convenient workaround. Macros names are not case-sensiti= ve, right? (so having to macros {{{listing}}} and {{{Listing}}} won't do)= >> Potential solutions: >> * Using a single counter in HTML, and calling listings "Figure"s, as i= n LaTeX >=20 > As stated above, this is not always correct. Thanks; I missed that part. >> * Using two counters in LaTeX as well, though this will require change= s to existing Org documents, which is not ideal. >=20 > Counters in "latex" back-end are handled on the LaTeX side, unlike to > "html". Got it. > In any case, I don't think there is a single satisfying solution. It > really depends on one's needs. I guess we could introduce a variable to= > switch from one counting system to the other, if needed. Patches > welcome. Thanks for the clear and comprehensive answer! Cl=C3=A9ment. --bbjBMEft55Jav0xXj9cqdMVC2RPgGC4uD-- --iu6NDqf1buB0UXm4Kpd4fiPiHQmUwqedQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXvgi1AAoJEPqg+cTm90wjTKEP/Rl+HAXLc+gSZk18O2fce3AT DGH7E4qtgqvHojPrzxC3IKd7YZlZbTPso34rQHgpOkZsYmrLRtJ+rxuA5tlWyRvL iALhlJyv6tFzzDntM61LG4aPjg3TIG0f2iIrXQf2PjI7KusnGim6VpfYCseyT7xd f9rc4of32rNXenBJXkyfnwykPqjfyONJ8l8pwPpPV3xisowrgIUByYLJZO5KY12r jBW4b+AcuuWJ1/yyd3kudp79nguQnGC0zeZA6VyM/bSUv8qEjq3blBK5GRLthjl6 jB3coS2BVrNxPwF7AT2y1BrQztGsl7mtpDVXT1SnZSzikOHofgXFyzJNOKuqj3xL /TdmeNyz8mxwLH29StkQUFT18j3YQntz/sPZi7Aksi9huuvvThRorFO0kgRlsxyz cxaqJOAeDBUG5PjyBy0fejtCanHO5hX9xXwE3vK+G3eQbLmzWI2t20nL65+a2lGY 45GzC5e249eGYWVG29SDNXf5zCD0CV9KeSp+6vQHxaOp8bhDU4e9gLE6NEvGvEPE MTgaMyHTvQwSCUYnDT+XO08snADEFGsvTPDG6YpX4qI8NRB7RwFLTg42HY3X4Sid sl2XTpe96J4j2jbgjnPsbaFBdLMebn643XN5xYfslNaieBtH7Bm8/t6zj5nZaAbc RMuCnMZRcLGvI8EikfOL =AxLC -----END PGP SIGNATURE----- --iu6NDqf1buB0UXm4Kpd4fiPiHQmUwqedQ--