emacs-humanities
[Top][All Lists]
Advanced

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

Re: [emacs-humanities] Footnote on author


From: Marvin Gülker
Subject: Re: [emacs-humanities] Footnote on author
Date: Tue, 23 Jan 2024 16:38:59 +0100

Am Dienstag, dem 23. Januar 2024 schrieb Juan Manuel Macías:
> In LaTeX you can use the \thanks command with a macro:
>
> #+macro: thanks @@latex:\thanks{$1}@@
>
> #+TITLE: Test
> #+AUTHOR: John Doe {{{thanks(John Doe is an important researcher at some 
> university.)}}}

That is quite nice for the LaTeX part indeed. I tried to expand this to
ODT export as follows:

--8<---------------cut here---------------start------------->8---
#+MACRO: authorfn @@latex:\thanks{$1}@@@@odt:<text:note text:id="authorfn" 
text:note-class="footnote"><text:note-citation 
text:label="*">*</text:note-citation><text:note-body><text:p 
text:style-name="Footnote">$1</text:p></text:note-body></text:note>@@
#+AUTHOR: John Doe{{{authorfn(John Doe is an important researcher at some 
university.)}}}
--8<---------------cut here---------------end--------------->8---

I found the required ODT XML by inserting the required footnote in
LibreOffice manually and then inspecting the output ODT file. However,
this does not work, because org's exporter it generates the following
invalid XML nesting:

--8<---------------cut here---------------start------------->8---
<text:initial-creator>John Doe
        <text:note text:id="authorfn" text:note-class="footnote">
          <text:note-citation text:label="*">*</text:note-citation>
          <text:note-body>
            <text:p text:style-name="Footnote">John Doe is an important 
researcher at some university.</text:p>
          </text:note-body>
        </text:note></text:initial-creator>
--8<---------------cut here---------------end--------------->8---

Trying to open that document in LibreOffice does not display the
footnote at all, presumly because it violates the ODT XML schema.

The correct output should have beeen (as per my manually edited ODT
document):

--8<---------------cut here---------------start------------->8---
<text:initial-creator>John Doe</text:initial-creator>
        <text:note text:id="ftn0" text:note-class="footnote">
          <text:note-citation text:label="*">*</text:note-citation>
          <text:note-body>
            <text:p text:style-name="P2">John Doe is an important researcher at 
some university.</text:p>
          </text:note-body>
        </text:note>
--8<---------------cut here---------------end--------------->8---

Notice how LibreOffice has appended the footnote *after*
</text:initial-creator>, whereas the macro trick inserted the footnote
*inside* that XML element. How can I get it to insert the footnote
*after* </text:initial-creator>?

    Marvin

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kontakt@guelker.eu    | O<



reply via email to

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