emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: "András Simonyi" <andras.simonyi@gmail.com>
Cc: emacs-orgmode list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH][oc-csl] Improve reference parsing
Date: Wed, 02 Nov 2022 06:29:13 +0000	[thread overview]
Message-ID: <87k04dlvie.fsf@localhost> (raw)
In-Reply-To: <CAOWRwxCWPeNPjMEyH0f5SwR4M5psoj0NMZF8KHH_bHpVatBt5w@mail.gmail.com>

András Simonyi <andras.simonyi@gmail.com> writes:

> thanks for pointing out the problem!! I've attached a new version of
> the patch, in which the custom exporter backend has an (in many cases
> trivial) translator for all currently allowed objects.

Thanks!

>> And we may add more, as discussed in
>> https://orgmode.org/list/87k04xhhw3.fsf@localhost
>
> I don't think that it would make much sense to add a lot more, with
> the possible exception of links, since citations are at most
> sentence-sized textual units, not to mention the possible
> complications arising for the existing export processors. (What type
> of objects could the various LaTeX-based exporters support without
> complex changes?)  Since CSL has only a few types of formatting
> attributes (font-style, font-variant, font-weight, text-decoration and
> vertical-align), if the set of allowed object is radically expanded
> then it will probably be more reasonable to define a derived backed,
> maybe based on the ascii exporter, but I feel that the current set
> doesn't require this solution.

I do not think that CSL limitations are really limiting us.

- Allowing macros will be handled by ox.el itself automatically
- Export snippets can also be processed without much issue (consider
  direct LaTeX code)
- inline-babel-call and inline src blocks may be useful with :exports
  results when some auto-generation of text is needed. They will also be
  handled automatically by ob-exp.
- latex-fragments are either equivalent to direct LaTeX or to inserting
  an image
- timestamps could be exported as text, although I do not see any
  obvious utility of timestamps inside references.

However, oc-csl should not ignore the export processor to support all
the above. I am not sure why you need a dedicated export processor
instead of passing the string to current processor (or derivative)
instead.

If you really need to mark certain constructs specially for CSL, you can
create a derived export backend for the current backend and replace the
transcoders for the object types that must be treated specially.

> +(defconst org-cite-csl--export-backend
> +  (org-export-create-backend 
> +   :transcoders
> +   '((bold . (lambda (_bold contents _info) (format "<b>%s</b>" contents)))
> +     (code . org-cite-csl--element-value)
> +     (entity . (lambda (entity _contents _info)
> +                 (format "\\%s" (org-element-property :name entity))))

Why :name, but not :html?

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


  reply	other threads:[~2022-11-02  6:29 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 [this message]
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

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=87k04dlvie.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).