emacs-orgmode
[Top][All Lists]
Advanced

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

Re: how to get multi-line author in ODT export?


From: Juan Manuel Macías
Subject: Re: how to get multi-line author in ODT export?
Date: Fri, 27 Aug 2021 01:46:21 +0000

Hi John,

you're welcome. I realized that in these lines of the meta.xml file:

<dc:creator> ... </dc:creator>
<meta:initial-creator> ... </meta:initial-creator>

line breaks can be achieved simply by adding a new line without marks (as
discussed in this thread:
https://stackoverflow.com/questions/10917555/adding-a-new-line-break-tag-in-xml/10923392)

Best regards,

Juan Manuel

John Kitchin writes:

> 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ías
> <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
>       (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ías 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 "<dc:creator>%s</dc:creator>\n" author)
>     > (format "<meta:initial-creator>%s</meta:initial-creator>\n"
>     author)
>     >
>     > Perhaps, modifying them like this:
>     >
>     > (format "<dc:creator><![CDATA[%s]]></dc:creator>\n"
>     (replace-regexp-in-string "\\\\\\\\" "\n" author))
>     > (format "<meta:initial-creator><![CDATA
>     [%s]]></meta: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
>     >> special directives, specifically:
>     >>
>     >>  (format "<text:initial-creator>%s</text:initial-creator>"
>     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 vague
>     >> 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 can
>     >> 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
>     >
>     >
>



reply via email to

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