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: Eric S Fraga
Subject: Re: [O] exporting drawers: odt versus LaTeX
Date: Tue, 24 Apr 2018 09:34:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Tuesday, 24 Apr 2018 at 09:36, Nicolas Goaziou wrote:
> Hello,
>
> Eric S Fraga <address@hidden> writes:
>
>> this is not quite true; in LaTeX, a blank line (\n\n) indicates a
>> paragraph but org does not treat a drawer as starting a paragraph.
>
> Of course it does. Drawers contains paragraphs, not the opposite way.

Hi Nicolas,

We may have to agree to disagree here.  The export outputs indicate the
opposite.  I understand your reasoning (as given in the rest of the
post) but I think there is a fundamental design issue here.  However, I
can live with it.

So, moving forward, is there an ODT expert that can tell me how to wrap
the contents of a drawer so that the background of the drawer contents,
which obviously consist of 1 or more paragraphs on ODT export, is a
specific colour?  I tried:

#+begin_src emacs-lisp :results none
  ;; format note drawers
  (setq-local org-latex-format-drawer-function
              (lambda (name contents)
                (if (string= name "note")
                    (progn
                      (format "\\hl{%s}" contents)))))
  (setq-local org-odt-format-drawer-function
              (lambda (name contents)
                (if (string= name "note")
                    (progn
                      (format "<text:span 
text:background=\"#FFFF00\">%s</text:span>" contents)))))
#+end_src 

but this leads to malformed XML according to libreoffice.  The LaTeX
works because I expect note drawers to be short and no more than a
single "paragraph".  For other drawers, I used mdframed in LaTeX to
achieve a similar effect.

(ignore the emacs lisp correctness/style issues...  e.g. progn and what
happens if a different drawer; this is work in progress ;-))

This is all relates to my preemptively moving away from inline tasks for
a number of use cases.

Thank you.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.7-475-g3ffc7d

Attachment: signature.asc
Description: PGP signature


reply via email to

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