0

If you start a blank org buffer and put in

#+CAPTION: This is the caption for the next table (or link)
| ... | ... |
|-----+-----|

then html-export it, it comes out all cramped and vertical.

Table 1: 
This is
the caption
for the
...

In my Chrome Inspect I see user agent stylesheet entries

user agent stylesheet entries
caption {
    display: table-caption;
    text-align: -webkit-center;
}

Inherited from table
user agent stylesheet
table {
    border-collapse: separate;
    text-indent: initial;
    border-spacing: 2px;
}

This however in the same bare-bones file

#+caption: Y approaches infinity as X approaches 0 from either side
#+RESULTS:
[[file:images/oneoverx1.svg]]

behaves okay, i.e., it simply puts the caption text (with a figure #) in a <p>...</p> and displays it under the image.

Not sure how this cramped outcome can be corrected -- or what the difference in these two uses of caption is. Something in org-mode export is doing this no doubt. Same in Firefox, BTW. On 9.5.2.

1

The width of the caption is determined by the width of the table. Make the table wider and the caption will be wider:

#+CAPTION: This is the caption for the next table (or link)
#+ATTR_HTML: :width 500
| a | b |
|---+---|
| c | d |
| e | f |
2
  • Yes, that worked. Thanks again. Now, can only tables and image (links) have captions? It seems a code block, latex math, etc. can't have a caption, at least as I've tested. Even though the docs say they can. It says: ...caption mechanism can apply to many others—e.g., LaTeX equations, source code blocks. Depending on the export back-end, those may or may not be handled. What sort of "export back-end" do I need?
    – 147pm
    Dec 27 '21 at 2:05
  • Based on what you quote: "Depending on the export back-end, those may or may not be handled." I read this to mean that the info channel of the exporter contains all the caption information: whether the exporter makes any use of it is up to each individual exporter. E.g. the HTML exporter provides caption handling for source blocks: see the function org-html-src-block; other exporters might not. However, you should create a separate question for such concerns: it is outside the scope of the current question.
    – NickD
    Dec 27 '21 at 2:17

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.