kjambunathan / org-mode-ox-odt

The Authoritative fork of Org mode's ODT exporter
GNU General Public License v3.0
47 stars 9 forks source link

Explore if anchoring images as "as-char" would improve compatibility when importing in to other ODT apps like Google Docs or MS Word even #153

Open kjambunathan opened 2 years ago

kjambunathan commented 2 years ago

Explore if anchoring images as "as-char" would improve compatibility when importing in to other ODT apps like Google Docs or MS Word even

See Document with a series of images doesn't import well in to Google Documents · Issue #137 · kjambunathan/org-mode-ox-odt. There seems to be a "general consesus" that anchoring "as-char" improves compatibility with MS word format. I don't have access to MS Word, so I cannot ascertain for myself how well the ODT exported docs fares with importing in to MS Word.


Here is a real-life war experiences & recommendations from a power user The mysteries of positioning pictures in LibreO... » Linux Magazine. The article is dated May 2014 and talks about OpenOffice. Much water has flown in Ganges since that time. So, some of the recommendations has to be taken with a grain of salt. But the recommendations there cannot be ignored.

I remember seeing some image-related recommendations in Designing with LibreOffice book.


Some quick notes for later reference ...

Image AS CHARACTER as default - English - Ask LibreOffice

You can define your own document template. If you make any change in "Graphics" style, this style is included into the template. You need some knowledge about file format, but you can set the style "Graphics" to anchor type "as character". You can take the style "Formula" as example. To make it easier for you, I have attached such document template myGraphicTest.ott{.attachment}. You can adapt other properties like default language, page borders, header/footer settings to your needs. It will not affect the anchor type of "Graphics". If you base your document on this template, all inserted Graphics will be anchored "as character" as default.


Presetting the anchorage - as of version 7.1

The anchoring for inserting images can be preset from LibreOffice version 7.1.

Select Tools>Options>LibreOffice Writer>Formatting Aids from the menu.

For Image/Anchor you can select: To Pragraph, To Character or As Character.

kjambunathan commented 2 years ago

Cc @QiangF

Big changes ahead

I have decided to abadon "paragraph" anchoring, and instead go with "to character" anchoring.

This is based on

(a) this "Google Docs" issue I personally ran into

(b) https://github.com/kjambunathan/org-mode-ox-odt/discussions/170#discussioncomment-2369765

(c) https://github.com/kjambunathan/org-mode-ox-odt/discussions/170#discussioncomment-2377085

Repo may be "a bit" broken until I make a formal release

I have already started making changes. In the last 5 years, I have accumulated good amount of changes. I need to re-arrange the furniture a bit to introduce further changes with some amount of confidence.

To begin with I have removed support for short caption. I will re-add it.

(And the repo may be broken until I make a release.)

For now you can freeze your checkout to https://github.com/kjambunathan/org-mode-ox-odt/commit/a4b46a6acd8e79179bdac6b217bb02bdbf4974bf or ox-odt-9.5.2.407.tar.

You can wait until I make a release or test the repo on a commit by commit basis. The commit message will say what I have done.

What I will be using

https://ask.libreoffice.org/t/how-can-i-preserve-image-caption-position-keep-image-captions-attached-to-respective-image/58323/9