6

I am trying to make a table with images and texts, then export to an odt file. How to mix text and image in org table?

Drew
  • 75,699
  • 9
  • 109
  • 225
godblessfq
  • 1,177
  • 8
  • 21

2 Answers2

4

Like this?

| <c>                       |
| text                      |
| [[file:~/images/img.png]] |
rasmus
  • 2,682
  • 13
  • 20
0

Does the image below capture what you have in mind?

Subfigure in ODT export using a list-table

If yes, ...

  1. You need list table-s. See #+ATTR_ODT: :list-table t below
  2. You need to tell the exporter that what appears as a table, is in fact a composite figure that is composed of two sub-figures. See #+ATTR_ODT: :category "figure" below.
  3. To satisfy yourself that you are indeed getting a figure, and not a table you can create a TOC for figures, and see if the composite image crops up in there. See #+toc: figures

Here is one possible solution.

Remember, the snippet has trailing whitespaces. Without them, the lists wouldn't become lists.

#+toc: figures

#+CAPTION: My favourite pets
#+ATTR_ODT: :category "figure"
#+ATTR_ODT: :list-table t
- 
  -
    
    #+ATTR_ODT: :width 7
    #+CAPTION: A Dog
    [[./org-mode-unicorn.png]]

  -
    #+ATTR_ODT: :width 7
    #+CAPTION: A Cat
    [[./org-mode-unicorn.png]]

For this snippet to work, you need to install the The enhanced ODT exporter with M-x package-install.

To learn more about list table-s, see Create tables with paragraph-like content in Org mode, with the least amount of hassle – Emacs Notes

or

List Tables in ODT export (OpenDocument Text Exporter for Emacs’ Org Mode)

Unfortunately, the ODT exporter doesn't expand the table of figures. So, you need to do it manually. That is, after the ODT document is created, open it the ODT file in LibreOffice and do Tools->Update->Update All. If you do this, you will get ...

Earlier sub-figure, with TOC entry