org-mode-ox-odt icon indicating copy to clipboard operation
org-mode-ox-odt copied to clipboard

Improper seperation between objects

Open QiangF opened this issue 3 years ago • 9 comments

example.zip

I find there is unnecessary gap between section and table on page 2 for the snippet in the zip file. On lower part of page 2, there is enough space for the following table, but it's rendered empty.

img_2021_12_01__09_50_52

The empty space can be removed by insert a linebreak after the two column section.

Here the objects are a two column section and a table, there might be other similar cases, I have seen extra large blank areas before.

The file named "good.odt" is a resaved version of the above exported file, it is much smaller and doesn't have the described problem, libreoffice adds a soft-page-break in the last table:

<table:table table:name="Table1" table:style-name="Table1">
    <table:table-column table:style-name="Table1.A" table:number-columns-repeated="2"/>
    <text:soft-page-break/>

If soft-page-break does no harm to the format, maybe it should be inserted in the beginning of tables, figures and multi-column section by default, just to help the document layout in libreoffice.

QiangF avatar Dec 02 '21 07:12 QiangF

I have redefined the outline style, so different part of text_cn.xml can be folded, which makes eding xml style files easier.

Looks like outshine-mode doesn't support nxml-mode. May be file a enhancement request with outshine-mode.

The advantage with hs-minor-mode is that you don't have to "change" the buffer at all. I am yet to figure out a way for how to make hs-minor-mode show the XML like org cycling does.

You can also use origami. The advantage is that it has org like folding / unfolding. The disadvantage is that it is slow and buggy. And I often see complaints that the author of this package doesn't respond to bugs or feature requests.

That said, there is nothing is better than that which is already working well for oneself.

Btw, I would appreciate if you could keep the discussion / issue focused on a single topic. For example, instead of sharing your tip about folinding XML styles in a bug about LibreOffice rendering / pagination, you could have opened a new discussion thread or an issue. When I file a bug report with LibreOffice, I am going to link to this issue and the LibreOffice team (if at all wants to look at notes in this bug), they will get confused about unrelated discussions and will feel discouraged.

QiangF avatar Dec 02 '21 08:12 QiangF

I have redefined the outline style, so different part of text_cn.xml can be folded, which makes eding xml style files easier.

Thanks for the tip. You can run M-: (org-odt-prettify-xml-buffer) when in the cn file.

I use `hs-minor-mode' ... In your case, you are using manually inserted comment lines.

kjambunathan avatar Dec 02 '21 15:12 kjambunathan

I have looked at this in detail. Programmer in me says that it is a layout bug in LibreOffice ... and most importantly this example will actually help them fix it.

I will file a bug report with LibreOffice. For them to look at it, I need to add a detailed report. It will take some time for me to actually fill out the details.

kjambunathan avatar Dec 03 '21 04:12 kjambunathan

There is plenty of options in the discussion page ... For example, you could have used Show and tell or Ideas to share your tip about folding xml nodes with us.

Screenshot from 2021-12-03 11-05-11

kjambunathan avatar Dec 03 '21 05:12 kjambunathan

I have put the good looking and bad looking files in the attached zip file, the content.xml are different. Uploading issue.zip…

Did you forget something?

This is what I see in the original example.zip . There is no good and bad looking files in there.

M    Mode     Size        Date&time         Filename
- ----------  -----  --------------------  ----------------
  -rwxr-xr-x  10527   2-Dec-2021 15:43:48  org-mode-unicorn.png
  -rw-r--r--    999   2-Dec-2021 15:43:36  sinppet.org
  -rw-r--r--  25611   2-Dec-2021 15:43:08  OrgOdtContentTemplate.xml
  -rw-r--r--  97519   2-Dec-2021 15:43:08  text_cn.xml
- ----------  -----  --------------------  ----------------

kjambunathan avatar Dec 04 '21 02:12 kjambunathan

One more thing, include the full set of export options in the top of the org file withC-c C-e # d and C-c C-e # o. Remember to remove any private info, and comment out the stuff you don't want like title etc. Also see if you can reproduce the issue with text_cn.xml file. I know you have been using that file for quite sometime, at least for last 4 years or so. So, I will not be able to see if any changes in there is adding to the problem.

kjambunathan avatar Dec 04 '21 03:12 kjambunathan

One more thing, include the full set of export options in the top of the org file withC-c C-e # d and C-c C-e # o. Remember to remove any private info, and comment out the stuff you don't want like title etc. Also see if you can reproduce the issue with text_cn.xml file. I know you have been using that file for quite sometime, at least for last 4 years or so. So, I will not be able to see if any changes in there is adding to the problem.

Replying to myself ... I created the unit test files for reporting to LibreOffice edit. (Note: This is the kind of bug report I want :-))

emacs-org-mode-ox-odt-issue#144.zip

Introduction of an additional paragraph throws the pagination off.

wrong-pagination-with-two-column-section-and-table-1

wrong-pagination-with-two-column-section-and-table-2

kjambunathan avatar Dec 04 '21 03:12 kjambunathan

emacs-org-mode-ox-odt-issue#144.zip

emacs-org-mode-ox-odt-issue#144-v2.zip

This version (v2) has the following changes:

  1. Additional annotations for the screenshot in v1
  2. Screenshots with field names. This captures how the presence of a single paragraph--this paragraph has an "empty" contents and is easily identifiable with turning ON the fieldnames--throws the pagination off.

With some changes to README.org, this zip file can be submitted to LibreOffice bugs.

kjambunathan avatar Dec 04 '21 04:12 kjambunathan

Sorry about the last post. The connection to github is unstable here. I found that libreoffice seems to be able to fix the gap on a file resave. Here is my last post:

After the latest three commits in the odt exporter, if I resave the file to another name with libreoffice, the gap is still there. Before the lastes commits the gap is removed when I resave the file to a different name. I have put the good looking and bad looking files in the attached zip file, the content.xml are different. issue.zip

QiangF avatar Dec 04 '21 08:12 QiangF