emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* State of the art in citations
@ 2014-04-25 12:11 Julian M. Burgos
  2014-04-25 15:42 ` Grant Rettke
  0 siblings, 1 reply; 22+ messages in thread
From: Julian M. Burgos @ 2014-04-25 12:11 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

I use org-mode to write scientific papers, exporting mostly to LaTex/pdf
(and sometimes to Word via ODT when I have to collaborate with less
enlightened colleagues).  I keep my references in a .bib file, and so
far I have been using bibtex in a more or less standard way, using
reftex to insert citations in the documents.  

I am planning in revamping the way I deal with citations, and I was
wondering if I can get your opinions in what is the "state of the art"
in using citations in org-mode, in particular

- Should I use biblatex instead of bibtex?  
- Are there any contributed packages that I should consider?
- What would be the best way to get citations into html or odt?

Any comments or tips will be welcomed!
All the best,

Julian

-- 
Julian Mariano Burgos, PhD
Hafrannsóknastofnun/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian@hafro.is

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-25 12:11 State of the art in citations Julian M. Burgos
@ 2014-04-25 15:42 ` Grant Rettke
  0 siblings, 0 replies; 22+ messages in thread
From: Grant Rettke @ 2014-04-25 15:42 UTC (permalink / raw)
  To: Julian M. Burgos; +Cc: emacs-orgmode

Is there a sub-group dedicated to this?

It is on my TODO list to catch up on the state of the art, too.
Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
grettke@acm.org | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Fri, Apr 25, 2014 at 7:11 AM, Julian M. Burgos <julian@hafro.is> wrote:
> Dear list,
>
> I use org-mode to write scientific papers, exporting mostly to LaTex/pdf
> (and sometimes to Word via ODT when I have to collaborate with less
> enlightened colleagues).  I keep my references in a .bib file, and so
> far I have been using bibtex in a more or less standard way, using
> reftex to insert citations in the documents.
>
> I am planning in revamping the way I deal with citations, and I was
> wondering if I can get your opinions in what is the "state of the art"
> in using citations in org-mode, in particular
>
> - Should I use biblatex instead of bibtex?
> - Are there any contributed packages that I should consider?
> - What would be the best way to get citations into html or odt?
>
> Any comments or tips will be welcomed!
> All the best,
>
> Julian
>
> --
> Julian Mariano Burgos, PhD
> Hafrannsóknastofnun/Marine Research Institute
> Skúlagata 4, 121 Reykjavík, Iceland
> Sími/Telephone : +354-5752037
> Bréfsími/Telefax:  +354-5752001
> Netfang/Email: julian@hafro.is
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-29  9:30 ` Vikas Rawal Lists
@ 2014-04-29 15:36   ` Richard Lawrence
  0 siblings, 0 replies; 22+ messages in thread
From: Richard Lawrence @ 2014-04-29 15:36 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Vikas Rawal Lists

Hi Vikas,

Vikas Rawal Lists <vikaslists@agrarianresearch.org> writes:

> On 26-Apr-2014, at 6:56 pm, Clément B. <clement@inventati.org> wrote:
>
>> Hi all,
>> 
>>> - Should I use biblatex instead of bibtex?  
>> 
>> You should. It is very powerful and straightforward. The manual
>> is great.
>
> Is the choice so clearcut?
>
> A lot of bibliographic databases provide bibtex-compatible citation
> information. How do you deal with that, when you shift to biblatex?

As I recently learned (thanks to this list!), biblatex supports .bib
files.  So switching to biblatex is not an issue from this perspective:
you can continue to drop bibtex-compatible citation information into
your .bib file and use it with biblatex.

If ox-bibtex reads .bib files, that should continue to work, too.

Best,
Richard

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-26 16:56 Clément B.
  2014-04-27 13:08 ` Leonard Randall
  2014-04-29  9:30 ` Vikas Rawal Lists
@ 2014-04-29  9:30 ` Vikas Rawal Lists
  2 siblings, 0 replies; 22+ messages in thread
From: Vikas Rawal Lists @ 2014-04-29  9:30 UTC (permalink / raw)
  To: "Clément B."; +Cc: julian, org-mode mailing list


> Hi all,
> 
>> - Should I use biblatex instead of bibtex?  
> 
> You should. It is very powerful and straightforward. The manual
> is great.
> 


ox-bibtex provides a usable implementation of including bibtex citations in html export. Can this be done if using biblatex?

Vikas

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-26 16:56 Clément B.
  2014-04-27 13:08 ` Leonard Randall
@ 2014-04-29  9:30 ` Vikas Rawal Lists
  2014-04-29 15:36   ` Richard Lawrence
  2014-04-29  9:30 ` Vikas Rawal Lists
  2 siblings, 1 reply; 22+ messages in thread
From: Vikas Rawal Lists @ 2014-04-29  9:30 UTC (permalink / raw)
  To: "Clément B."; +Cc: julian, org-mode mailing list


On 26-Apr-2014, at 6:56 pm, Clément B. <clement@inventati.org> wrote:

> Hi all,
> 
>> - Should I use biblatex instead of bibtex?  
> 
> You should. It is very powerful and straightforward. The manual
> is great.
> 

Is the choice so clearcut?

A lot of bibliographic databases  provide bibtex-compatible citation information. How do you deal with that, when you shift to biblatex?

Of course, this is not an org-mode specific limitation at all. But still relevant, I think, when we are discussing what should be the recommended way of dealing with citations in org-mode.

Vikas

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 19:20           ` John Kitchin
  2014-04-27 21:30             ` Clément B.
@ 2014-04-28 13:57             ` Julian M. Burgos
  1 sibling, 0 replies; 22+ messages in thread
From: Julian M. Burgos @ 2014-04-28 13:57 UTC (permalink / raw)
  To: John Kitchin
  Cc: Ken Mankoff, Leonard Randall, emacs-orgmode, Thomas S. Dye,
	Clément B.

Thanks Clément and everybody else for their comments/ideas.  I will go
through these carefully.

John Kitchin writes:

> It seems there are a lot of variants of citation handling out there! I will
> add to the list my own variants here:
> https://github.com/jkitchin/jmax/blob/master/jorg-bib.el. My citation needs
> are simple, I basically only use \cite{key1,key2} in LaTeX. And I only use
> bibtex, because I have not gotten around to anything else, bibtex works
> fine if your needs are simple (like mine).
>
> There is certainly duplication of some things, but the following are
> features in mine that I am not aware of anywhere else.
>
>
> 1. Integration with reftex. You type C-c ] and select keys from reftex and
> insert a cite link. If you type it again on a citation, the new entries are
> appended to the end. This current conversation inspired me to implement
> this!
>
> 2. Clickable cite links. If you have a citation link like
> cite:key1,key2,key3 you can click on key1 and open the bibliography file to
> key1, and you can click on key2 and have it open at key 2. This link would
> export in latex as \cite{key1,key2,key3}. Other cite formats, e.g. citep,
> citep*, etc... are defined too, but are relatively untested. You can also
> use completion to enter a bibtex key.
>
> 3. citation tooltips. If clicking is too disruptive, you can run a command
> and get a tooltip of the citation under point. If clicking is too tiring,
> you can turn on an idle timer that shows a tooltip if the cursor is on a
> citation.
>
> 4. clickable label links. clicking checks the buffer for another label by
> the same name.
>
> 5. Clickable ref links. Clicking on the ref:label takes you to the label,
> and provides C-c & to get back to that point. You can also use completion
> to get a list of labels in the buffer to make a ref to.
>
> 6. A bibliographystyle and bibliography link. The bibliography link opens
> the bibtex file that was clicked on.
>
> 7. Code to make a clickable list of figures and tables.
>
> 8. Code to extract the bibtex entries cited in an org-file to a text block
> at the end of the org-file
>
> 9. variables to point to a notes file and pdf directory, and functions to
> jump to your notes and the pdf file from a bibtex entry.
>
> 10. a function to build a complete pdf bibliography from your bibtex file.
> This is handy for checking the entries are spelled correctly, etc...
>
> 11. A little function and python script to upload a bibtex entry to
> citeulike.
>
> I have not tried to do much with anything but LaTeX, so these links are not
> likely to be that good for html or odt I suspect.
>
> Anyway, there are some very interesting ideas in this code, and I am using
> it on a pretty regular basis. Maybe some of you would also find them
> interesting/helpful. I look forward to see this continue developing!
>
> John
>
> -----------------------------------
> John Kitchin
> Associate Professor
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Sun, Apr 27, 2014 at 12:57 PM, Clément B. <clement@inventati.org> wrote:
>
>>
>> > It appears to work for multicite for me. Or at least well enough. If I
>> > select multiple entries, I get this:
>> >
>> > [[ref:Author1:YYYY,Author2:YYYY,Author3:YYYY][()]]
>> >
>> > I can then easily insert the text I want into the (). It exports
>> > properly to LaTeX as \cite{Author1:YYYY,Author2:YYYY,Author3:YYYY}.
>> >
>> > Maybe most people multi-cite more than me, but I think it is only a bit
>> > of extra work to add what I want in the () and then it exports properly
>> > to LaTeX and, using the references-via-LaTeX, to ODT/HTML too!
>> >
>> >   -k.
>>
>> The problem is that you can't link to a bibtex entry,
>> [[ref:Author1:YYYY,Author2:YYYY]] is not picked up by org search
>> function of `org-open-file`. And even if it was, it couldn't link
>> to several entries at once. So to preserve the ability to jump
>> quickly to a reference, I quite like the export filter approach,
>> which I was unaware of (thank you Thomas! ).
>>
>>
>> Clément
>>
>>


-- 
Julian Mariano Burgos, PhD
Hafrannsóknastofnun/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian@hafro.is

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 13:08 ` Leonard Randall
  2014-04-27 14:14   ` Clément B.
@ 2014-04-28 13:56   ` Julian M. Burgos
  1 sibling, 0 replies; 22+ messages in thread
From: Julian M. Burgos @ 2014-04-28 13:56 UTC (permalink / raw)
  To: Leonard Randall; +Cc: emacs-orgmode, Clément B.

Hi Leonard,

Yes, I will be definitively interested on this!  Thanks!

Julian

Leonard Randall writes:

> Hi Julian et al.,
> I am not sure if this helps, but I am in the process of writing a new
> package for inserting citations into org buffers using RefTeX. This
> solution would make citation insertion very convenient, but it would not be
> quite as easy to read as Clément's solution, and it would only work for
> latex export. (It might work with html export if you used bibtex to html,
> but I do not have enough experience with bibtex to html to know.) On the
> other hand, it will work with multicite commands, whereas Clement's does
> not look like it will.
>
> I was also thinking of adding out of the box biblatex support for
> org-bibtex (see my previous post).
>
> Let me know if you might be interested in either of these, as I will try to
> work on them this week.
>
> All best,
>
> Leonard


-- 
Julian Mariano Burgos, PhD
Hafrannsóknastofnun/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian@hafro.is

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-26 18:26 Clément B.
@ 2014-04-28  1:53 ` Richard Lawrence
  0 siblings, 0 replies; 22+ messages in thread
From: Richard Lawrence @ 2014-04-28  1:53 UTC (permalink / raw)
  To: emacs-orgmode

Hi Clément and all,

Clément B. <clement@autistici.org> writes:

> As for citations, I find that the most flexible way is to define
> my own link types, that allows control on both org formatting and
> export...

Replacing my inline \cite commands with custom link types is something
I've been meaning to do for a while.  Thanks for the implementation
ideas!  

I have a setup that for some people may complement the one Clément
describes.  Rather than dealing with .bib files and RefTeX, I represent
my bibliography in Org, and use org-bibtex to (re-)generate a .bib file
as needed.  Here's how it works, in brief; I described it more fully at:
http://article.gmane.org/gmane.emacs.orgmode/79016/

1) I store each reading as a TODO headline using a capture template.  I
use the post-capture hook to call org-bibtex-create-in-current-entry as
appropriate.  This allows me to keep notes, links, deadlines
etc. associated with each reading in Org, as well as the bibliographic
data.

2) I have a function that uses org-map-entries to walk over the
headlines for my readings and export them to a .bib file.  This
regenerates my .bib file on an as-needed basis; the real bibliographic
database is stored in Org.  (I call this function from a Makefile, but
it could just as easily be used from within the Org export process.)

The next step, which I haven't yet implemented but which would connect
this setup to one like Clément described, would be to add behavior to
the custom link types so that *following* the link would jump to the
associated TODO entry for the reading, rather than the entry in the .bib
file.  This should be straightforward, since org-bibtex uses the
CUSTOM_ID property to store the cite key.  And jumping to my own notes
about a reference (which might further link to the original text),
rather than to a .bib file, is usually what I want.

-- 
Best,
Richard

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 19:20           ` John Kitchin
@ 2014-04-27 21:30             ` Clément B.
  2014-04-28 13:57             ` Julian M. Burgos
  1 sibling, 0 replies; 22+ messages in thread
From: Clément B. @ 2014-04-27 21:30 UTC (permalink / raw)
  To: John Kitchin
  Cc: julian, emacs-orgmode, Leonard Randall, Ken Mankoff, Thomas S. Dye

Hi John,

This is great ! Way more advanced than anything I have said.

> 2. Clickable cite links. If you have a citation link like
> cite:key1,key2,key3 you can click on key1 and open the bibliography file to
> key1, and you can click on key2 and have it open at key 2. This link would
> export in latex as \cite{key1,key2,key3}. Other cite formats, e.g. citep,
> citep*, etc... are defined too, but are relatively untested. You can also
> use completion to enter a bibtex key.

This was my main concern, glad to see you can treat the different
parts of the links as separate citations, and access their
respective bibtex entry. The completion is very handy too.

> 9. variables to point to a notes file and pdf directory, and functions to
> jump to your notes and the pdf file from a bibtex entry.

I use something similar, but only for the pdf file. I think the
open-in-browser function is implemented in the latest bibtex-mode
(`bibtex-url` bound to C-c C-l).

Bye,

Clément

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 16:57         ` Clément B.
@ 2014-04-27 19:20           ` John Kitchin
  2014-04-27 21:30             ` Clément B.
  2014-04-28 13:57             ` Julian M. Burgos
  0 siblings, 2 replies; 22+ messages in thread
From: John Kitchin @ 2014-04-27 19:20 UTC (permalink / raw)
  To: Clément B.
  Cc: julian, emacs-orgmode, Leonard Randall, Ken Mankoff, Thomas S. Dye

[-- Attachment #1: Type: text/plain, Size: 3987 bytes --]

It seems there are a lot of variants of citation handling out there! I will
add to the list my own variants here:
https://github.com/jkitchin/jmax/blob/master/jorg-bib.el. My citation needs
are simple, I basically only use \cite{key1,key2} in LaTeX. And I only use
bibtex, because I have not gotten around to anything else, bibtex works
fine if your needs are simple (like mine).

There is certainly duplication of some things, but the following are
features in mine that I am not aware of anywhere else.


1. Integration with reftex. You type C-c ] and select keys from reftex and
insert a cite link. If you type it again on a citation, the new entries are
appended to the end. This current conversation inspired me to implement
this!

2. Clickable cite links. If you have a citation link like
cite:key1,key2,key3 you can click on key1 and open the bibliography file to
key1, and you can click on key2 and have it open at key 2. This link would
export in latex as \cite{key1,key2,key3}. Other cite formats, e.g. citep,
citep*, etc... are defined too, but are relatively untested. You can also
use completion to enter a bibtex key.

3. citation tooltips. If clicking is too disruptive, you can run a command
and get a tooltip of the citation under point. If clicking is too tiring,
you can turn on an idle timer that shows a tooltip if the cursor is on a
citation.

4. clickable label links. clicking checks the buffer for another label by
the same name.

5. Clickable ref links. Clicking on the ref:label takes you to the label,
and provides C-c & to get back to that point. You can also use completion
to get a list of labels in the buffer to make a ref to.

6. A bibliographystyle and bibliography link. The bibliography link opens
the bibtex file that was clicked on.

7. Code to make a clickable list of figures and tables.

8. Code to extract the bibtex entries cited in an org-file to a text block
at the end of the org-file

9. variables to point to a notes file and pdf directory, and functions to
jump to your notes and the pdf file from a bibtex entry.

10. a function to build a complete pdf bibliography from your bibtex file.
This is handy for checking the entries are spelled correctly, etc...

11. A little function and python script to upload a bibtex entry to
citeulike.

I have not tried to do much with anything but LaTeX, so these links are not
likely to be that good for html or odt I suspect.

Anyway, there are some very interesting ideas in this code, and I am using
it on a pretty regular basis. Maybe some of you would also find them
interesting/helpful. I look forward to see this continue developing!

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Sun, Apr 27, 2014 at 12:57 PM, Clément B. <clement@inventati.org> wrote:

>
> > It appears to work for multicite for me. Or at least well enough. If I
> > select multiple entries, I get this:
> >
> > [[ref:Author1:YYYY,Author2:YYYY,Author3:YYYY][()]]
> >
> > I can then easily insert the text I want into the (). It exports
> > properly to LaTeX as \cite{Author1:YYYY,Author2:YYYY,Author3:YYYY}.
> >
> > Maybe most people multi-cite more than me, but I think it is only a bit
> > of extra work to add what I want in the () and then it exports properly
> > to LaTeX and, using the references-via-LaTeX, to ODT/HTML too!
> >
> >   -k.
>
> The problem is that you can't link to a bibtex entry,
> [[ref:Author1:YYYY,Author2:YYYY]] is not picked up by org search
> function of `org-open-file`. And even if it was, it couldn't link
> to several entries at once. So to preserve the ability to jump
> quickly to a reference, I quite like the export filter approach,
> which I was unaware of (thank you Thomas! ).
>
>
> Clément
>
>

[-- Attachment #2: Type: text/html, Size: 4815 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 16:16       ` Ken Mankoff
@ 2014-04-27 16:57         ` Clément B.
  2014-04-27 19:20           ` John Kitchin
  0 siblings, 1 reply; 22+ messages in thread
From: Clément B. @ 2014-04-27 16:57 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: julian, Leonard Randall, emacs-orgmode, Thomas S. Dye


> It appears to work for multicite for me. Or at least well enough. If I
> select multiple entries, I get this:
>
> [[ref:Author1:YYYY,Author2:YYYY,Author3:YYYY][()]]
>
> I can then easily insert the text I want into the (). It exports
> properly to LaTeX as \cite{Author1:YYYY,Author2:YYYY,Author3:YYYY}.
>
> Maybe most people multi-cite more than me, but I think it is only a bit
> of extra work to add what I want in the () and then it exports properly
> to LaTeX and, using the references-via-LaTeX, to ODT/HTML too!
>
>   -k.

The problem is that you can't link to a bibtex entry,
[[ref:Author1:YYYY,Author2:YYYY]] is not picked up by org search
function of `org-open-file`. And even if it was, it couldn't link
to several entries at once. So to preserve the ability to jump
quickly to a reference, I quite like the export filter approach,
which I was unaware of (thank you Thomas! ).


Clément

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 16:01     ` Thomas S. Dye
@ 2014-04-27 16:16       ` Ken Mankoff
  2014-04-27 16:57         ` Clément B.
  0 siblings, 1 reply; 22+ messages in thread
From: Ken Mankoff @ 2014-04-27 16:16 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: julian, Leonard Randall, emacs-orgmode, Clément B.


On 2014-04-27 at 12:01, Thomas S. Dye wrote:
> Clément B. <clement@inventati.org> writes:
>
>> This makes inserting custom links ("ref") easier with the usual
>> `reftex-citation` bound to C-c [.
>>
>>> On the other hand, it will work with multicite commands,
>>> whereas Clement's does not look like it will.
>>
>> It does not, and that's a big limitation. 

It appears to work for multicite for me. Or at least well enough. If I
select multiple entries, I get this:

[[ref:Author1:YYYY,Author2:YYYY,Author3:YYYY][()]]

I can then easily insert the text I want into the (). It exports
properly to LaTeX as \cite{Author1:YYYY,Author2:YYYY,Author3:YYYY}.

Maybe most people multi-cite more than me, but I think it is only a bit
of extra work to add what I want in the () and then it exports properly
to LaTeX and, using the references-via-LaTeX, to ODT/HTML too!

  -k.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 16:05   ` Clément B.
@ 2014-04-27 16:10     ` Ken Mankoff
  0 siblings, 0 replies; 22+ messages in thread
From: Ken Mankoff @ 2014-04-27 16:10 UTC (permalink / raw)
  To: Clément B.; +Cc: emacs-orgmode


On 2014-04-27 at 12:05, Clément B. wrote:
>> Still looking into "lastname (Year)" format...
>
> I hadn't noticed that before, but now that you mention it, I
> think this is related to the way you format your bib file.
>
> For example "%A (%y)" with:
>
> 1. name = {Darwin, Charles}
>    year = {1859}
>
>    will yield "Darwin (1859)"
>
>
> 2. name = {Charles Darwin}
>    year = {1859}
>
>    will yield "Charles Darwin (1859)
>
> Not very consistent. This might be something to take to the AUCTeX
>guys.

I've asked about this here:
https://tex.stackexchange.com/questions/173804/best-practices-for-bibtex-author-field 

Maybe bibtool or some other tool can reformat my BibTeX 
file to "Last, First".

  -k.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 15:26 ` Ken Mankoff
@ 2014-04-27 16:05   ` Clément B.
  2014-04-27 16:10     ` Ken Mankoff
  0 siblings, 1 reply; 22+ messages in thread
From: Clément B. @ 2014-04-27 16:05 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: emacs-orgmode


> I find the best way to support ODT is simply add something like this:
>
>       ((eq format 'odt)
>        (format "(%s)" desc))
>
> This doesn't create a bibliography section, but that section is awkward
> to export to anyway. It requires the 3rd party Org hack that isn't
> officially supported, java, jabref, is awfully slow (~2
> seconds/reference), etc. I now put the references inline as above, and
> then manually add the references by exporting to PDF and copying/paste
> that reference section. 
>
> Not great, but less of a hack than ODT-supported references, and working
> with ODT/Word is a hack anyway.

I came to a similar conclusion for html export, it is very hard
to match bibtex/biblatex to produce a proper bibliography, so one
might as well use it. At one point, the thought of writing a
custom citation style that would output html code crossed my mind
(I think biblatex would allow that), but I just don't use html
export enough. Although if this is possible, it could work with
xml for odt as well.

> Still looking into "lastname (Year)" format...

I hadn't noticed that before, but now that you mention it, I
think this is related to the way you format your bib file.

For example "%A (%y)" with:

1. name = {Darwin, Charles}
   year = {1859}

   will yield "Darwin (1859)"


2. name = {Charles Darwin}
   year = {1859}

   will yield "Charles Darwin (1859)

Not very consistent. This might be something to take to the
AUCTeX guys.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 14:14   ` Clément B.
  2014-04-27 14:41     ` Ken Mankoff
@ 2014-04-27 16:01     ` Thomas S. Dye
  2014-04-27 16:16       ` Ken Mankoff
  1 sibling, 1 reply; 22+ messages in thread
From: Thomas S. Dye @ 2014-04-27 16:01 UTC (permalink / raw)
  To: Clément B.; +Cc: julian, Leonard Randall, emacs-orgmode

Clément B. <clement@inventati.org> writes:

> Hi Leonard,
>
>> I am in the process of writing a new package for inserting
>> citations into org buffers using RefTeX.
>
> I'd be interested to know what you have in mind. I use something
> of the sort, by customising `reftex-cite-format`, e.g:
>
> (setq reftex-cite-format
>            '((?\C-m . "\\cite[]{%l}")
>              (?b . "[[ref:%l][%A (%y)]]")))
>
> This makes inserting custom links ("ref") easier with the usual
> `reftex-citation` bound to C-c [.
>
>
>> On the other hand, it will work with multicite commands,
>> whereas Clement's does not look like it will.
>
> It does not, and that's a big limitation. That being said, I don't
> know how to go about mixing multiple citations and links to the
> bib file. This is definitely something I care about, being able
> to quickly jump from the text to the bibliographic entry, PDF
> file, or whatever source I am using to write is one of the main
> reasons I use org instead of plain LaTeX.

One approach for muliticites is to drop a placeholder and then replace
it with an export filter.  I've been using these two for a while and
they seem to work fine.

** Filters for multicites
*** Filter for parencites
Add the placeholder with alt-p

#+name: tsd-parencites
#+BEGIN_SRC emacs-lisp
(defun tsd-latex-filter-parencites (text backend info)
  "Replace parencites placeholders in Beamer/LaTeX export."
  (when (memq backend '(beamer latex))
    (replace-regexp-in-string "π" "\\parencites" text nil t)))
(add-to-list 'org-export-filter-plain-text-functions
             'tsd-latex-filter-parencites)
#+END_SRC

*** Filter for textcites
Add the placeholder with alt-t

#+name: tsd-textcites
#+BEGIN_SRC emacs-lisp
(defun tsd-latex-filter-textcites (text backend info)
  "Replace textcites placeholders in Beamer/LaTeX export."
  (when (memq backend '(beamer latex))
    (replace-regexp-in-string "†" "\\textcites" text nil t)))
(add-to-list 'org-export-filter-plain-text-functions
             'tsd-latex-filter-textcites)
#+END_SRC


It looks like this in the text:

  A recent replication experiment that used stone tools in
  the manufacture of an outrigger canoe identified six functional types
  of stone adze that correspond generally with the six types established
  by Duff
  π[[multicite:turner00:_funct_desig_distr_new_zealan_adzes][;;turner
  diss]] [[multicite:turner05:_funct_and_techn_explan_for][;;turner
  nzja]].

My link syntax is a bit different, but the same basic idea:

(org-add-link-type
 "multicite" 'ebib-open-org-link
 (lambda (path desc format)
   (cond
    ((eq format 'latex)
     (if (not desc) (format "{%s}" path)
         (format "[%s][%s]{%s}"
                 (cadr (split-string desc ";"))
                 (car (split-string desc ";"))  path))))))

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 14:53 Clément B.
@ 2014-04-27 15:26 ` Ken Mankoff
  2014-04-27 16:05   ` Clément B.
  0 siblings, 1 reply; 22+ messages in thread
From: Ken Mankoff @ 2014-04-27 15:26 UTC (permalink / raw)
  To: Clément B.; +Cc: emacs-orgmode


On 2014-04-27 at 10:53, Clément B. wrote:
> Hi Ken,
>
>> When I export this to LaTeX, it is not treated as a proper LaTeX
>> citation. The text is just the "%A (%y)" part. Is there some way to
>> export so that the ref:%l turns into a \cite{%l}?
>
> The "ref" is a custom link type, you can define those in org with
> `org-add-link-type`, and they allow control over the export
> behaviour. See the previous posts in this thread for an example.

Ah! Got it. This is really nice. Thank you. 

I find the best way to support ODT is simply add something like this:

      ((eq format 'odt)
       (format "(%s)" desc))

This doesn't create a bibliography section, but that section is awkward
to export to anyway. It requires the 3rd party Org hack that isn't
officially supported, java, jabref, is awfully slow (~2
seconds/reference), etc. I now put the references inline as above, and
then manually add the references by exporting to PDF and copying/paste
that reference section. 

Not great, but less of a hack than ODT-supported references, and working
with ODT/Word is a hack anyway.

Still looking into "lastname (Year)" format...

  -k.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
@ 2014-04-27 14:53 Clément B.
  2014-04-27 15:26 ` Ken Mankoff
  0 siblings, 1 reply; 22+ messages in thread
From: Clément B. @ 2014-04-27 14:53 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: emacs-orgmode

Hi Ken,

> When I export this to LaTeX, it is not treated as a proper
> LaTeX citation. The text is just the "%A (%y)" part. Is there
> some way to export so that the ref:%l turns into a \cite{%l}?

The "ref" is a custom link type, you can define those in org with
`org-add-link-type`, and they allow control over the export
behaviour. See the previous posts in this thread for an example.

Bye,

Clément

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 14:14   ` Clément B.
@ 2014-04-27 14:41     ` Ken Mankoff
  2014-04-27 16:01     ` Thomas S. Dye
  1 sibling, 0 replies; 22+ messages in thread
From: Ken Mankoff @ 2014-04-27 14:41 UTC (permalink / raw)
  To: Clément B.; +Cc: julian, Leonard Randall, emacs-orgmode

Hi Clément and Others,

On 2014-04-27 at 10:14, Clément B. wrote:
> (setq reftex-cite-format
>            '((?\C-m . "\\cite[]{%l}")
>              (?b . "[[ref:%l][%A (%y)]]")))

I've been using reftex in Org -> LaTeX for a while and have my Org text
sprinkled with \cite{foo:yyyy}. I just saw the customized
reftex-cite-format from Clément (above). It looks much nicer in the
text, but raises two questions:

1) Can the link just use lastname? It looks like %A is the only way to
access author names, and does full names, so perhaps not without writing
some custom function? And more importantly, 

2) When I export this to LaTeX, it is not treated as a proper LaTeX
citation. The text is just the "%A (%y)" part. Is there some way to
export so that the ref:%l turns into a \cite{%l}? 

Thanks,

  -k.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-27 13:08 ` Leonard Randall
@ 2014-04-27 14:14   ` Clément B.
  2014-04-27 14:41     ` Ken Mankoff
  2014-04-27 16:01     ` Thomas S. Dye
  2014-04-28 13:56   ` Julian M. Burgos
  1 sibling, 2 replies; 22+ messages in thread
From: Clément B. @ 2014-04-27 14:14 UTC (permalink / raw)
  To: Leonard Randall; +Cc: julian, emacs-orgmode

Hi Leonard,

> I am in the process of writing a new package for inserting
> citations into org buffers using RefTeX.

I'd be interested to know what you have in mind. I use something
of the sort, by customising `reftex-cite-format`, e.g:

(setq reftex-cite-format
           '((?\C-m . "\\cite[]{%l}")
             (?b . "[[ref:%l][%A (%y)]]")))

This makes inserting custom links ("ref") easier with the usual
`reftex-citation` bound to C-c [.


> On the other hand, it will work with multicite commands,
> whereas Clement's does not look like it will.

It does not, and that's a big limitation. That being said, I don't
know how to go about mixing multiple citations and links to the
bib file. This is definitely something I care about, being able
to quickly jump from the text to the bibliographic entry, PDF
file, or whatever source I am using to write is one of the main
reasons I use org instead of plain LaTeX.


Bye,

Clément

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
  2014-04-26 16:56 Clément B.
@ 2014-04-27 13:08 ` Leonard Randall
  2014-04-27 14:14   ` Clément B.
  2014-04-28 13:56   ` Julian M. Burgos
  2014-04-29  9:30 ` Vikas Rawal Lists
  2014-04-29  9:30 ` Vikas Rawal Lists
  2 siblings, 2 replies; 22+ messages in thread
From: Leonard Randall @ 2014-04-27 13:08 UTC (permalink / raw)
  To: Clément B.; +Cc: julian, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

Hi Julian et al.,
I am not sure if this helps, but I am in the process of writing a new
package for inserting citations into org buffers using RefTeX. This
solution would make citation insertion very convenient, but it would not be
quite as easy to read as Clément's solution, and it would only work for
latex export. (It might work with html export if you used bibtex to html,
but I do not have enough experience with bibtex to html to know.) On the
other hand, it will work with multicite commands, whereas Clement's does
not look like it will.

I was also thinking of adding out of the box biblatex support for
org-bibtex (see my previous post).

Let me know if you might be interested in either of these, as I will try to
work on them this week.

All best,

Leonard

[-- Attachment #2: Type: text/html, Size: 932 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
@ 2014-04-26 18:26 Clément B.
  2014-04-28  1:53 ` Richard Lawrence
  0 siblings, 1 reply; 22+ messages in thread
From: Clément B. @ 2014-04-26 18:26 UTC (permalink / raw)
  To: emacs-orgmode


Hi all,

> - Should I use biblatex instead of bibtex?  

You should. It is very powerful and straightforward. The manual
is great.


As for citations, I find that the most flexible way is to define
my own link types, that allows control on both org formatting and
export

Let's say for example that you want to cite an entry of your .bib
file, which key is Chiles:2012:Geostatistics. Something like :

see Chilès 2012, p.145

Note (i) the "see" (ii) the "p.145", they are both part of the
citation. In this case, biblatex provides the following command

\cite[see][p.145]{Chiles:2012:Geostatistics}


For readability purposes, the citation should appear as is in the
org file, the "\cite{Chiles:2012:Geostatistics}" command should
only appear when exporting to LaTeX. Furthermore, this should be
a link to the entry in the .bib file, so the complete org link
would look like

[[ref:Chiles:2012:Geostatistics][(see for example Chilès 2012, p.145)]]

Where ref is a custom link type to the said bib file.

To do that, I have defined the following link-type in my init.el:

(org-add-link-type                       
 "ref"
 (lambda (key)
   (org-open-file cby-references-file t nil key))
 (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "(<cite>%s</cite>)" path))
    ((eq format 'latex)
     (let* ((postnote (cby-org-link-get-postnote desc))
            (prenote (cby-org-link-get-prenote desc)))
       (cond
        ((and prenote postnote)
         (format "\\cite[%s][%s]{%s}" prenote postnote path))              
        (postnote
         (format "\\cite[%s]{%s}" postnote path))
        (prenote
         (format "\\cite[%s][]{%s}" prenote path))
        (t
         (format "\\cite{%s}" path))))))))

Some remarks :

1. `cby-references-file` is my master .bib file.

2. The html export is rather rudimentary, it simply takes the org
   link description (%s) and puts it between <cite> markups.

3. To get the prenote (the "see") and postnote (the "p.145"), I
   use very shaky functions (`cby-org-link-get-postnote`) that
   strip the link description. I haven't come up with a proper
   solution yet so here is one for reference :

   (defun cby-org-link-get-postnote (desc)
     "Extract postnote from org-mode link description. Postnote
      starts at last ',' and ends at last ')'."
     (let ((postnote (cadr (split-string desc "[,)]"))))
       (if postnote
           (copy-sequence
            ;; clean string
            (replace-regexp-in-string "[ \t\n]" "" postnote)))))


4. To use the wide range of commands provided by biblatex, I also
   have a "pref" link type that exports to "\parencite{}" and a
   "tref" type that exports to "\texcite{}"

This is all work in progress, but custom link types make both
your org source file readable and export flexible.


> I use org-mode to write scientific papers, exporting mostly to LaTex/pdf
> (and sometimes to Word via ODT when I have to collaborate with less
> enlightened colleagues)

I also tried to do that, but do you have a way to get odt files
back to org ? I saw a package for that somewhere.


Bye,


Clément

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: State of the art in citations
@ 2014-04-26 16:56 Clément B.
  2014-04-27 13:08 ` Leonard Randall
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Clément B. @ 2014-04-26 16:56 UTC (permalink / raw)
  To: julian; +Cc: emacs-orgmode

Hi all,

> - Should I use biblatex instead of bibtex?  

You should. It is very powerful and straightforward. The manual
is great.


As for citations, I find that the most flexible way is to define
my own link types, that allows control on both org formatting and
export

Let's say for example that you want to cite an entry of your .bib
file, which key is Chiles:2012:Geostatistics. Something like :

see Chilès 2012, p.145

Note (i) the "see" (ii) the "p.145", they are both part of the
citation. In this case, biblatex provides the following command

\cite[see][p.145]{Chiles:2012:Geostatistics}


For readability purposes, the citation should appear as is in the
org file, the "\cite{Chiles:2012:Geostatistics}" command should
only appear when exporting to LaTeX. Furthermore, this should be
a link to the entry in the .bib file, so the complete org link
would look like

[[ref:Chiles:2012:Geostatistics][(see for example Chilès 2012, p.145)]]

Where ref is a custom link type to the said bib file.

To do that, I have defined the following link-type in my init.el :

(org-add-link-type                       
 "ref"
 (lambda (key)
   (org-open-file cby-references-file t nil key))
 (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "(<cite>%s</cite>)" path))
    ((eq format 'latex)
     (let* ((postnote (cby-org-link-get-postnote desc))
            (prenote (cby-org-link-get-prenote desc)))
       (cond
        ((and prenote postnote)
         (format "\\cite[%s][%s]{%s}" prenote postnote path))              
        (postnote
         (format "\\cite[%s]{%s}" postnote path))
        (prenote
         (format "\\cite[%s][]{%s}" prenote path))
        (t
         (format "\\cite{%s}" path))))))))

Some remarks :

1. `cby-references-file` is my master .bib file.

2. The html export is rather rudimentary, it simply takes the org
   link description (%s) and puts it between <cite> markups.

3. To get the prenote (the "see") and postnote (the "p.145"), I
   use very shaky functions (`cby-org-link-get-postnote`) that
   strip the link description. I haven't come up with a proper
   solution yet so here is one for reference :

   (defun cby-org-link-get-postnote (desc)
     "Extract postnote from org-mode link description. Postnote
      starts at last ',' and ends at last ')'."
     (let ((postnote (cadr (split-string desc "[,)]"))))
       (if postnote
           (copy-sequence
            ;; clean string
            (replace-regexp-in-string "[ \t\n]" "" postnote)))))


4. To use the wide range of commands provided by biblatex, I also
   have a "pref" link type that exports to "\parencite{}" and a
   "tref" type that exports to "\texcite{}"

This is all work in progress, but custom link types make both
your org source file readable and export flexible.


> I use org-mode to write scientific papers, exporting mostly to LaTex/pdf
> (and sometimes to Word via ODT when I have to collaborate with less
> enlightened colleagues)

I also tried to do that, but do you have a way to get odt files
back to org ? I saw a package for that somewhere.


Bye,


Clément

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-04-29 15:38 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-25 12:11 State of the art in citations Julian M. Burgos
2014-04-25 15:42 ` Grant Rettke
2014-04-26 16:56 Clément B.
2014-04-27 13:08 ` Leonard Randall
2014-04-27 14:14   ` Clément B.
2014-04-27 14:41     ` Ken Mankoff
2014-04-27 16:01     ` Thomas S. Dye
2014-04-27 16:16       ` Ken Mankoff
2014-04-27 16:57         ` Clément B.
2014-04-27 19:20           ` John Kitchin
2014-04-27 21:30             ` Clément B.
2014-04-28 13:57             ` Julian M. Burgos
2014-04-28 13:56   ` Julian M. Burgos
2014-04-29  9:30 ` Vikas Rawal Lists
2014-04-29 15:36   ` Richard Lawrence
2014-04-29  9:30 ` Vikas Rawal Lists
2014-04-26 18:26 Clément B.
2014-04-28  1:53 ` Richard Lawrence
2014-04-27 14:53 Clément B.
2014-04-27 15:26 ` Ken Mankoff
2014-04-27 16:05   ` Clément B.
2014-04-27 16:10     ` Ken Mankoff

Code repositories for project(s) associated with this 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).