emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <esflists@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: exporting drawers: odt versus LaTeX
Date: Tue, 24 Apr 2018 09:34:48 +0100	[thread overview]
Message-ID: <87bme9dmtz.fsf@delle7240.chemeng.ucl.ac.uk> (raw)
In-Reply-To: <87efj5njhx.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 24 Apr 2018 09:36:42 +0200")

[-- Attachment #1: Type: text/plain, Size: 1936 bytes --]

On Tuesday, 24 Apr 2018 at 09:36, Nicolas Goaziou wrote:
> Hello,
>
> Eric S Fraga <esflists@gmail.com> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

  reply	other threads:[~2018-04-24  8:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 16:05 exporting drawers: odt versus LaTeX Eric S Fraga
2018-04-23 21:26 ` Nicolas Goaziou
2018-04-24  5:37   ` Eric S Fraga
2018-04-24  7:36     ` Nicolas Goaziou
2018-04-24  8:34       ` Eric S Fraga [this message]
2018-04-24 21:43         ` Nicolas Goaziou
2018-04-25  6:17           ` Eric S Fraga
2018-04-30 11:46             ` Nicolas Goaziou
2018-04-30 13:36               ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bme9dmtz.fsf@delle7240.chemeng.ucl.ac.uk \
    --to=esflists@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).