4

MWE

#+CAPTION: Lisp is a language of timeless elegance.
https://imgs.xkcd.com/comics/lisp_cycles.png

Export as HTML will look something like this (depending on CSS):

output

I just want

Lisp is a language of timeless elegance

to appear under the image. How can I get rid of the numbering?

7

You may not be able to easily influence the Org export itself, but you can still remove the figure number with some CSS:

.figure-number {
    display: none;
}

result

  • Clever. Note that this does get rid of both "Figure: " and the number... – wasamasa Oct 24 '15 at 13:37
  • @wasamasa Yep, which is what I wanted in the original question =) – Sean Allred Oct 24 '15 at 13:43
  • Ah, I did read it too quickly to notice. – wasamasa Oct 24 '15 at 18:00
7

I'm afraid you can't influence this in the HTML export (as opposed to the LaTeX export which allows adding arbitrary captioning code) because the behaviour is hardcoded in Org's org-html-paragraph:

(if (not (org-string-nw-p raw)) raw
  (concat
   "<span class=\"figure-number\">"
   (format (org-html--translate "Figure %d:" info)
           (org-export-get-ordinal
            (org-element-map paragraph 'link
              'identity info t)
            info nil 'org-html-standalone-image-p))
   "</span> " raw))

Therefore, the only alternative I can imagine is using raw HTML:

#+BEGIN_HTML
<div class="figure">
<p><img src="https://imgs.xkcd.com/comics/lisp_cycles.png" /></p>
<p>Lisp is a language of timeless elegance</p>
</div>
#+END_HTML

Did you consider handing in a bug report with M-x org-submit-bug-report?

  • I'll consider it – this is definitely something that should be configurable from an Org-ish workflow – but I'll draw attention to the workaround in my answer =) – Sean Allred Oct 24 '15 at 13:17
2

Building on Sean Allred's answer, this worked great for me (no need to link to / tweak external style sheet, e.g. for a one-off use):

@@html:
<style>
.figure-number {
    display: none;
}
</style>
@@

#+CAPTION: Lisp is a language of timeless elegance.
https://imgs.xkcd.com/comics/lisp_cycles.png

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.