Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citation features #7

Open
4 tasks
yoavram opened this issue Dec 20, 2012 · 14 comments
Open
4 tasks

Citation features #7

yoavram opened this issue Dec 20, 2012 · 14 comments
Labels

Comments

@yoavram
Copy link
Owner

yoavram commented Dec 20, 2012

Currently the citation feature is the conversion of BibTeX citation keys - [@Drake1998] - in the text to a bibliography below the preview pane. This feature is activated by a Citations button.

Additional citations features:

  • Conversion of the keys in the editor panel to citations in the preview panel. For example, converting [@Drake1998] to (Drake et al., 1998).
  • Tooltip on the converted citations in the preview panel showing the full citation.
  • Citation Style Language support, possibly via citeproc-js.
  • Warning message when a citation key was not found - above the preview panel? by highlighting the unconverted key in the preview pane? highlighting the key in the editor?
@houshuang
Copy link

Awesome project, I'll be watching this with great interest. I built a propotype of an open scholarly workflow, based on BibTeX, Skim, Chrome and DokuWiki. The citekey is the key to the whole system, PDFs are renamed accordingly, wiki pages generated, and I can use them to cite papers like [@this] both in the wiki, in my WP blog (using a plugin), etc. (I also do the full citation on hover, etc stuff).

I tried connecting my bibliography through config.py, and inserting a citation, but nothing seemed to happen. I guess it's supposed to appear below the preview pane? The ideal would definitively be to have it rendered immediately in the preview pane, as a full citation, with tooltips (not essential but nice), and possible rendering of source list either automatically at the bottom, or below #Sources.

@yoavram
Copy link
Owner Author

yoavram commented Feb 1, 2013

Thanks, I'm glad to hear you like it!
The citations are displayed below the preview pane but only after you click the citations button in the toolbar.

With time (or if you'd like you could fork and pull-request) we will add a post-conversion hook to the PageDown editor/converter (like the ones that already exist in markx.js) that will do this automatically.
Also, I hope to bypass bibtex.js and do it with some other tool that will allow more flexibility in terms of what to do with the citation, so that I can parse them, add links, tooltips... Maybe query zotero or mendeley...
We'll be glad to here more ideas and comments!

@yoavram
Copy link
Owner Author

yoavram commented Feb 17, 2013

With the latest commit we changed our bibtex js library to javascript bibtex parser which allows to parse bibtex file using javascript in the client side. This will allow the implementation of features discussed above.

@lsaravia
Copy link

I have been testing citations and they don't appear neither after loading bibliography nor after updating bibliography

@yoavram
Copy link
Owner Author

yoavram commented Feb 23, 2013

  1. After loading a bibliography, Markx should open an on page alert box that says:

    BibTeX file loaded with X entires
    X being the number of citations loaded.
    Is X>0 in your case? If it is, can I see the bibliography file you are using?

  2. Do you have citation keys in the document ([@AuthorYear] format)? I'm guessing you do and you're using the HELP.md, but just to make sure
    I tested on Chrome and FF18 and it works, that's why I'm asking these questsion.

@yoavram
Copy link
Owner Author

yoavram commented Feb 23, 2013

I've added new items in the citations menu to allow you to check which references are loaded into markx at any given time. See new commit 04737ad

@lsaravia
Copy link

  1. I don't see the on page alert
  2. Yes the pandoc format. They are not rendered in the preview, and no bibliography showed.
  3. The two new citations menu items work perfectly.

@yoavram
Copy link
Owner Author

yoavram commented Feb 23, 2013

I don't understand, the new citation menu items work, that is you get a list of citations and a list of references in the uploaded library, but you don't get the alert and you don't get preview of citations?
Are there any errors in the JS console?
I tested again on FF 18 and I see the alert and citations are parsed nicely....

@lsaravia
Copy link

Yes that is exactly what happen and is the same in chromium

The error in the console is:

Fecha y hora: 23/02/13 22:25:44
Error: ReferenceError: url is not defined
Archivo de origen: http://markx.herokuapp.com/static/js/BibTex.js
Línea: 1859

@yoavram
Copy link
Owner Author

yoavram commented Feb 24, 2013

OK I see now, you gave it a citation that doesn't have a URL and this exposed a bug. 👍 Good work!
I committed a fix in 018462b.
If there are further errors please also upload the bib file you are using to somewhere I can have a look - I know there are some problems with bib files that have non-ascii codes.

@lsaravia
Copy link

branch codemirror a93c32a

Ok There is no error in the javaconsole but citations are not rendered like before.

here is the bib file:

https://gist.github.com/lsaravia/5024182

And now I can't generate the pandoc pdf

Uncaught ReferenceError: codeMirrorEditor is not defined markx.js:232
getEditor markx.js:232
_save markx.js:441
(anonymous function) underscore-min.js:5
(anonymous function) localhost:592
v.event.dispatch jquery.min.js:2
o.handle.u jquery.min.js:2

@yoavram
Copy link
Owner Author

yoavram commented Feb 24, 2013

TL;DR - I think both issues are fixed, check the latest commit.

More details:

  • As far as the javascript error - my bad, I fixed it now in d1ee339.
  • As for the no citations - when I load it Markx opens a blue alert box that says:

Note: BibTeX file loaded with 87 entires

  • When I chose the view the reference library I get the list of the citations (bad formatting, I know, this is the default and I'll make it nicer some day). Of course no citations yet - haven't used them.
  • Adding [@Rosenzweig1995] to the text and clicking update citations - nothing happens.
  • Running _.find(bibtex.data, function(x) {return x.cite == citationKey}).title in the console I get what I should - "Species Diversity in Space and Time". So the bug is where I add new citations to the citationList.
  • Looked in updateCitations - I think I found the problem, I'm loading the editor textarea instead of going via codemirror. Fixing.
  • Refreshing Markx, writing the citation key [@Rosenzweig1995] in the editor, loading the reference file you gave me - it works.

Commited to 33fb8a0. Also fixed the word count in a later commit,

@yoavram
Copy link
Owner Author

yoavram commented Feb 26, 2013

The discussion has evolved from feature ideas and requests to bug reports. Hopefully the bug reports are done and we can go back to feature ideas:

  • Conversion of the keys in the editor panel to citations in the preview panel. For example, converting [@Drake1998] to (Drake et al., 1998). Maybe with a hyperlink the the citation URL.
  • Tooltip on the converted citations in the preview panel showing the full citation.
  • Citation Style Language support, possibly via citeproc-js.
  • Warning message when a citation key was not found - above the preview panel? by highlighting the unconverted key in the preview pane? highlighting the key in the editor?
  • A button in the edit bar to add the reference skeleton [@ ] (from A button to add references #19)

/cc @houshuang

@yoavram
Copy link
Owner Author

yoavram commented Feb 26, 2013

An example of how to format citations with citeproc-js is available here/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants