ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Denis Maier via ntg-context <ntg-context@ntg.nl>
To: <taco@elvenkind.com>, <ntg-context@ntg.nl>
Cc: denis.maier@unibe.ch
Subject: Re: Citeproc-lua
Date: Fri, 6 May 2022 21:02:06 +0000	[thread overview]
Message-ID: <b542dfd93bd644f3bdeeec4f8efcc3c1@unibe.ch> (raw)
In-Reply-To: <206BFE27-9FD0-4E48-8D03-85346FA27D94@elvenkind.com>

Hi,
thanks for your assessment. Indeed, that looks very promising.

I've now had a chance to look at this a bit more too.  Not that I understand that stuff in detail, but anyway...

I also have the impression that extending citeproc-formats.lua should be the easiest part. As an aside, I think the HTML is in there because that is needed for the test suite, but for ConTeXt we should be able to copy the LaTeX mapping and tweak a few things here and there.

The LaTeX package is hard to understand, at least if you're not used to the "new" latex3 programming syntax and style. I also can only guess what that stuff does. But as you say this is rather isolated from the citeproc processing, so I guess the main task would be to come up with an equivalent ConTeXt module that writes the citations to the tuc file, calls the citeproc engine, and uses the results for the output. Right? (I.e., AFAICS, everything that lives under https://github.com/zepinglee/citeproc-lua/tree/main/citeproc should pretty much just work, while https://github.com/zepinglee/citeproc-lua/tree/main/latex must be adapted.)

For the record: the relevant stuff in the aux file looks like this:
\bibstyle {apa}
\bibdata {examples.bib}
\csloptions {}
\citation {{texbook@1}{{id={texbook},label={page},locator={12}}}{1}}
\citation {{latex2e@1}{{id={latex2e},prefix={see }}}{1}}
\citation {{texbook@2}{{id={texbook},prefix={see },label={page},locator={12}}}{1}}
\citation {{texbook@3}{{id={texbook},prefix={see },suffix={, everywhere}}}{1}}
\citation {{texbook@4}{{id={texbook},prefix={see },label={page},locator={12, and passim}}}{1}}

But I guess that's the way these things work in latex, and adding that stuff to a lua table will probably save us much trouble anyway. (E.g., no need for https://github.com/zepinglee/citeproc-lua/blob/main/latex/citeproc#L81, or https://github.com/zepinglee/citeproc-lua/blob/main/latex/csl-core.lua#L168)

Regarding the citation commands, I've noticed that while biblatex's syntax model (\cite[prenote][postnote]{key}, e.g. \cite[see][34]{doe}) is supported, the preferred method is actually \cite[prefix={See }, page={34}]{doe}. But that's of course not so important since the important question is how that stuff is passed to the citeproc.

Best,
Denis



> -----Ursprüngliche Nachricht-----
> Von: Taco Hoekwater <taco@elvenkind.com>
> Gesendet: Freitag, 6. Mai 2022 14:57
> An: mailing list for ConTeXt users <ntg-context@ntg.nl>
> Cc: Maier, Denis Christian (UB) <denis.maier@unibe.ch>
> Betreff: Re: [NTG-context] Citeproc-lua
> 
> Hi,
> 
> I had a quick look at this and it seems very extensible if-not-quite ConTeXt-
> ready right away.
> 
> On the input side, it reads a LaTeX .aux file to parse things like options,
> databases, and requested citations.
> For this, it uses a dedicated “citeproc” lua script that should be easy to
> modify/copy for someone who knows what is actually in the ConTeXt .tuc
> file.
> 
> On the output side, it uses a lookup table to generate the desired markup (in
> citeproc-formats.lua). Right now, there are definitions provided for HTML
> and LaTeX, but that is very simple to extend.
> 
> There is a LaTeX package for the integration (making sure the right
> commands appear in the aux file, option processing, et cetera), and that file I
> do not understand *at all*. It seems to be completely isolated from the core
> citeproc processing, though.
> 
> Very promising stuff, I think.
> 
> But: I personally do not understand how to do the integration with ConTeXt’s
> new biblio system. I only understand half of what ConTeXt does these days,
> and much less of what the LaTeX package is trying to achieve i.r.t. options.
> 
> Best wishes,
> Taco
> 
> > On 3 May 2022, at 22:00, Denis Maier via ntg-context <ntg-
> context@ntg.nl> wrote:
> >
> > Hi,
> >
> > I just came across this: https://github.com/zepinglee/citeproc-lua
> > Thats’s an lua implemenation of the CSL language targeting LaTeX.
> > I don’t know if the processor itself contains any LaTeX specific code,
> > but it looks like the integration basically happens here
> > :https://github.com/zepinglee/citeproc-lua/blob/main/latex/citation-st
> > yle-language.sty So, at least in theory, shouldn’t it be possible to
> > make this workable also with context?
> >
> > Best,
> > Denis
> >
> ______________________________________________________________
> ________
> > _____________ If your question is of interest to others as well,
> > please add an entry to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki     : http://contextgarden.net
> >
> ______________________________________________________________
> ________
> > _____________
> 
> Taco Hoekwater
> Elvenkind BV
> 
> 
> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2022-05-06 21:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 20:00 Citeproc-lua Denis Maier via ntg-context
2022-05-06 12:57 ` Citeproc-lua Taco Hoekwater via ntg-context
2022-05-06 13:20   ` Citeproc-lua Hans Hagen via ntg-context
2022-05-06 21:02   ` Denis Maier via ntg-context [this message]
2022-05-06 21:09     ` Citeproc-lua Aditya Mahajan via ntg-context
2022-05-06 21:26       ` Citeproc-lua Hans Hagen via ntg-context
2022-05-06 21:44     ` Citeproc-lua Hans Hagen via ntg-context
2022-05-06 22:04       ` Citeproc-lua Denis Maier via ntg-context
2022-05-06 22:33       ` Citeproc-lua Denis Maier via ntg-context
2022-05-06 23:15         ` Citeproc-lua Hans Hagen via ntg-context
2022-05-07 10:22           ` Citeproc-lua Denis Maier via ntg-context
2022-05-06 22:56       ` Citeproc-lua Rik Kabel via ntg-context

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b542dfd93bd644f3bdeeec4f8efcc3c1@unibe.ch \
    --to=ntg-context@ntg.nl \
    --cc=denis.maier@unibe.ch \
    --cc=taco@elvenkind.com \
    /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.
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 NNTP newsgroup(s).