emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "M. ‘quintus’ Gülker" <post+orgmodeml@guelker.eu>
To: emacs-orgmode@gnu.org
Subject: [bug] Macro in citation not expanded
Date: Sun, 16 Oct 2022 11:07:49 +0200	[thread overview]
Message-ID: <8735bot9dp.fsf@guelker.eu> (raw)

Dear list,

it turns out that macros in citation commands are not expanded. Minimal
working example:


    #+TITLE: Test
    #+LANGUAGE: de
    #+bibliography: /tmp/mwe.bib
    #+cite_export: csl /tmp/juristische-schulung.csl
    #+MACRO: name @@latex:\textsc{$1}@@
    Dies {{{name(Foo)}}}  ist ein Test. [cite:@doe2022nothing p. 55,, zum vorgenannten Argument {{{name(Doe)}}} aaO.]

/tmp/mwe.bib is:

    author       = {John Doe},
    title        = {Nothing Important},
    year      = {2022},
    edition   = {2},
    publisher = {Some Publisher},
    location  = {Nowhere},
    langid    = {english}}

/tmp/juristische-schulung.csl is <https://github.com/citation-style-language/styles/blob/e22b8a566bad9b4c7f52720f60dd875057a5d210/juristische-schulung.csl>.

Exporting this to LaTeX yields:

    Dies \textsc{Foo}  ist ein Test.\footnote{\textit{Doe}, Nothing important, 2. Aufl. (2022), 55, zum vorgenannten Argument \{\{\{name(Doe)\}\}\} aaO.}

This replaces the first call to the `name' macro properly, but it does
not replace the call to the `name' macro inside the `cite:' construct.
Instead, it copies the macro construct verbatim into the LaTeX footnote.
The correct output should have been:

    Dies \textsc{Foo}  ist ein Test.\footnote{\textit{Doe}, Nothing important, 2. Aufl. (2022), 55, zum vorgenannten Argument \textsc{Doe} aaO.}

Version information:

Org mode version 9.6-pre (release_9.5-1162-g15b3aa @ /home/quintus/.emacs.d/org-mode/lisp/)
citeproc.el @ ba49516265fa24b138346c4918d39d19b4de8a62
GNU Emacs 27.2 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.31, cairo version 1.16.0)


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

             reply	other threads:[~2022-10-16  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16  9:07 M. ‘quintus’ Gülker [this message]
2022-10-16  9:32 ` [bug] Macro in citation not expanded Ihor Radchenko
2022-10-17 17:11   ` M. ‘quintus’ Gülker
2022-10-18  4:31     ` [RFC PATCH] " Ihor Radchenko
2022-11-11 20:50       ` M. ‘quintus’ Gülker
2022-11-13  4:12         ` Ihor Radchenko
2024-01-24 11:30       ` Ihor Radchenko

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:

  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=8735bot9dp.fsf@guelker.eu \
    --to=post+orgmodeml@guelker.eu \
    --cc=emacs-orgmode@gnu.org \


* 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


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).