From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AMJKEaLfJ2H4PAAAgWs5BA (envelope-from ) for ; Thu, 26 Aug 2021 20:38:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cMLUDKLfJ2FbDwAAbx9fmQ (envelope-from ) for ; Thu, 26 Aug 2021 18:38:26 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1528F1F419 for ; Thu, 26 Aug 2021 20:38:25 +0200 (CEST) Received: from localhost ([::1]:42690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJKGe-00029B-8c for larch@yhetil.org; Thu, 26 Aug 2021 14:38:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJKD2-0006u4-0d for emacs-orgmode@gnu.org; Thu, 26 Aug 2021 14:34:40 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:41824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJKCx-0001mW-QR for emacs-orgmode@gnu.org; Thu, 26 Aug 2021 14:34:39 -0400 Received: by mail-wr1-x434.google.com with SMTP id u9so6505747wrg.8 for ; Thu, 26 Aug 2021 11:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BGkr2OmwPrmT4XN3m69Pqhl95DrcMQUUoGzEN2nBGyk=; b=k00Ig0htwG/uaWvKJjzHHHiDk0Hq7pXrPkKEjtsl+1v8chKu1JHcLQIDvc/e/lGJaQ QqbD20sjp9pBi5XbXBPgjo6nHjc3exeGBh6cE69mMHL0AddQauTjRN5ecjwnxDvl4bx+ OYrxW+tMUiGd3iwCSE1uYY8D8r2Y4OP5sjUad4md+4BZxUqUAQW5AFLnRGd9jUZClnDC uGW1B6zMPaS0mSj4o3y7gS1F6hZOAcWeXrHGGiw+xlKAFsm0iFAFEw/8FiZhOSJ8a3wm zOD53V/FT3SkxawR5JQxRhzbyuXfbp5d0sImwpimkFlMdzEn58gJdBnwL+G7SmPeADGZ 7gvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BGkr2OmwPrmT4XN3m69Pqhl95DrcMQUUoGzEN2nBGyk=; b=cyaz5Ago4cUrNRgakeqpSwMHwbM/hAZje3qE4nBclHJzVdwh+unkgHqwWn9pimJfeH NQHCXJOAsC9lznwHhza7bNOu/QOcPBkafllTgaWq6xgM+qyfJH5Gfx5XCvsTXNG8V3Qf av1BDRFOE8kqq1V2uhFWOuEMgNOmjJn2SMyLZCgXxGsBneDUdIJl9a0GzblFj7GmJ7M9 P2q1n48zAe6VJ+opN4eKoEVj+QtB/j+fBJ28uY8HCkGWVWU6O5qR3TlNfSQGkryvvPln H2eW4qF/UpCMhPp8cUSXBnriWGD7IQ22yAe3608yuEmaDyMQ+7pvkViDJOSaernxixUS HkRg== X-Gm-Message-State: AOAM532gEMAGunB489V2et/EWOIrTtFvEkpKX3hg4dT2dpgxngozlCsq H/g7unCqT/7N7INzpn/rCWUdKaAdaXHCvTrPdHk5ZSYE X-Google-Smtp-Source: ABdhPJxt0Ks8fkbevZN7h7Y3VUjiGQmthMHtc43qotnrBGHwBt6P00DTCZUPW24POL6bGxpMsSHZaURORZ17tbDo4Vg= X-Received: by 2002:adf:dcc7:: with SMTP id x7mr5679363wrm.173.1630002873798; Thu, 26 Aug 2021 11:34:33 -0700 (PDT) MIME-Version: 1.0 References: <87bl5k48z1.fsf@ucl.ac.uk> <877dg8473k.fsf@ucl.ac.uk> <87k0k82nuy.fsf@posteo.net> <87fsuw2llc.fsf@posteo.net> In-Reply-To: <87fsuw2llc.fsf@posteo.net> From: John Kitchin Date: Thu, 26 Aug 2021 14:34:23 -0400 Message-ID: Subject: Re: how to get multi-line author in ODT export? To: =?UTF-8?Q?Juan_Manuel_Mac=C3=ADas?= Content-Type: multipart/alternative; boundary="0000000000004693d805ca7a9eb8" Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=johnrkitchin@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode , Eric S Fraga Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630003105; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=BGkr2OmwPrmT4XN3m69Pqhl95DrcMQUUoGzEN2nBGyk=; b=Ph2RZLVVQV9eO/kEQfdIEta/zcVzjvSouGEA2IWhF3hJOjkhblfPifqTC2sK+yfJeXj3tD +eiGY7Rvv0Q23UvhgVSOCES6ikHbJA1zSVb7Dmls7N3COoIZ9+BhbwAOA+QThsktWYRAyI FmtjcJC6EXrAwLG0K7VQShWajM0w6BWuVxGx/1D4MgzHkFl31Un6j4wcJLKCGKNzuxUeg8 lKZzd7XrfvgfBnzNSSJPwlL9AcKehFmBbGbJH0qhT+YMVmEjAzmT39sEZBkVgZOauUssHj Sof8oA7a3LVO9o7QoCCKE3LDci1bqhnYCQ1b+tO05dlYVpPHaCcbxtG+r9h/aA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630003105; a=rsa-sha256; cv=none; b=KuwAIYE+YEwAM07+uO3XzC1Bm9KlPE5u+Gn2KuhiP5GQ3dZV1e51ZG8401A6AHdDMfPSQC ojR48KIf66yQ1vIxhFWjzf5Rzl3wJh8SQXkF0YHJm7QidW310MhPsIbuljfwOzZlIlqfs8 5+8+bF0YQkvqdma5+aE70l1PZ8RrbqSmkFFjE/HRpZnUTWgDPJbUDVSLSlL+XOaY30UWyI Qly9rPKgz1cG6cS071pnYrSKSF/Sa39jkCLTxO549OfWTeeWMuc/CyKMO1+pkmen4MNdYq X4xRMk8+1GnspstLiUhj4sMhSmSn0F9a68W15/y+FDtvoIVAt0GQ89islyVwWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=k00Ig0ht; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 1.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=k00Ig0ht; dmarc=fail reason="SPF not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 1528F1F419 X-Spam-Score: 1.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: GW+t47cUKxM/ --0000000000004693d805ca7a9eb8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That is really nice, thanks for sharing it! John ----------------------------------- Professor John Kitchin (he/him/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Thu, Aug 26, 2021 at 12:55 PM Juan Manuel Mac=C3=ADas wrote: > Hi again, > > Another simpler approach, with a filter: > > #+TITLE: The kessel run in 12 parsecs > #+AUTHOR: Han Solo !!! Chewbacca !!! Lando Calrissian > > #+BIND: org-export-filter-plain-text-functions (author-lb-filter) > #+begin_src emacs-lisp :exports results :results none > (defun author-lb-filter (text backend info) > (cond ((org-export-derived-backend-p backend 'odt) > (replace-regexp-in-string "!!!" "\n" text)) > ((org-export-derived-backend-p backend 'latex) > (replace-regexp-in-string "!!!" "\\\\\\\\" text)))) > #+end_src > > Content... > > Best regards, > > Juan Manuel > > Juan Manuel Mac=C3=ADas writes: > > > Hi Eric, > > > > I think the problem is in this two lines of `org-odt-template', that > > creates the meta.xml file inside the odt file: > > > > (format "%s\n" author) > > (format "%s\n" author) > > > > Perhaps, modifying them like this: > > > > (format "\n" > (replace-regexp-in-string "\\\\\\\\" "\n" author)) > > (format "\n" > (replace-regexp-in-string "\\\\\\\\" "\n" author)) > > > > We could do this in our documents: > > > > #+AUTHOR: Han Solo \\ Chewbacca > > > > (little tested) > > > > Best regards, > > > > Juan Manuel > > > > Eric S Fraga writes: > > > >> So, as usual, I answer my own question, sort of. > >> > >> The problem is that org exports the author text enclosed within a > >> special directives, specifically: > >> > >> (format "%s" author)) > >> > >> New line directives are not allowed within this declaration, it > >> seems. Removing (manually) the initial-creator directive then works. > >> > >> So, my question would be: is this text:initial-creator tagging > >> necessary? If not, can we remove it? The OpenDocument schema is vagu= e > >> about whether this is necessary. If we cannot remove it, i.e if > >> initial-creator is required in the document, could it be put in > >> separately (as a meta:initial-creator tag) so that the author field ca= n > >> be more general? > >> > >> I am *not* an ODT expert of any sort. But it is my route to Word > >> documents when the need arises (which is luckily seldom). > >> > >> Anyway, no panic: I can simply manually edit the odt file just before > >> the final processing... > >> > >> Thank you, > >> eric > > > > > > --0000000000004693d805ca7a9eb8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That is really nice, thanks for sharing it!
John

-------------= ----------------------
Professor John Kitchin (he/him/his)
Doherty Ha= ll A207F
Department of Chemical Engineering
Carnegie Mellon Universit= y
Pittsburgh, PA 15213
412-268-7803


On= Thu, Aug 26, 2021 at 12:55 PM Juan Manuel Mac=C3=ADas <maciaschain@posteo.net> wrote:
Hi again,

Another simpler approach, with a filter:

#+TITLE: The kessel run in 12 parsecs
#+AUTHOR: Han Solo !!! Chewbacca !!! Lando Calrissian

#+BIND: org-export-filter-plain-text-functions (author-lb-filter)
#+begin_src emacs-lisp :exports results :results none
=C2=A0 (defun author-lb-filter (text backend info)
=C2=A0 =C2=A0 (cond ((org-export-derived-backend-p backend 'odt)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(replace-regexp-in-string "!!= !" "\n" text))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((org-export-derived-backend-p backend &= #39;latex)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(replace-regexp-in-string "!!= !" "\\\\\\\\" text))))
#+end_src

Content...

Best regards,

Juan Manuel

Juan Manuel Mac=C3=ADas writes:

> Hi Eric,
>
> I think the problem is in this two lines of `org-odt-template', th= at
> creates the meta.xml file inside the odt file:
>
> (format "<dc:creator>%s</dc:creator>\n" author)<= br> > (format "<meta:initial-creator>%s</meta:initial-creator&= gt;\n" author)
>
> Perhaps, modifying them like this:
>
> (format "<dc:creator><![CDATA[%s]]></dc:creator>= ;\n" (replace-regexp-in-string "\\\\\\\\" "\n" aut= hor))
> (format "<meta:initial-creator><![CDATA[%s]]></met= a:initial-creator>\n" (replace-regexp-in-string "\\\\\\\\"= ; "\n" author))
>
> We could do this in our documents:
>
> #+AUTHOR: Han Solo \\ Chewbacca
>
> (little tested)
>
> Best regards,
>
> Juan Manuel
>
> Eric S Fraga writes:
>
>> So, as usual, I answer my own question, sort of.
>>
>> The problem is that org exports the author text enclosed within a<= br> >> special directives, specifically:
>>
>>=C2=A0 (format "<text:initial-creator>%s</text:initia= l-creator>" author))
>>
>> New line directives are not allowed within this declaration, it >> seems.=C2=A0 Removing (manually) the initial-creator directive the= n works.
>>
>> So, my question would be: is this text:initial-creator tagging
>> necessary?=C2=A0 If not, can we remove it?=C2=A0 The OpenDocument = schema is vague
>> about whether this is necessary.=C2=A0 If we cannot remove it, i.e= if
>> initial-creator is required in the document, could it be put in >> separately (as a meta:initial-creator tag) so that the author fiel= d can
>> be more general?
>>
>> I am *not* an ODT expert of any sort.=C2=A0 But it is my route to = Word
>> documents when the need arises (which is luckily seldom).
>>
>> Anyway, no panic: I can simply manually edit the odt file just bef= ore
>> the final processing...
>>
>> Thank you,
>> eric
>
>

--0000000000004693d805ca7a9eb8--