From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Citation processing via Zotero + zotxt Date: Fri, 4 Dec 2015 06:22:52 -0500 Message-ID: References: <87wpt1yj5k.fsf@berkeley.edu> <87d1uqyiva.fsf@berkeley.edu> <8737vkidgl.fsf@fastmail.fm> <878u5bdl2d.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3babe6b191e052610ba29 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4oRz-00050I-0i for emacs-orgmode@gnu.org; Fri, 04 Dec 2015 06:22:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4oRx-00040j-F2 for emacs-orgmode@gnu.org; Fri, 04 Dec 2015 06:22:55 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:32955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4oRx-000402-5t for emacs-orgmode@gnu.org; Fri, 04 Dec 2015 06:22:53 -0500 Received: by wmec201 with SMTP id c201so69405420wme.0 for ; Fri, 04 Dec 2015 03:22:52 -0800 (PST) In-Reply-To: <878u5bdl2d.fsf@fastmail.fm> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Lundin Cc: =?UTF-8?B?TWFydGluIFlyasO2bMOk?= , "emacs-orgmode@gnu.org" --001a11c3babe6b191e052610ba29 Content-Type: text/plain; charset=UTF-8 > > I am not yet convinced a citation processor will get us where we want > > because of the complexity of the external dependencies, and the > > potential/probable need for us to define new CSL files for different > > backends, or at a minimum for org-formatted citations and > > bibliographies. Hacking bst files is no fun, and it doesn't look like > > CSL files are much better! Plus you have to find them and install them > > somehow. > > As I understand it, we would not need to hack the CSL files to get org > markup. With a good processor, such as citeproc-js, it should be trivial > to modify the output format.[fn:1] > This is good. It still means adding each output somewhere. > > What CSL implementations do offer is the complexity to handle all the > nuances of multiple citation styles, languages, etc. (e.g., something > like Chicago Manual of Style footnotes). My suspicion is that it would > take years to code something in emacs-lisp that offers all of the > functionality of CSL processors. > That sounds right. bibtex was developed for a long time, and there are still efforts to improve it! > > > > http://kitchingroup.cheme.cmu.edu/blog/2015/12/03/Exporting-numbered-citations-in-html-with-unsorted-numbered-bibliography/ > > > > I am pointing this out because I think the approach I used could allow > > for plugins for different database backends, different ways to get the > > replacements, etc... you could substitute org-ref links for the > > citation syntax at some point with no real loss of generality. org-ref > > could insert the new syntax as soon as it is available in a main org > > branch. Some code will have to be rewritten to get the key under > > point, but that probably won't be too hard. > > Thanks for sharing this. I use something like this myself for *basic* > Chicago Manual of Style formatting when I can't rely on > biblatex-chicago. Might I ask: What is org-ref syntax as opposed to > citation syntax? > org-ref syntax for a citation is just a link such as cite:some-key,another-key, All the cite types in bibtex and biblatex have a link definition. Here is an example document with a citation with pre and post text. A limitation is you can only currently put pre/post text on a single citation. Org-mode is great [[cite:Dominik201408][See page 20::for example]]. bibliographystyle:unsrt bibliography:~/Dropbox/bibliography/references.bib This exports to LaTeX as \cite[See page 20][for example]{Dominik201408}. \bibliographystyle{unsrt} \bibliography{/Users/jkitchin/Dropbox/bibliography/references} I looked at an alternative syntax for pre/post text a year ago, but there doesn't seem to be much demand for it, and we don't use pre/post text. http://kitchingroup.cheme.cmu.edu/blog/2014/06/26/Another-parsing-of-links-for-citations-with-pre-and-post-text/ org-ref also provides links for labels, cross-references, index entries and glossaries, and mostly supports biblatex too. See https://github.com/jkitchin/org-ref/blob/master/org-ref.org for a pretty good intro to it. > > > Then other more advanced solutions could come along that would likely > > be superior in output quality if they use real citation processors, > > but only if there are CSLs for different backends (if I understand how > > they work). > > I don't think modifying CSL styles would be necessary. A huge number > already exist.[fn:2] I think all we would need to do is to convert the > final CSL output to org syntax, which pandoc can already do and which > citeproc-js could do with minor additions. > > Best, > Matt > > Footnotes: > > [fn:1] > See > https://bitbucket.org/fbennett/citeproc-js/src/tip/src/formats.js?fileviewer=file-view-default > > [fn:2] https://github.com/citation-style-language/styles > --001a11c3babe6b191e052610ba29 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



> I am not yet convinced a citation processor will get us where we want<= br> > because of the complexity of the external dependencies, and the
> potential/probable need for us to define new CSL files for different > backends, or at a minimum for org-formatted citations and
> bibliographies. Hacking bst files is no fun, and it doesn't look l= ike
> CSL files are much better! Plus you have to find them and install them=
> somehow.

As I understand it, we would not need to hack the CSL files to get o= rg
markup. With a good processor, such as citeproc-js, it should be trivial to modify the output format.[fn:1]

This= is good. It still means adding each output somewhere.
=C2=A0

What CSL implementations do offer is the complexity to handle all the
nuances of multiple citation styles, languages, etc. (e.g., something
like Chicago Manual of Style footnotes). My suspicion is that it would
take years to code something in emacs-lisp that offers all of the
functionality of CSL processors.

That s= ounds right. bibtex was developed for a long time, and there are still effo= rts to improve it!
=C2=A0

> http://kitchingroup.cheme.cmu.edu/blog/2015/12/= 03/Exporting-numbered-citations-in-html-with-unsorted-numbered-bibliography= /
>
> I am pointing this out because I think the approach I used could allow=
> for plugins for different database backends, different ways to get the=
> replacements, etc... you could substitute org-ref links for the
> citation syntax at some point with no real loss of generality. org-ref=
> could insert the new syntax as soon as it is available in a main org > branch. Some code will have to be rewritten to get the key under
> point, but that probably won't be too hard.

Thanks for sharing this. I use something like this myself for *basic= *
Chicago Manual of Style formatting when I can't rely on
biblatex-chicago. Might I ask: What is org-ref syntax as opposed to
citation syntax?

org-ref syntax for a c= itation is just a link such as cite:some-key,another-key, All the cite type= s in bibtex and biblatex have a link definition. Here is an example documen= t with a citation with pre and post text. A limitation is you can only curr= ently put pre/post text on a single citation.=C2=A0

Org-mode is great [[cite:Dominik201408][See page 20::for example]].<= /div>

bibliographystyle:unsrt
bibliography:~/D= ropbox/bibliography/references.bib

This expo= rts to LaTeX as=C2=A0

\cite[See page 20][for examp= le]{Dominik201408}.

\bibliographystyle{unsrt}
\bibliography{/Users/jkitchin/Dropbox/bibliography/references}
<= div>
I looked at an alternative syntax for pre/post text a ye= ar ago, but there doesn't seem to be much demand for it, and we don'= ;t use pre/post text.

=C2=A0org-ref also provides links for labels, cross-references, index en= tries and glossaries, and mostly supports biblatex too. See=C2=A0https://githu= b.com/jkitchin/org-ref/blob/master/org-ref.org for a pretty good intro = to it.
=C2=A0

>=C2=A0 Then other more advanced solutions could come along that would l= ikely
> be superior in output quality if they use real citation processors, > but only if there are CSLs for different backends (if I understand how=
> they work).

I don't think modifying CSL styles would be necessary. A huge nu= mber
already exist.[fn:2] I think all we would need to do is to convert the
final CSL output to org syntax, which pandoc can already do and which
citeproc-js could do with minor additions.

Best,
Matt

Footnotes:

[fn:1]
See = https://bitbucket.org/fbennett/citeproc-js/src/tip/src/formats.js?fileviewe= r=3Dfile-view-default

[fn:2] https://github.com/citation-style-language/s= tyles

--001a11c3babe6b191e052610ba29--