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 support? #134

Closed
stevepowell99 opened this issue Apr 21, 2014 · 18 comments
Closed

citation support? #134

stevepowell99 opened this issue Apr 21, 2014 · 18 comments

Comments

@stevepowell99
Copy link

will you be adding support for citations e.g. like http://johnmacfarlane.net/pandoc/demo/example19/Citations.html? It is hard to imagine writing a scientific book without citation support. Exciting package by the way, thanks.

@btwael
Copy link

btwael commented Apr 21, 2014

Maybe you should use this Markdown syntax

> Your citation

and the result will be like this:

If I were not a physicist, I would probably be a musician. I often think in music. I live my daydreams in music. I see my life in terms of music. ... I cannot tell if I would have done any creative work of importance in music, but I do know that I get most joy in life out of my violin.

The citation in the example is an Einstein's quote
There an usage of this syntax in this page http://samypesse.github.io/How-to-Make-a-Computer-Operating-System/Chapter-1/README.html that use GitBook

I Hope that this comment help you..

@stevepowell99
Copy link
Author

Oh sorry if I wasn't clear. By citation, I didn't mean inset quotes. I meant bibliography citation, like "Powell (2000)" in the text, usually with a list of references in the end.

@jbryer
Copy link

jbryer commented Apr 22, 2014

This article might be a nice place to begin thinking about this: http://blog.martinfenner.org/2013/06/19/citations-in-scholarly-markdown/
This would be a great feature to have. Something as easy as Bibtex.

@pkra
Copy link

pkra commented Apr 22, 2014

This discussion could be of interest benweet/stackedit#20

@btwael
Copy link

btwael commented Apr 22, 2014

Maybe this issue should be sent to Markdown developers or Marked developers, Marked is used by Gitbook to render Markdown, to integrate this feature to Markdown and to Gitbook after...

@stevepowell99
Copy link
Author

Ah right, so gitbook uses marked and marked does not support citations - and they might not want to if their aim is speed and efficiency. Though see markedjs/marked#35. But marked does support footnotes, which are simpler, but even footnotes aren't working for me in gitbook. So this does not work at the moment:

Here is some text containing a footnote.1

Footnotes

  1. Here is the text of the footnote itself.

@maxheld83
Copy link

Just want to chime in that this (along with some other scholarly typesetting niceties academic are used to from LaTeX) is really important to make this a viable product to scientists.
I think I might have been waiting for something like gitbook to come along for years, just didn't know it yet.

Still, this might need some more features to work.

@stevepowell99
Copy link
Author

I agree with maxheld83. But for now, it would be great to get even footnotes / endnotes working as they are a markdown standard and should be pretty easy, and they could be hacked to make a kind of substitute for proper citations.

@jbryer
Copy link

jbryer commented Apr 23, 2014

If you are using R and/or R Markdown, I have written a package (Rgitbook original name I know) that uses the knitcitations package to handle references. I will load a .bib file anywhere in your project and pass a bib object that you can use to cite. Therefore there is one references page that you can link anywhere in your project.

For now you just use inline knit code and call the citep or citet functions. However, I would like to use the pandoc format of [@citeLabel] instead but since my regular expression skills are limited, it will take me longer to get it working.

Admittedly this isn't the most elegant solution, but seems to work for me.

@maxheld83
Copy link

that's a great starter @jbryer thanks for the pointer.

@stevepowell99
Copy link
Author

@jbryer Yes I already installed Rgitbook (in fact I found out about gitbook via your post on R-bloggers) and am finding it useful. And yes, the citation support is very useful for R users.
But the great thing about gitbook for me is the easy editor, it makes writing fun for less technical projects, and Rgitbook is a separate approach.
Still thinking that citations support, or even working footnotes, would be great for gitbook.

@yonkeltron
Copy link

+1 for citations. As another scientist, I'd love to use this in an upcoming write up heavy on data structures and visualization but right now it looks like I can't without citation/bibliography support.

@stevepowell99
Copy link
Author

For now I am just using the following hack so I can write my book with gitbook but use citations and r code too: Create a gitbook repository and edit as usual, but use r code blocks and inline quotes like r citet(bib[["kellogg_logic_2004"]]) . Then run a script which:

  1. removes the target folder book_out
  2. copies the repository as a new folder book_out, renaming the .md files as .Rmd
  3. runs buildGitbook(). Only takes a couple of seconds.

This is the two-line R script, script.R
system("rm /path/to/book_out -R; cp -f /path/to/book /path/to/book_out -R; find /path/to/book_out -type f -exec rename 's/md/Rmd/' '{}' ;")
buildGitbook(source.dir = "/path/to/book",out.dir = "/path/to/book_out")

then I just run R CMD BATCH script.R in a terminal.

Really hacky but it works.

@maxheld83
Copy link

+1, epic one.
Any news from @GitbookIO on this?

@chrisvoncsefalvay
Copy link

+1 on footnotes!

@colabug
Copy link

colabug commented Jul 5, 2014

+1 on footnotes

@charlieroberts
Copy link

+1

I'm using for footnotes at the moment (example:1), but this is obviously less than ideal...

@AaronO
Copy link

AaronO commented Aug 11, 2014

@maxheld83 @charlieroberts @stevepowell99 @colabug @octowombat This is coming with GitbookIO/kramed#2.

P.S: (We ended up forking marked for our kramed).

Nyar233 pushed a commit to Nyar233/gitbook that referenced this issue May 12, 2024
* Add classname

* Start applying it

* reset existing style changes in favor of global setup

* setup v1 plain mode

* fix name clash

* move light/dark bases as vars

* side image render fix

* customize individual light tiers for light mode

* Add comment about primary and base

* remove style prop from image

* w-unset not needed on image

---------

Co-authored-by: sebastiangraz <graz@live.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants