emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Short captions
@ 2020-02-11  4:20 Anthony Cowley
  2020-02-11 13:14 ` Fraga, Eric
  0 siblings, 1 reply; 5+ messages in thread
From: Anthony Cowley @ 2020-02-11  4:20 UTC (permalink / raw)
  To: Emacs Org-Mode Help

I am having trouble understanding how short captions are supposed to work. Consider this org document:

#+begin_src org
,#+title: Short Caption Test
,#+author: Org User

,#+label: table1
,#+caption[This is table1]: And here go on at length in a longer caption.
| Name | Favorite Number |
|------+-----------------|
| Sue  | 42              |
| Tom  | 99              |

,#+label: table2
,#+caption[This is table2]: But *with* /this/ table, the /short/ caption is *lost*.
| Name  | Favorite Color |
|-------+----------------|
| Alice | Red            |
| Bob   | Also Red       |

,#+label: table3
,#+caption[This is table3]: No org markup is used in this long caption, but some $\LaTeX$ is!
| Number | Favorite Person |
|--------+-----------------|
| 0      | Zed             |
| 1      | Solo            |
#+end_src

When I export it as a LaTeX file, the captions are:

#+begin_src latex
\caption[This is table1]{\label{table1}And here go on at length in a longer caption.}
#+end_src

#+begin_src latex
\caption[\textbf{lost}]{\label{table2}But \textbf{with} \emph{this} table, the \emph{short} caption is \textbf{lost}.}
#+end_src

and

#+begin_src latex
\caption{\label{table3}No org markup is used in this long caption, but some \(\LaTeX\) is!}
#+end_src

The first matches my expectations. The second is an example of taking the last bit of markup as the short caption. The third seems to lose the short caption altogether.

When I look at 

#+begin_src emacs-lisp
(org-element-map 
    (org-element-parse-buffer) 
    'table 
  (lambda (x) (org-element-property :caption x)))
#+end_src

Only the first caption seems to have the short caption in the parse results at all. Is this a bug, or should I avoid using markup in captions?

Thank you,
Anthony

#+begin_src emacs-lisp
(org-version)
#+end_src

#+RESULTS:
: 9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-12 10:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-11  4:20 Short captions Anthony Cowley
2020-02-11 13:14 ` Fraga, Eric
2020-02-11 19:50   ` Anthony Cowley
2020-02-12  8:17     ` Bastien
2020-02-12 10:13     ` Fraga, Eric

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).