From: Ihor Radchenko <yantar92@posteo.net>
To: "András Simonyi" <andras.simonyi@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH][oc-csl] Improve reference parsing
Date: Thu, 26 Jan 2023 09:43:31 +0000 [thread overview]
Message-ID: <87ilgtwrzw.fsf@localhost> (raw)
In-Reply-To: <CAOWRwxD3pSfao7+G145naE=jaAz6=m2BjvUX0rj_c4r8qeu7rQ@mail.gmail.com>
[ Adding Org ML back to CC ]
András Simonyi <andras.simonyi@gmail.com> writes:
> On Thu, 19 Jan 2023 at 10:56, Ihor Radchenko <yantar92@posteo.net> wrote:
>> So, do I understand correctly that italics, bold, subscript,
>> superscript, small-caps, and nocase must be passed to the CSL processor
>> in a format understood by CSL? Everything else could just be left in Org
>> and later exported according to actual export settings?
>
> Unfortunately, the situation is a bit different -- the solution I see
> the most viable is to export the affixes and the locator to a form in
> which
> the markup elements you listed (plus links, which I haven't mentioned
> but are also supported) are in the required CSL
> input form, but the rest is in plain text.
What do you mean by plain text? Plain text as in Org or plain text as in
ASCII export?
> Anything else would be way
> more complicated to handle in Citeproc and I don't
> really see the benefits/use-case either (we are talking about elements
> within a citation). This would "only" require a custom backend
> exporting CSL-supported elements in the html-like CSL format and
> everything else which is allowed by the Org syntax
> in plain text.
I am not much concerned about CSL format itself.
I am concerned about the formatted citation returned back to Org by CSL.
Consider the following:
[cite:Prefix *bold* +strike-through+ @key]
It will be interpreted by Org export as
(citation
(:style nil ...)
(citation-reference
(:key "key"... :prefix
("Prefix "
(bold
(... :post-blank 1 ...)
"bold")
(strike-through
(... :post-blank 1 ...)
"strike-through")))))
Now, consider that the user has a custom export filter that decorates
"+strike-through+" like "!!strike-through!!" upon export.
If we pass the original citation to the CSL, will the export filter be
applied?
Also, what if user decorates a CSL locator with Org markup like
strike-through?
>> May we:
>> 1. Convert the Org markup supported by CSL into CSL-understood HTML
>> format
>> 2. Convert all other Org markup into verbatim
>
> I'm not sure what you mean by verbatim -- leaving it as Org markup?
Whatever prevents CSL from altering the text. (Like escaping "_" you
mentioned earlier)
>> 3. Convert back non-verbatim markup altered by CSL into Org
>> 4. Perform exporting Org->current export backend as usual.
>
> If verbatim is Org then step 3 could be rather complicated, we'd need
> to identify
> the Org fragments in citeproc's HTML and LaTeX output when those
> backends are used.
But can't CSL output in Org format? Isn't the whole CSL thing supposed
to work for arbitrary export backend, not just HTML and LaTeX?
> Also I'd worry that the result would not pass through Citeproc's
> post-processing steps --
> there is now a user-customizable hook variable for citation post-processing
> which acts on the internal representations.
I envision the conversion back to Org to happen after _all_ the
Citeproc's processing, be it user-customized or not.
> All in all I'd first concentrate on the use-case: is there anything
> important left out
> if we go with simply using a custom backend to export the CSL-supported markup
> in CSL input format and everything else as plain text, then do what we
> do know, namely
> either simply insert the Citeproc-formatted output into the exported document
> without any post-processing (currently this is for LaTeX and HTML), or
> parse and export
> with Org when the Org Citeproc formatter is used (currently for all
> other formats),
What I imagine is doing "parse and export with Org" all the time,
including HTML and LaTeX export.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
prev parent reply other threads:[~2023-01-26 9:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 15:40 [PATCH][oc-csl] Improve reference parsing András Simonyi
2022-10-27 4:10 ` Ihor Radchenko
2022-11-01 15:02 ` András Simonyi
2022-11-02 6:29 ` Ihor Radchenko
2022-11-02 17:58 ` András Simonyi
2022-11-03 6:34 ` Ihor Radchenko
2023-01-07 12:50 ` M. ‘quintus’ Gülker
2023-01-15 8:56 ` Ihor Radchenko
2023-01-18 23:08 ` András Simonyi
2023-01-19 8:21 ` M. ‘quintus’ Gülker
2023-01-19 9:35 ` András Simonyi
2023-01-19 9:59 ` Ihor Radchenko
2023-01-19 10:11 ` M. ‘quintus’ Gülker
2023-01-25 22:44 ` András Simonyi
2023-01-19 9:56 ` Ihor Radchenko
[not found] ` <CAOWRwxD3pSfao7+G145naE=jaAz6=m2BjvUX0rj_c4r8qeu7rQ@mail.gmail.com>
2023-01-26 9:43 ` Ihor Radchenko [this message]
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=87ilgtwrzw.fsf@localhost \
--to=yantar92@posteo.net \
--cc=andras.simonyi@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).