kjambunathan / org-mode-ox-odt

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

Pagebreak seems not to work #91

Closed ouboub closed 3 years ago

ouboub commented 3 years ago

Hi I want a pagebreak before a table and then after it using landscape (and for that a ott file) testbreak.zip Please see the attached files

kjambunathan commented 3 years ago

I see some misconfigurations. These images will tell you where the problems are:

Problem1: Org Page is not configured for landscape   it is NOT  APPLIED as style to  the document

Document is using the 'Default Page Style' and it is the 'Default Page Style' that is in Landscape

kjambunathan commented 3 years ago

You have misconfigured the styles:

  1. The OrgPage style is NOT in landscape. You may have to fix it.
  2. The OrgPage is NOT APPLIED to the document pages. It is the default page style that is getting applied.
  3. It is the 'Default Page Style" that is in the Landscape format.

If you examine the XML files you can see what is happening underneath.

kjambunathan commented 3 years ago

uwe2.zip

In the zip file above you can see

  1. Screenshots that explain where you need to focus on in the LibreOffice UI.
  2. A diff file that tells what modifications I have done to your file. The page breaks are applied to headings. There is a place where I have applied a break to a paragraph. Surrounding the table in a Frame may not be necessary since it seems that you are going to have large tables, and have page breaks surrounding it. So, the problem of "positioning" a table as a float may not arise.
  3. A modified Org file. (In these examples, OrgPage is a portrait page, and Standard is the landscape page just the way you have set it up)
  4. The exported ODT file that has a mix of landscape and portrait pages.

I have trouble understanding your description. It is not clear to me whether you want a landscape table in the middle of a portrait document, or you want a fully landscape document with a complex table somewhere in the middle with the page breaks. Whatever be the case, the new ODT exporter has you covered.


Here are a couple of things you need to note in the Org syntax. Once that is done, you are all set.

Remove the newlines below

#+ATTR_ODT: :width 15 :style "OrgPageImage" :anchor "page"

#+ATTR_ODT: :list-table t

The ATTR_ODT lines should "touch" the paragraphs they are applied to. (When there are newlines, the Org parser will think that you are applying an attribute to an empty paragraph)


#+ATTR_ODT: :page-style "OrgPage" :page-break "after"
* Information 

If the intention is to begin a chapter on a new page, DON'T add the pagebreak to the last paragraph of the previous chapter. Instead, add the page break right to the headings via the PROPERTIES line. The example Org file shows what you can do.


As I said, I have trouble understanding your exact layout requirements. Based on my limited understanding, I have given you recipes for all possible scenarios.

ouboub commented 3 years ago

LO

"JK" == Jambunathan K @.***> writes:

uwe2.zip In the zip file above you can see

  1. Screenshots that explain where you need to focus on in the LibreOffice UI.

First of all a big thank you for your time and explanations.

Ok I have a confession to make, I am not longer a LO user anymore. I use either org mode and export it to odt (and then to docx, since this is the format my colleagues are using) or to latex (or I use auctex mode emacs directly).

That is why I have even trouble in obtaining the screenshots you sent to me. I looked in styles, I pressed the default style button and the button of my LO screen and obtain a slightly different screen displayed. (I am using LO 6.2). I attach a screenshot.

  1. A diff file that tells what modifications I have done to your file. The page breaks are applied to headings. There is a place where I have applied a break to a paragraph. Surrounding the table in a Frame may not be necessary since it seems that you are going to have large tables, and have page breaks surrounding it. So, the problem of "positioning" a table as a float may not arise.
  2. A modified Org file. (In these examples, OrgPage is a portrait page, and Standard is the landscape page just the way you have set it up)
  3. The exported ODT file that has a mix of landscape and portrait pages.

I have trouble understanding your description. It is not clear to me whether you want a landscape table in the middle of a portrait document, or you want a fully landscape document with a complex table somewhere in the middle with the page breaks. Whatever be the case, the new ODT exporter has you covered.

Thanks again, especially with the description below. Right now I am not sure what is best, everything in landscape or only the large table. I think your solution fits in my needs best.

I did not realize that the setting is so complex (I just thought, I set a pagebreak command here and there and change whenever it is convenient and play around like I do it when I compile latex). But I need to modify the ott file and take care with the orgmode styles.

Since I am, unfortunately, in a great hurry I will take your examples and will study the manual in carefully after the course ends.

Thanks again

Uwe

ouboub commented 3 years ago

Sorry, you are going to kill me, but I just applied the converter to your modified

testbreak-page.org and I obtain a slightly different odt. it starts with an empty page, so I explicitly added

+OPTIONS: toc:t

I also add to play around with the the line #+ATTR_ODT: :page-style "OrgPage" :page-break "after" before the information header: I sometimes had to uncomment it, otherwise the large table got split. In any case the current situation is ok Thanks uwe3.zip

kjambunathan commented 3 years ago

Ok I have a confession to make, I am not longer a LO user anymore.

As a LO user, I can see when someone is (or is not) conversant with LO.

(I just thought, I set a pagebreak command here and there and change whenever it is convenient and play around like I do it when I compile latex

It is exactly like what you say.

Just export this standalone file. you don't have to do anything.

landscape.org.txt

landscape.org.pdf

kjambunathan commented 3 years ago

There is a reason why I don't recommend using#+PAGEBREAK:. You can see the reason listed here https://github.com/kjambunathan/org-mode-ox-odt/blob/f022150f3a046511dba18a509de621ec35daf075/lisp/ox-odt.el#L3011.

There seems to be some regression when I export #+PAGEBREAK: with an attribute. I will fix it in a moment or two.

I will also add a OrgLandscapePage or some such style later today.

kjambunathan commented 3 years ago

it starts with an empty page

It really doesn't. Do you remember that you need to turn off all the metadata options. This is precisely the reason.

The page styles gets attached to a paragraph empty or not. The documents metadata elements are typeset as paragraphs. This is precisely the reason why I have added this line.

#+ATTR_ODT: :style "OrgTitle" :page-style "OrgPageLandscape"
{{{title}}}

You Org file in uwe3.zip doesn't show any options. So, I can't say what it turns on or off. Do a C-c C-e # (followed by default) and C-c C-e # (followed by odt) so that I have some idea of what is in your defcustoms. These ultimately determine if there are going to be any leading paragraphs introduced by /possibly empty/ metadata.

kjambunathan commented 3 years ago

it starts with an empty page

It really doesn't. Do you remember that you need to turn off all the metadata options. This is precisely the reason.

Forgot to attach the screenshot .... Here it is.

testbreak-page-uwe-empty-page odt

ouboub commented 3 years ago

Thanks, a lot. I learn a ton of valuable information this way.

I obtain:

`#+options: ':nil *:t -:t ::t <:t H:7 \n:nil ^:t arch:headline

+options: author:t broken-links:nil c:nil creator:nil

+options: d:(not "LOGBOOK") date:t e:t email:t f:t inline:t num:t

+options: p:nil pri:nil prop:nil stat:t tags:t tasks:t tex:t

+options: timestamp:t title:t toc:nil todo:t |:t

+title: Hoja_calificaciones_alumno-Buitrago

+date: <2021-07-11 dom>

+author: Uwe Brauer

+email: oub@mat.ucm.es

+language: en

+select_tags: export

+exclude_tags: noexport

+creator: Emacs 28.0.50 (Org mode 9.4.6)

+options: tex:t

+description:

+keywords:

+subtitle:

+odt_preferred_output_format:

+odt_styles_file:

+odt_extra_images:

+odt_extra_styles:

+odt_extra_automatic_styles:

+odt_master_styles:

+odt_content_template_file:

+odt_automatic_styles:

+odt_display_outline_level: 2

+odt_endnote_regexp: ^$

+bib_file:

`

did not even know about it (well on a second thought I should, because this information pops up when I export to tex, I somehow thought, just not having anything, would not produce meta data, ok this is really lame, I confess

so I deleted text, author and all the meta stuff, and now it works as exspected

kjambunathan commented 3 years ago

so I deleted text, author and all the meta stuff, and now it works as exspected

Happy to hear that.

What follows is a note intended for my own consumption ....

The whole day, I was trying to recollect the context in which I might have introduced #+PAGEBREAK: in to the ODT exporter. It seems like I have fashioned it loosely after LO's Menu->More Breaks->Manual Break-> .....

Subsequent changes I added in response to https://github.com/kjambunathan/org-mode-ox-odt/issues/29#issuecomment-342493728 seems to have slightly poisoned the original intention.

I need to review

  1. If #+PAGEBREAK: could be made more meaningful. If not, I will remove it.
  2. Add default OrgLandscapePage style
  3. See if there is a way to add default page style for the exported document without much hassle. Since the user can pick choose what meta information can or cannot appear, it becomes kind of messy to infer what the first paragraph (or the first block-level element) could be. (An use-case to think of is a document that has no parargraphs at the top level. For example, a document with no metadata but just a table that needs to be emitted in a landscape page.) Since the page break--and the specific-kind of page it wants for subsequent text--piggy backs on paragraph (or possibly other element like table) it doesn't make much sense to it piggyback on a "standalone" element like #+PAGEBREAK:.

There is a scope for improving the easy-of-specifying pagebreaks. Much of the infrastructure for specifying page breaks is already in place. How the nuts and bolts of pagebreak logic are assembled together by the user is (at present) NOT VERY INTUITIVE.

ouboub commented 3 years ago

so I deleted text, author and all the meta stuff, and now it works as exspected Happy to hear that.

What follows is a note intended for my own consumption ....

The whole day, I was trying to recollect the context in which I might have introduced #+PAGEBREAK: in to the ODT exporter. It seems like I have fashioned it loosely after LO's Menu->More Breaks->Manual Break-> .....

Subsequent changes I added in response to https://github.com/kjambunathan/org-mode-ox-odt/issues/29#issuecomment-342493728 seems to have slightly poisoned the original intention.

I need to review

  1. If #+PAGEBREAK: could be made more meaningful. If not, I will remove it.
  2. Add default OrgLandscapePage style
  3. See if there is a way to add default page style for the exported document without much hassle. Since the user can pick choose what meta information can or cannot appear, it becomes kind of messy to infer what the first paragraph (or the first block-level element) could be. (An use-case to think of is a document that has no parargraphs at the top level. For example, a document with no metadata but just a table that needs to be emitted in a landscape page.) Since the page break--and the specific-kind of page it wants for subsequent text--piggy backs on paragraph (or possibly other element like table) it doesn't make much sense to it piggyback on a "standalone" element like #+PAGEBREAK:.

There is a scope for improving the easy-of-use. Much of the infrastructure for specifying page breaks is already in place. How the nuts and bolts of pagebreak logic are assembled together it is at present NOT VERY INTUITIVE.

I wholeheartedly agree. I there is any code you want me to test, please let me know.

BTW, I know his is a ox-exporter, but is there any possibility that these structures could be exported to LaTex in a similar way, I mean lists to tables?

kjambunathan commented 3 years ago

BTW, I know his is a ox-exporter, but is there any possibility that these structures could be exported to LaTex in a similar way, I mean lists to tables?

Last time I wrote anything latex was some 20 or so years ago. Since I have not much experience, my judgement is going to be pretty weak. Also, since I have no immediate need, it is hard to muster any motivation to find a reliable solution. That said ....

If you haven't noticed it already, the example I have chosen for illustrating the List tables is from the LaTeX Wikibook, with the last column converted in to a list. And most examples that I have run across in the latex realm, that talk about tables, have some simple stuff in table cells. They hardly mention how to typeset a multi-paragraph content in a latex table.

Since you are familiar with LaTeX you can proceed the following way and "fix" whatever problems you bump in to. And if you have to get anything past Nicolas Goaziou, DO NOT suggest it as a change to Org syntax or Org parser. He will resist it.

When I put this in my .emacs

(with-eval-after-load 'ox-latex
  (unless (featurep 'ox-odt)
    (require 'ox-odt))
  (add-to-list
   'org-export-filter-parse-tree-functions
   (defun org-html--translate-list-tables (tree backend info)
     (if (eq backend 'latex)
         (org-odt--translate-list-tables tree backend info)
       tree))))

and export this

#+ATTR_ODT: :list-table t
-
  - Day
  - Min Temp
  - Max Temp
  - Summary
- ----------------
  - Monday
  - 11C
  - 22C
  - 
    1. A clear day with lots of sunshine.
    2. Late in the day, a strong breeze will bring down the temperatures.
- ----------------
  - Tuesday
  - 9C
  - 19C
  - 
    1. Cloudy with rain, across many northern regions.
    2. Clear spells across most of Scotland and Northern Ireland, but
       rain reaching the far northwest.

... to tex, I get

% Created 2021-07-12 Mon 07:01
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\author{Jambunathan K}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={Jambunathan K},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 28.0.50 (Org mode 9.3.7)}, 
 pdflang={English}}
\begin{document}

\tableofcontents

\begin{center}
\begin{tabular}{llll}
Day
 & Min Temp
 & Max Temp
 & Summary
\\
\hline
Monday
 & 11C
 & 22C
 & \begin{enumerate}
\item A clear day with lots of sunshine.
\item Late in the day, a strong breeze will bring down the temperatures.
\end{enumerate}
\\
\hline
Tuesday
 & 9C
 & 19C
 & \begin{enumerate}
\item Cloudy with rain, across many northern regions.
\item Clear spells across most of Scotland and Northern Ireland, but
rain reaching the far northwest.
\end{enumerate}
\\
\end{tabular}
\end{center}
\end{document}

which is rendederd as

Screenshot from 2021-07-12 07-11-08

You can see that the paragraph is overflowing.

This is exactly what the LaTex Wikibook is saying. See https://en.wikibooks.org/wiki/LaTeX/Tables#Text_wrapping_in_tables

Text wrapping in tables

LaTeX\'s algorithms for formatting tables have a few shortcomings. One is that it will not automatically wrap text in cells, even if it overruns the width of the page. For columns that will contain text whose length exceeds the column\'s desired width, it is recommended that you use the [p] attribute and specify the desired width of the column (although it may take some trial-and-error to get the result you want). For a more convenient method, have a look at The tabularx package, or The tabulary package.

Instead of [p], use the [m] attribute to have the lines aligned toward the middle of the box or the [b] attribute to align along the bottom of the box.

Here is a simple example. The following code creates two tables with the same code; the only difference is that the last column of the second one has a defined width of 5 centimeters, while in the first one we didn\'t specify any width.

kjambunathan commented 3 years ago

Here is a quick example, I picked from https://draft-edx-style-guide.readthedocs.io/en/latest/ExampleRSTFile.html#tables

When I take this rst list table


.. list-table::
   :widths: 25 25 50

 * - Annotation Problem
   -
   - Annotation problems ask students to respond to questions about a
     specific block of text. The question appears above the text when the
     student hovers the mouse over the highlighted text so that students can
     think about the question as they read.
 * - Example Poll
   - Conditional Module
   - You can create a conditional module to control versions of content that
      groups of students see. For example, students who answer "Yes" to a
      poll question then see a different block of text from the students who
      answer "No" to that question.
 * - Example JavaScript Problem
   - Custom JavaScript
   - Custom JavaScript display and grading problems (also called *custom
     JavaScript problems* or *JS input problems*) allow you to create a
     custom problem or tool that uses JavaScript and then add the problem or
     tool directly into Studio.

and do this

rst2latex listtable1.rst  > listtable1.tex

I get

\documentclass[a4paper]{article}
% generated by Docutils <http://docutils.sourceforge.net/>
\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{longtable,ltcaption,array}
\setlength{\extrarowheight}{2pt}
\newlength{\DUtablewidth} % internal use in tables

%%% Custom LaTeX preamble
% PDF Standard Fonts
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}

%%% User specified packages and stylesheets

%%% Fallback definitions for Docutils-specific commands

% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
  \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
  \usepackage{bookmark}
  \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}

%%% Body
\begin{document}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable}[c]{|p{0.315\DUtablewidth}|p{0.315\DUtablewidth}|p{0.315\DUtablewidth}|}
\caption{:widths: 25 25 50}\\
\hline

Annotation Problem
 &  & 
Annotation problems ask students to respond to questions about a
specific block of text. The question appears above the text when the
student hovers the mouse over the highlighted text so that students can
think about the question as they read.
 \\
\hline

Example Poll
 & 
Conditional Module
 & 
\begin{description}
\item[{You can create a conditional module to control versions of content that}] \leavevmode 
groups of students see. For example, students who answer \textquotedbl{}Yes\textquotedbl{} to a
poll question then see a different block of text from the students who
answer \textquotedbl{}No\textquotedbl{} to that question.

\end{description}
 \\
\hline

Example JavaScript Problem
 & 
Custom JavaScript
 & 
Custom JavaScript display and grading problems (also called \emph{custom
JavaScript problems} or \emph{JS input problems}) allow you to create a
custom problem or tool that uses JavaScript and then add the problem or
tool directly into Studio.
 \\
\hline
\end{longtable}

\end{document}

which when processed with

pdflatex listtable1.tex 

gets rendered as

Screenshot from 2021-07-12 07-48-19

Again I see that text is overflowing. The rst example uses a simple paragraph for table cell, as opposed to a "multi" paragraph one.

Do you know what is best longtable or tabular or some other table package ....

kjambunathan commented 3 years ago

Again I see that text is overflowing. The rst example uses a simple paragraph for table cell, as opposed to a "multi" paragraph one.

Once I removed the extra indentation

i.e., once I converted

   - You can create a conditional module to control versions of content that
      groups of students see. For example, students who answer "Yes" to a
      poll question then see a different block of text from the students who
      answer "No" to that question.

to

   - You can create a conditional module to control versions of content that
     groups of students see. For example, students who answer "Yes" to a
     poll question then see a different block of text from the students who
     answer "No" to that question.

I no longer get the overflow issue. I get a pretty pdf output.

kjambunathan commented 3 years ago

The rst example uses a simple paragraph for table cell, as opposed to a "multi" paragraph one.

rst2latex works for multi-paragraph text as well.

.. list-table::
   :widths: 25 25 50

 * - Annotation Problem
   -
   - Annotation problems ask students to respond to questions about a
     specific block of text. The question appears above the text when the
     student hovers the mouse over the highlighted text so that students can
     think about the question as they read.
 * - Example Poll
   - Conditional Module
   - You can create a conditional module to control versions of content that
     groups of students see. For example, students who answer "Yes" to a
     poll question then see a different block of text from the students who
     answer "No" to that question.

     - This is a list item This is a list item This is a list item
       This is a list item This is a list item This is a list item

     - This is a list item This is a list item This is a list item
       This is a list item This is a list item This is a list item

 * - Example JavaScript Problem
   - Custom JavaScript
   - Custom JavaScript display and grading problems (also called *custom
     JavaScript problems* or *JS input problems*) allow you to create a
     custom problem or tool that uses JavaScript and then add the problem or
     tool directly into Studio.

get typeset as

\documentclass[a4paper]{article}
% generated by Docutils <http://docutils.sourceforge.net/>
\usepackage{cmap} % fix search and cut-and-paste in Acrobat
\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{longtable,ltcaption,array}
\setlength{\extrarowheight}{2pt}
\newlength{\DUtablewidth} % internal use in tables

%%% Custom LaTeX preamble
% PDF Standard Fonts
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}

%%% User specified packages and stylesheets

%%% Fallback definitions for Docutils-specific commands

% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
  \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
  \usepackage{bookmark}
  \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}

%%% Body
\begin{document}

\setlength{\DUtablewidth}{\linewidth}
\begin{longtable}[c]{|p{0.315\DUtablewidth}|p{0.315\DUtablewidth}|p{0.315\DUtablewidth}|}
\caption{:widths: 25 25 50}\\
\hline

Annotation Problem
 &  & 
Annotation problems ask students to respond to questions about a
specific block of text. The question appears above the text when the
student hovers the mouse over the highlighted text so that students can
think about the question as they read.
 \\
\hline

Example Poll
 & 
Conditional Module
 & 
You can create a conditional module to control versions of content that
groups of students see. For example, students who answer \textquotedbl{}Yes\textquotedbl{} to a
poll question then see a different block of text from the students who
answer \textquotedbl{}No\textquotedbl{} to that question.

\begin{itemize}
\item This is a list item This is a list item This is a list item
This is a list item This is a list item This is a list item

\item This is a list item This is a list item This is a list item
This is a list item This is a list item This is a list item
\end{itemize}
 \\
\hline

Example JavaScript Problem
 & 
Custom JavaScript
 & 
Custom JavaScript display and grading problems (also called \emph{custom
JavaScript problems} or \emph{JS input problems}) allow you to create a
custom problem or tool that uses JavaScript and then add the problem or
tool directly into Studio.
 \\
\hline
\end{longtable}

\end{document}

and it gets rendered as

Screenshot from 2021-07-12 08-16-23

So, may be using a longtable is the way to go.

I already see references to longtable in ox-latex, which is a good news. So, I think it is just a question of having the list table use longtable table environment.

May be you could cook up an export filter for that.

kjambunathan commented 3 years ago

So, may be using a longtable is the way to go.

I already see references to longtable in ox-latex, which is a good news. So, I think it is just a question of having the list table use longtable table environment.

May be you could cook up an export filter for that.

From https://tex.stackexchange.com/questions/12946/how-can-i-split-long-tables-in-emacs-org-mode-latex-export

For LaTeX export of a table, you can specify a label and a caption (see Images and tables). You can also use the ATTR_LaTeX line to request a longtable environment for the table, so that it may span several pages, or to change the default table environment from table to table* or to change the default inner tabular environment to tabularx or tabulary. Finally, you can set the alignment string, and (with tabularx or tabulary) the width.

https://orgmode.org/manual/Tables-in-LaTeX-export.html

So, it is just a question of setting the widths and setting an attribute. Probably, I can make my parse filter accommodate latex and html exports. Let me see if I can cook up something, and it seems doable only if it is a question of setting up an ATTR_LATEX here and there.

kjambunathan commented 3 years ago

So, it is just a question of setting the widths and setting an attribute. Probably, I can make my parse filter accommodate latex and html exports. Let me see if I can cook up something, and it seems doable only if it is a question of setting up an ATTR_LATEX here and there.

Good news ... It is just a matter of carrying over the latex attribute to the translated table. Can you try this ....

replicate this line https://github.com/kjambunathan/org-mode-ox-odt/blob/f022150f3a046511dba18a509de621ec35daf075/lisp/ox-odt.el#L5795

i.e.,

:attr_odt (org-element-property :attr_odt l1-list)

but with :attr_latex as well, like so

:attr_odt (org-element-property :attr_odt l1-list)
:attr_latex (org-element-property :attr_latex l1-list)

and export with the following snippet in your .emacs

(with-eval-after-load 'ox-latex
  (unless (featurep 'ox-odt)
    (require 'ox-odt))
  (add-to-list
   'org-export-filter-parse-tree-functions
   (defun org-html--translate-list-tables (tree backend info)
     (if (eq backend 'latex)
     (org-odt--translate-list-tables tree backend info)
       tree))))

When I do the above steps, and I export the following org snippet,


#+options: tex:t
#+description:
#+keywords:
#+subtitle:
#+odt_preferred_output_format: pdf
#+odt_styles_file:
#+odt_extra_images:
#+odt_extra_styles:
#+odt_extra_automatic_styles:
#+odt_master_styles:
#+odt_content_template_file:
#+odt_automatic_styles:
#+odt_display_outline_level: 2
#+odt_endnote_regexp: ^$
#+bib_file:

#+ATTR_LATEX: :environment longtable :align {|p{0.315\linewidth}|p{0.315\linewidth}|p{0.315\linewidth}|p{0.315\linewidth}|}
#+ATTR_ODT: :list-table t
-
  - Day
  - Min Temp
  - Max Temp
  - Summary
- ----------------
  - Monday
  - 11C
  - 22C
  - 
    1. A clear day with lots of sunshine.
    2. Late in the day, a strong breeze will bring down the temperatures.
- ----------------
  - Tuesday
  - 9C
  - 19C
  - 
    1. Cloudy with rain, across many northern regions.
    2. Clear spells across most of Scotland and Northern Ireland, but
       rain reaching the far northwest.

I get


% Created 2021-07-12 Mon 09:07
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\author{Jambunathan K}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={Jambunathan K},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 28.0.50 (Org mode 9.3.7)}, 
 pdflang={English}}
\begin{document}

\tableofcontents

\begin{longtable}{{|p{0.315\linewidth}|p{0.315\linewidth}|p{0.315\linewidth}|p{0.315\linewidth}|}}
Day
 & Min Temp
 & Max Temp
 & Summary
\\
\hline
\endfirsthead
\multicolumn{4}{l}{Continued from previous page} \\
\hline

Day
 & Min Temp
 & Max Temp
 & Summary
 \\

\hline
\endhead
\hline\multicolumn{4}{r}{Continued on next page} \\
\endfoot
\endlastfoot
\hline
Monday
 & 11C
 & 22C
 & \begin{enumerate}
\item A clear day with lots of sunshine.
\item Late in the day, a strong breeze will bring down the temperatures.
\end{enumerate}
\\
\hline
Tuesday
 & 9C
 & 19C
 & \begin{enumerate}
\item Cloudy with rain, across many northern regions.
\item Clear spells across most of Scotland and Northern Ireland, but
rain reaching the far northwest.
\end{enumerate}
\\
\end{longtable}
\end{document}

which gets rendered as

Screenshot from 2021-07-12 09-08-49

or as

listtable2.pdf

The output suggests that I just need to tweak the column widths so that they don't add up to more than pagewidth.

Please experiment and suggest how I can change the parse filter to better suit a latex-user needs.

It is basically one or two line tweak. Yes, it is doable.

ouboub commented 3 years ago

Wow, thanks a lot, I asked a question, go to bed and you solved the issue. That is fantastic, thanks a lot