PeerJ / paper-now

Create, edit and display a journal article, entirely in GitHub

Home Page:https://peerj.github.io/paper-now/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internally reference citations

ausmeyer opened this issue · comments

It would be really nice to internally reference citations that get automagically formatted. For example, the latex internal references.

For that matter, having internal references to sections and subsections would be nice as well.

Could you give an example of what this would look like?

Yes, it basically just means putting a label in the markdown code that inserts a different bit of text in the compiled document. So for references in latex you basically enter the citation information in a separate document (not unlike the references.md file). The format of that references file looks like so (I just copied this from a manuscript of mine):

@Article{label1,
title = {Natural Selection on the Influenza Virus Genome},
author = {Y. Suzuki},
journal = {Mol. Biol. Evol.},
volume = {23},
pages = {1902--1911},
year = 2006
}

@Article{label2,
author = {S. E. Hensley and S. R. Das and A. L. Bailey and L. M. Schmidt and H. D. Hickman and A. Jayaraman and K. Viswanathan and R. Raman and R. Sasisekharan and J. R. Bennink and J. W. Yewdell},
title = {Hemagglutinin receptor binding avidity drives influenza {A} virus antigenic drift},
journal = {Science},
volume = 326,
pages = {734--736},
year = 2009
}

Then, when you want to cite an first article, you simply put a tag in the text to indicate that is the citation you want. In latex, the tag is \cite{label1} or \cite{label2}. In a sentence in the manuscript, it would look like:

There is a long tradition of research aimed at identifying important regions of the hemagglutinin protein, and by proxy, the sites that determine sequence-cluster transitions \cite{label1}.

Or you could cite two papers like:

There is a long tradition of research aimed at identifying important regions of the hemagglutinin protein, and by proxy, the sites that determine sequence-cluster transitions \cite{label1, label2}.

Then, when the paper is typeset, the typesetting program makes it look like so:

There is a long tradition of research aimed at identifying important regions of the hemagglutinin protein, and by proxy, the sites that determine sequence-cluster transitions (Suzuki, 2006).

Or like this for two:

There is a long tradition of research aimed at identifying important regions of the hemagglutinin protein, and by proxy, the sites that determine sequence-cluster transitions (Suzuki, 2006; Hensley 2009).

In addition, the typesetting program adds the cited paper or papers to the references section as:

  1. Suzuki Y (2006) Natural selection on the influenza virus genome. Mol Biol Evol 23: 1902–1911.

Or for two:

  1. Suzuki Y (2006) Natural selection on the influenza virus genome. Mol Biol Evol 23: 1902–1911.
  2. Hensley SE, Das SR, Bailey AL, Schmidt LM, Hickman HD, et al. (2009) Hemagglutinin receptor binding avidity drives influenza A virus antigenic drift. Science 326: 734–736.

The numbering and appearance in the references section, happens in order of appearance in the manuscript.

I know it sounds complicated, but I think it is relatively simple to implement. It is conceptually the same thing for internal reference to sections and figures. You could just have some sort of label tag in the markdown that means you don't have to keep track of figure numbers when you're referencing them. Here is a huge document on them.

http://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing

This has already been implemented in Markdown (and in a very clever way) with pandoc-citeproc. It would be fantastic if it could be integrated here somehow.