[Solved] Two column section layout goes crazy

Discuss the word processor
Post Reply
godblessfq
Posts: 33
Joined: Wed Jul 19, 2017 2:53 am

[Solved] Two column section layout goes crazy

Post by godblessfq »

I put two images side by side with a two columns section, in the odt file there
are 4 rows of this two columns sections, the last row doesn't fit the first
page, but there is still some space left on the first page, then the 4th row of
images takes up 2 pages? Is there any fix? :(

Attached are the odt file and the pdf file showing the layout on my computer.

The document is an export of this emacs org mode file:

Code: Select all

    #+attr_odt: :style "two_columns"
    #+begin_section
    #+begin_center
    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]

    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]
    #+end_center
    #+end_section

    #+attr_odt: :style "two_columns"
    #+begin_section
    #+begin_center
    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]

    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]
    #+end_center
    #+end_section

    #+attr_odt: :style "two_columns"
    #+begin_section
    #+begin_center
    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]

    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]
    #+end_center
    #+end_section

    #+attr_odt: :style "two_columns"
    #+begin_section
    #+begin_center
    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]

    #+caption: org-mode-unicorn-logo
    #+attr_odt: :width 6.1 :style "Text_20_body"
    [[./org-mode-unicorn-logo.png]]
    #+end_center
    #+end_section
Attachments
section.pdf
The layout on my computer.
(93.25 KiB) Downloaded 113 times
section.odt
(80.28 KiB) Downloaded 95 times
Last edited by godblessfq on Sun Dec 17, 2017 9:57 am, edited 1 time in total.
LibreOffice 7.2.3.2 on Debian, emacs org-odt exporter (topic 106686)
godblessfq
Posts: 33
Joined: Wed Jul 19, 2017 2:53 am

Re: Two column section layout goes crazy

Post by godblessfq »

It is not possible to insert captioned image inside table cell. The original problem can be solved with anchor type though.
LibreOffice 7.2.3.2 on Debian, emacs org-odt exporter (topic 106686)
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Two column section layout goes crazy

Post by RoryOF »

Looking at the code offered, I see nothing to force a break between columns.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
godblessfq
Posts: 33
Joined: Wed Jul 19, 2017 2:53 am

Re: Two column section layout goes crazy

Post by godblessfq »

It relies on openoffice to do the layout by equating the heights of the two columns. You can get org-mode-odt here:

https://github.com/kjambunathan/org-mode-ox-odt
LibreOffice 7.2.3.2 on Debian, emacs org-odt exporter (topic 106686)
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Two column section layout goes crazy

Post by Bill »

I believe the problem is caused by a conflict between the placement of Section 4 and the images in Section 4. Section 4 starts at the bottom of the first page. The images are set to be placed at the top of Section 4, but there is not enough room on page 1 for the images. Try changing your code to insert a page break after Section 3.
AOO 4.1.14 on Ubuntu MATE 22.04
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Two column section layout goes crazy

Post by RoryOF »

If the Page specification is changed to have a sufficiently greater height Section 4 of the sample file displays correctly.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Two column section layout goes crazy

Post by Bill »

I deleted the eighth image/frame, saved as a new document, then reloaded the document. The single image/frame in Section 4 was still placed at the top of the second column instead of the first column. Changing the section to three columns, the image/frame was placed at the top of the third column. It appears that if a floating image/frame has to be moved from one page to the top of the next page in a multi-column section, the image frame is placed at the top of the last columnn instead of the first column. AOO may have been designed to work this way, but it's probably not what most users would expect. I haven't found a bug report or enhancement request about this behavior.

Another possible workaround is to change the anchors of the frames to "As character" instead of "To Paragraph". Floating images/frames in multi-column sections that span more than one page can be unstable.
AOO 4.1.14 on Ubuntu MATE 22.04
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Two column section layout goes crazy

Post by RoryOF »

In my view it is better to specify in the code exactly what one wants, rather than to trust a target program can do what one expects.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply