emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] exporting drawers: odt versus LaTeX


From: Nicolas Goaziou
Subject: Re: [O] exporting drawers: odt versus LaTeX
Date: Mon, 30 Apr 2018 13:46:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

Eric S Fraga <address@hidden> writes:

> Yes, I understand.  I am definitely not disagreeing about how org parses
> the elements, simply how it exports them.

Then we agree on this point. 

Export is different because, well, target languages are also
different...

Since empty lines are preserved upon exporting documents, Org is /de
facto/ nice with formats that separate paragraphs with blank lines,
e.g., LaTeX or Texinfo. I.e, it adapts easily to their definition of
a paragraph.

As you noted, this is not the same for other back-ends, as HTML or ODT.
At some point, I wanted to have Org adapt to their own definition of
a paragraph. I.e., a parse-tree filter (provided by the back-end) would
generate pseudo-elements matching the target's definition of
a paragraph. Then, the parse-tree would convert the pseudo-element as
a paragraph whereas it would do nothing for a regular paragraph.

E,g., the following document

  Paragraph
  #+begin_quote
  Quote
  #+end_quote
  Paragraph 2

  Paragraph 3

is parsed as 

  (paragraph "Paragraph") 
  (quote-block (paragraph "Quote"))
  (paragraph "Paragraph 2")
  (paragraph "Paragraph 3")

the HTML parse tree filter would turn it into

  (html-paragraph 
   (paragraph "Paragraph")
   (quote-block (html-paragraph (paragraph "Quote")))
   (paragraph "Paragraph 2"))

  (html-paragraph
   (paragraph "Paragraph 3"))

and since regular paragraph converter would be a no-op, this would
really become:

  (html-paragraph 
   "Paragraph"
   (quote-block (html-paragraph "Quote"))
   "Paragraph 2")

  (html-paragraph "Paragraph 3")

Some parts of the export framework already implement a similar
mechanism, e.g., `org-latex--wrap-latex-matrices'.

But there are a some shortcomings. E.g., is an `html-paragraph' nested
in an `html-paragraph' still valid? What about the quote block being
a table, a plain list? IOW, what is the exact definition of HTML
paragraph?

Since I couldn't answer those questions, I'm mostly a LaTeX guy, this is
not implemented so far.

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]