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?
-
1Did you try just putting an image link in the table? – John Kitchin Jul 30 '16 at 15:01
-
Yes, it works. Still need to figure out the size and alignment for each cell. – godblessfq Aug 02 '16 at 14:09
2 Answers
Like this?
| <c> |
| text |
| [[file:~/images/img.png]] |

- 2,682
- 13
- 20
-
1
-
-
-
change image size by resizing it, e.g. with ImageMagick: `convert image.png -resize 32x32` – xeruf Jan 06 '22 at 18:31
Does the image below capture what you have in mind?
If yes, ...
- You need
list table
-s. See#+ATTR_ODT: :list-table t
below - 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. - 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 ...