emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Richard Lawrence <richard.lawrence@berkeley.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: Citation syntax: a revised proposal
Date: Tue, 10 Mar 2015 23:21:33 -0300	[thread overview]
Message-ID: <871tkwmh87.fsf@gmail.com> (raw)
In-Reply-To: <87ioe8yftp.fsf@berkeley.edu>

Hi Richard,

Thanks for your comments, and for your work on an implementation.

2015ko martxoak 10an, Richard Lawrence-ek idatzi zuen:
> I have actually been working on the same problem, using citeproc-hs as
> the CSL processor instead of citeproc-java.

This is an interesting approach.  What version of citeproc-hs are you
using?  The version under that name is no longer maintained, and I had
some trouble getting it to build.  The pandoc fork (under the name
pandoc-citeproc) seemed to me to lack command-line functionality.  (But
I only looked briefly and could have missed something.)

> I took a (very) brief look at your code; it seems like you are only
> communicating with citeproc-java via command line arguments and stdout.
> Is that right?

Yes.

>
> My approach to the problems you mention has been the following:
>   1) Generate JSON from citation objects on the Org side.
>   2) Pass that JSON to the processor via stdin.
>   3) Pass the output format, the CSL file, and the bibliography database
>      to the processor via command line arguments.
>   4) Return, to stdout, the formatted citations and the bibliography.
>      These are formatted such that there is one citation or entry per line,
>      and a recognizable separator separates the citations from the
>      bibliography.
>
> This allows passing formatting options for individual citations via the
> JSON object for that citation, so it allows citeproc-hs to do more of
> the work of formatting citations.
>
> (See http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#citation-data-object
> for documentation of the citation data JSON format.)

Very interesting.  But it looks like the CSL standard does not
differentiate parenthesized/not and capitalized/not citations, whereas
biblatex (taken as the best representative of the latex family of
citation processors) does.  I think we have decided we need to support
these.  So we will always need to do some post-processing of the CSL
output.  Then the question arises (for example) whether it’s better to
let CSL/citeproc handle the prefix and suffix, or to do it ourselves.

I don’t think we can decide this without looking at a working “sketch”
of both implementations.  It would be very good to see your draft code.

>
> I don't know whether this will ultimately be a good design, but the way
> I am picturing it right now is that exporting citations will work sort
> of like footnotes: the exporter will gather them all together as they
> are encountered, then generate the JSON and run a single call to the CSL
> processor at the end of the export process.  It can then replace the
> citations in the document with the result from the CSL processor, and
> insert the bibliography at the end of the document.

My code does something similar.  It processes all citations at the
beginning of export and stashes the data in the info plist, so that
it’s available to transcoders during the “main” export process.  IDK if
footnotes are handled in the same way, or rather processed in a late
step after the transcoders.  But it’s six of one, half a dozen of the
other I think.

>
> (The code is not very pretty yet, but it does generate citations and
> bibliographies in both plain text and HTML, and it would be
> straightforward to extend it to other output formats.  I can post it
> somewhere if anyone is interested in taking a look.)

Please do!

>
>> Some people have talked about supporting other CSL processors.  I don’t
>> see much utility in that, since CSL is a standard that all processors
>> should implement faithfully.
>
> Indeed!  Though as you have observed, `should' and `already does' come
> apart.  I doubt there are any implementations that are perfectly
> complete.  So it may be worth thinking about how Org can talk to CSL
> processors in a processor-independent way.  That way, different users
> can use different CSL processors if one works better for their
> particular document or environment.

I take your point, but any differences in the implementation just make
it potentially harder to be processor-independent.  I think we should
tightly integrate with one processor, working around whatever warts it
may have.

>
> I think the generate-and-pass-JSON approach is promising for that
> reason.  That is what citeproc-js accepts as input (so maybe that is
> what citeproc-java is doing internally?), and my code aims to allow
> citeproc-hs to interpret the same JSON format as citeproc-js.

... hmm.  Do you mean you’ve written Haskell code?

> I don't know Ruby, but I think it would be easy to make citeproc-ruby
> accept the same JSON format.  Do you have a sense of how easy it would
> be to coax citeproc-java into accepting JSON on stdin?

My understanding is that citeproc-java in its current form can read JSON
database files (in addition to bibtex).  However, it does not accept JSON
to control output of citations – it merely allows passing a key, for
which a “default” citation will be generated (no prefix/suffix/author
suppression/...).

It would not be easy for me to extend it, because I’m not fluent in
Java.

Thanks,

--
Aaron Ecay

  reply	other threads:[~2015-03-11  2:21 UTC|newest]

Thread overview: 163+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-15  2:29 Citation syntax: a revised proposal Richard Lawrence
2015-02-15  2:45 ` Richard Lawrence
2015-02-15  3:57 ` Thomas S. Dye
2015-02-15 16:40   ` Richard Lawrence
2015-02-15 19:43     ` Thomas S. Dye
2015-02-16  3:34       ` Matt Price
2015-02-16  8:56         ` Nicolas Goaziou
2015-02-16  9:57         ` Rasmus
2015-02-17 17:18       ` Richard Lawrence
2015-02-17 18:11         ` Rasmus
2015-02-18  0:44           ` Matt Price
2015-02-18  3:38           ` Richard Lawrence
2015-02-18  2:24         ` Thomas S. Dye
2015-02-18  4:03           ` Richard Lawrence
2015-02-18  9:00             ` Stefan Nobis
2015-02-18 10:11             ` Eric S Fraga
2015-02-18 14:19             ` Nicolas Goaziou
2015-02-18 16:38               ` Richard Lawrence
2015-02-18 18:44                 ` Samuel Wales
2015-02-18 18:46                   ` Samuel Wales
2015-02-18 20:54                   ` Aaron Ecay
2015-02-18 21:21                     ` Samuel Wales
2015-02-18 21:24                     ` John Kitchin
2015-02-18 19:42                 ` Nicolas Goaziou
2015-02-18 20:47                   ` Aaron Ecay
2015-02-18 22:43                     ` Rasmus
2015-02-18 22:35                   ` Rasmus
2015-02-19 17:06                   ` Richard Lawrence
2015-02-20  0:10                     ` Nicolas Goaziou
2015-02-20 16:44                       ` Richard Lawrence
2015-02-20 19:45                         ` Samuel Wales
2015-02-20 20:01                           ` Rasmus
2015-02-20 22:33                             ` Samuel Wales
2015-02-21 11:58                               ` Rasmus
2015-02-21 17:25                                 ` Thomas S. Dye
2015-02-27  0:56                                 ` Samuel Wales
2015-02-27  8:55                                   ` Stefan Nobis
2015-02-27  9:56                                   ` Rasmus
2015-02-21  3:12                           ` Richard Lawrence
2015-02-21 12:00                             ` Rasmus
2015-02-21 20:19                             ` Samuel Wales
2015-02-21 20:36                             ` Samuel Wales
2015-02-25 13:59                         ` Aaron Ecay
2015-02-25 16:57                           ` Richard Lawrence
2015-02-25 22:37                             ` Nicolas Goaziou
2015-02-26  5:10                               ` Richard Lawrence
2015-03-01 20:35                                 ` Nicolas Goaziou
2015-03-01 21:31                                   ` Rasmus
2015-03-02  0:24                                     ` Thomas S. Dye
2015-03-02  8:57                                       ` Eric S Fraga
2015-03-02  1:37                                     ` Thomas S. Dye
2015-03-02  9:23                                       ` Rasmus
2015-03-02 19:11                                     ` Aaron Ecay
2015-03-02 20:15                                       ` Rasmus
2015-03-03  3:14                                       ` Richard Lawrence
2015-03-03  5:33                                         ` Avram Lyon
2015-03-03 17:27                                           ` Richard Lawrence
2015-03-03 17:56                                             ` Avram Lyon
2015-03-04 16:41                                               ` Richard Lawrence
2015-03-03  9:24                                         ` Rasmus
2015-03-03  9:39                                           ` Rasmus
2015-03-03 14:12                                         ` Aaron Ecay
2015-03-02 18:50                                   ` Richard Lawrence
2015-03-02 20:14                                     ` Nicolas Goaziou
2015-03-02 20:34                                       ` Rasmus
2015-03-02 22:17                                         ` Nicolas Goaziou
2015-03-02 22:33                                           ` Rasmus
2015-03-02 22:45                                             ` Nicolas Goaziou
2015-03-02 23:05                                               ` Rasmus
2015-03-02 23:27                                                 ` Nicolas Goaziou
2015-03-02 23:42                                                   ` Rasmus
2015-03-03  2:48                                       ` Richard Lawrence
2015-03-03  8:43                                         ` Nicolas Goaziou
2015-03-03 16:59                                           ` Richard Lawrence
2015-03-04  0:43                                           ` Matt Price
2015-03-08  0:16                                         ` Nicolas Goaziou
2015-03-03 14:23                                     ` Aaron Ecay
2015-03-02 18:54                                   ` Aaron Ecay
2015-03-02 20:26                                     ` Nicolas Goaziou
2015-03-03  2:53                                       ` Richard Lawrence
2015-03-03  8:38                                         ` Nicolas Goaziou
2015-03-03  9:13                                           ` Rasmus
2015-03-03 16:12                                             ` Richard Lawrence
2015-03-03 14:25                                       ` Aaron Ecay
2015-03-02 20:53                                     ` Rasmus
2015-03-03 14:57                                       ` Aaron Ecay
2015-03-03 15:41                                         ` Rasmus
2015-03-03 15:58                                           ` Ken Mankoff
2015-03-03 16:08                                             ` Rasmus
2015-03-03 17:13                                         ` Richard Lawrence
2015-03-10  3:44                                     ` Aaron Ecay
2015-03-10  9:49                                       ` Rasmus
2015-03-11  1:51                                         ` Aaron Ecay
2015-03-11  6:04                                           ` Thomas S. Dye
2015-03-10 16:31                                       ` Richard Lawrence
2015-03-11  2:21                                         ` Aaron Ecay [this message]
2015-03-11 17:33                                           ` Richard Lawrence
2015-03-13 18:13                                             ` Richard Lawrence
2015-03-17  5:15                                               ` Richard Lawrence
2015-03-17  9:27                                                 ` Andreas Leha
2015-03-17 16:26                                                   ` Richard Lawrence
2015-03-17 20:42                                                     ` Andreas Leha
2015-03-17 21:34                                                       ` Richard Lawrence
2015-03-18  1:12                                                     ` Matt Price
2015-03-18 15:19                                                       ` Richard Lawrence
2015-02-25 18:08                           ` Thomas S. Dye
2015-02-26 21:30                             ` Aaron Ecay
2015-02-26 23:50                               ` Thomas S. Dye
2015-02-27  8:49                               ` Stefan Nobis
2015-02-27 16:35                                 ` Richard Lawrence
2015-02-27 10:09                               ` Rasmus
2015-03-02  5:48                               ` Thomas S. Dye
2015-03-02 12:22                                 ` Aaron Ecay
2015-03-02 13:53                                   ` Thomas S. Dye
2015-03-02 19:02                                     ` Aaron Ecay
2015-02-20  5:27                     ` Melanie Bacou
2015-02-20 16:49                       ` Richard Lawrence
2015-02-24  7:08         ` Vaidheeswaran C
2015-02-25  4:29           ` Richard Lawrence
2015-02-25  5:57             ` Vaidheeswaran C
2015-02-15 11:17 ` Tory S. Anderson
2015-02-15 11:57 ` Rasmus
2015-02-15 17:05   ` Richard Lawrence
2015-02-16  8:53     ` Stefan Nobis
2015-02-16 17:52       ` Thomas S. Dye
2015-02-15 17:23   ` Nicolas Goaziou
2015-03-09 10:40     ` Sebastien Vauban
2015-03-09 10:50       ` Vaidheeswaran C
2015-02-15 17:19 ` Nicolas Goaziou
2015-02-15 17:37   ` Rasmus
2015-02-15 17:55     ` Nicolas Goaziou
2015-02-15 19:30     ` John Kitchin
2015-02-15 18:07   ` Richard Lawrence
2015-02-15 18:25     ` Nicolas Goaziou
2015-02-15 19:05       ` Aaron Ecay
2015-02-15 19:18         ` Nicolas Goaziou
2015-02-15 19:38           ` Aaron Ecay
2015-02-15 20:13             ` Nicolas Goaziou
2015-02-15 20:23               ` Rasmus
2015-02-16  9:07               ` Stefan Nobis
2015-02-16 16:59               ` Richard Lawrence
2015-02-16 17:43                 ` Nicolas Goaziou
2015-02-16 18:39                   ` Rasmus
2015-02-16 19:16                     ` Thomas S. Dye
2015-02-16 19:40                       ` Rasmus
2015-02-15 20:49 ` John Kitchin
2015-02-16 16:18   ` Richard Lawrence
2015-02-16 18:21     ` John Kitchin
2015-02-16 12:05 ` Eric S Fraga
2015-02-16 13:10   ` William Denton
2015-02-16 13:42   ` John Kitchin
2015-02-16 16:19     ` Nicolas Goaziou
2015-02-16 17:28       ` John Kitchin
2015-02-16 18:49         ` Rasmus
2015-02-16 19:16           ` John Kitchin
2015-02-23  7:26       ` Vaidheeswaran
2015-02-16 16:35     ` Jorge A. Alfaro-Murillo
2015-02-16 17:56       ` Stefan Nobis
2015-02-16 18:24         ` John Kitchin
2015-02-16 18:39           ` Jorge A. Alfaro-Murillo
2015-02-16 19:19         ` Jorge A. Alfaro-Murillo
2015-02-17  6:47           ` Stefan Nobis
2015-02-16 16:45   ` Richard Lawrence

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=871tkwmh87.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=richard.lawrence@berkeley.edu \
    /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).