inukshuk / jekyll-scholar

jekyll extensions for the blogging scholar
MIT License
1.12k stars 102 forks source link

How to cite a paper/book in my posts #354

Closed ZhengYuan-Public closed 10 months ago

ZhengYuan-Public commented 10 months ago

I'm really new to jekyll-scholar for about one day and I need some tips about a few stupid questions...

How to cite a paper/book in my posts?

In the Citation part of the doc here, it says:

Simply use the cite tag with the appropriate key of the item you want to cite

and in the example text, it used {% cite derrida:purveyor %}, {% cite rabinowitz %}, {% cite breton:surrealism %} and {% cite rainey %}. But I've been struggling to find what's the appropriate key for the item.

For example, I have two entries in the file ./_bibliograph/books.bib

@book{ruby,
  title={The Ruby Programming Language},
  author={Flanagan, David and Matsumoto, Yukihiro},
  year={2008},
  publisher={O'Reilly Media}
}

@book{snyman2005practical,
  title={Practical mathematical optimization},
  author={Snyman, Jan A and Wilke, Daniel N and others},
  year={2005},
  publisher={Springer}
}

I tried to use {% cite ruby %} inside my text, but all I got was (missing reference). image

Can someone explain what's key I'm supposed to use, and the syntax in the example text (such as {% cite derrida:purveyor %} and {% cite rabinowitz %})?

inukshuk commented 10 months ago

This looks good. If the bib file above is configured as your default bibliography then {% cite ruby %} should work fine. For this to work you source and bibliography must be configured accordingly.

I suspect the file is not your default bibliography, but then you can still cite from it using the --file parameter. In your case probably {% cite ruby --file books %}.

ZhengYuan-Public commented 10 months ago

This looks good. If the bib file above is configured as your default bibliography then {% cite ruby %} should work fine. For this to work you source and bibliography must be configured accordingly.

I suspect the file is not your default bibliography, but then you can still cite from it using the --file parameter. In your case probably {% cite ruby --file books %}.

Thanks for your quick reply, {% cite ruby --file books %} solved my problem perfectly. ❤️

May I ask a question about the "preferred" way of keeping my bibliography?

When I'm using a citation management software, such as EndNotes, I'd typically create a new library for every homework/paper. Since there is a default bibliography, I assume it's a good practice to keep everything in a single file. I've been reading the docs about filters proviced by jekyll-scholar and I wonder if there is something like a keyword or flag that I can add to entries such that they can work as a project-wise filter?

inukshuk commented 10 months ago

I haven't been using the plugin in a long time myself so I'm not the best person to give advice. Generally speaking, most of the tags assume there's a default bibliography file and it will certainly require less fiddling if you just have one source. You can definitely add keywords to make it easier to set different filters for when you want to access only a sub-set of your file.

That said, it depends a lot on what you're planning to do. I imagine if you have separate sections on the page, each with separate bibliographies with little overlap it might be cleaner to keep separate bibliography files.

ZhengYuan-Public commented 10 months ago

I haven't been using the plugin in a long time myself so I'm not the best person to give advice. Generally speaking, most of the tags assume there's a default bibliography file and it will certainly require less fiddling if you just have one source. You can definitely add keywords to make it easier to set different filters for when you want to access only a sub-set of your file.

That said, it depends a lot on what you're planning to do. I imagine if you have separate sections on the page, each with separate bibliographies with little overlap it might be cleaner to keep separate bibliography files.

Thanks for your reply. 👍