Code Monkey home page Code Monkey logo

jekyll-scholar's Introduction

Jekyll-Scholar

CI

Jekyll-Scholar is for all the academic bloggers out there. It is a set of extensions to Jekyll, the awesome, blog aware, static site generator; it formats your bibliographies and reading lists for the web and gives your blog posts citation super-powers.

Already using Jekyll-Scholar and interested to help out? Please get in touch with us if you would like to become a maintainer!

Installation

$ [sudo] gem install jekyll-scholar

Or add it to your Gemfile:

gem 'jekyll-scholar', group: :jekyll_plugins

Github Pages

Note that it is not possible to use this plugin with the default Github pages workflow. Github does not allow any but a few select plugins to run for security reasons, and Jekyll-Scholar is not among them. You will have to generate your site locally and push the results to the master resp. gh-pages branch of your site repository. You can keep sources, configuration and plugins in a separate branch; see e.g. here for details.

Alternatively, you can use a Github Actions called jekyll-action to deploy your site to Github Pages

Usage

Install and setup a new Jekyll directory (see the Jekyll-Wiki for detailed instructions). To enable the Jekyll-Scholar add the following statement to a file in your plugin directory (e.g., to _plugins/ext.rb):

require 'jekyll/scholar'

Alternatively, add jekyll-scholar to your gem list in your Jekyll configuration:

plugins: ['jekyll/scholar']

Configuration

In your Jekyll configuration file you can adjust the Jekyll-Scholar settings using the scholar key. For example, the following sets the bibliography style to modern-language-association.

scholar:
  style: modern-language-association

The table below describes some commonly used configuration options. For a description of all options and their defaults, see defaults.rb.

Option Default Description
style apa Indicates the style used for the bibliography and citations. You can use any style that ships with CiteProc-Ruby by name (e.g., apa, chicago-fullnote-bibliography) which is usually the filename as seen here without the .csl ending; note that you have to use dependent/style if you want to use one from that directory. Alternatively you can add a link to any CSL style (e.g., you could link to any of the styles available at the official CSL style repository).
locale en Defines what language to use when formatting your references (this typically applies to localized terms, e.g., 'Eds.' for editors in English).
source ./_bibliography Indicates where your bibliographies are stored.
bibliography references.bib Indicates the name of your default bibliography. For best results, please ensure that your bibliography is encoded as ASCII or UTF-8. A string that contains a * will be passed to Dir::glob, so **/*.bib{,tex} will find all files named *.bib and *.bibtex under source.
allow_locale_overrides false When true, allows the language entry in the BibTex to override the locale setting for individual entries. When the language is missing it will revert back to locale. The language value should be encoded using the two-letter ISO 639-1 standard. Ex. English = 'en', Spanish = 'es'.
sort_by none Specifies if and how bibliography entries are sorted. Entries can be sorted on multiple fields, by using a list of keys, e.g. year,month. Ordering can be specified per sort level, e.g. order: descending,ascending will sort the years descending, but per year the months are ascending. If there are more sort keys than order directives, the last order entry is used for the remaining keys.
order ascending Specifies order bibliography entries are sorted in. Can be ascending or descending. Ordering can be specified per sort level, e.g. descending,ascending will sort in descending on the first key then ascending order on the second key. If there are more sort keys than order directives, the last order entry is used for the remaining keys.
group_by none Specifies how bibliography items are grouped. Grouping can be multi-level, e.g. type, year groups entries per publication type, and within those groups per year.
group_order ascending Ordering for groups is specified in the same way as the sort order. Publication types -- specified with group key type, can be ordered by adding type_order to the configuration. For example, type_order: [article,techreport] lists journal articles before technical reports. Types not mentioned in type_order are considered smaller than types that are mentioned. Types can be merge in one group using the type_aliases setting. By default phdthesis and mastersthesis are grouped as thesis. By using, for example, type_aliases: { inproceedings: article}, journal and conference articles appear in a single group. The display names for entry types are specified with type_names. Names for common types are provided, but they can be extended or overridden. For example, the default name for article is Journal Articles, but it can be changed to Papers using type_names: { article: Papers }.
bibtex_filters latex,smallcaps,superscript Configures which BibTeX-Ruby formatting filters values of entries should be passed through. The default latex filter converts LaTeX character escapes into unicode, smallcaps converts the \textsc command into a HTML <font style=\"font-variant: small-caps\"> tag, and superscript which converts the \textsuperscript command into a HTML <sup> tag.
raw_bibtex_filters Configures which BibTeX-Ruby formatting filters the raw BiBTeX entry (i.e. that available through {{ entry.bibtex }}) should be passed through. This can be used to e.g. strip excess newlines by using the linebreaks filter.

Bibliographies

Once you have loaded Jekyll-Scholar, all files with the extension .bib or .bibtex will be converted when you run Jekyll (don't forget to add a YAML header to the files); the file can contain regular HTML or Markdown and BibTeX entries; the latter will be formatted by Jekyll-Scholar according to the citation style and language defined in your configuration file.

For example, if you had a file bibliography.bib in your root directory:

---
---
References
==========

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

It would be converted to bibliography.html with the following content:

<h1 id='references'>References</h1>

<p>Flanagan, D., &#38; Matsumoto, Y. (2008). <i>The Ruby Programming Language</i>. O&#8217;Reilly Media.</p>

This makes it very easy for you to add your bibliography to your Jekyll-powered blog or website.

If you are using other converters to generate your site, don't worry, you can still generate bibliographies using the bibliography tag. In your site or blog post, simply call:

{% bibliography %}

This will generate your default bibliography; if you use multiple, you can also pass in a name to tell Jekyll-Scholar which bibliography it should render.

Let's say you have two bibliographies stored in _bibliography/books.bib and _bibliography/papers.bib; you can include the bibliographies on your site by respectively calling {% bibliography --file books %} and {% bibliography --file papers %}. For example, you could have a file references.md with several reference lists:

---
title: My References
---

{{ page.title }}
================

The default Bibliography
------------------------

{% bibliography %}

Secondary References
--------------------

{% bibliography --file secondary %}

Finally, the bibliography tag supports an optional filter parameter. This filter takes precedence over the global filter defined in your configuration.

{% bibliography --query @*[year=2013] %}

The example above would print a bibliography of all entires published in the year 2013. Of course you can also combine the file and filter parameters like this:

{% bibliography -f secondary -q @*[year=2013] %}

This would print the publications from 2013 of the bibliography at _bibliography/secondary.bib.

For more details about filters, see the corresponding section below or consult the BibTeX-Ruby documentation.

If you need to limit the number of entries in your bibliography, you can use the --max option:

{% bibliography --max 5 %}

This would generate a bibliography containing only the first 5 entries of your bibliography (after query filters and sort options have been applied). Limiting entries is disabled if grouping is active.

Return number of publications in bibliography

The bibliography_count returns the number of items that would be rendered in a bibliography. This tag accepts the same parameters as the bibliography tag.

{% bibliography_count -f references --query @book[year <=2000] %}

See #186 for further examples.

Bibliography Template

Your bibliography is always rendered as an ordered list. Additionally, each reference is wrapped in an HTML tag (span by default but you can change this using the reference_tagname setting) with the cite key as id. The reference string itself is governed by the rules in your CSL style but you can also customize the main template a little bit. By default, the template is {{reference}} – this renders only the reference tag. The template uses Liquid to render and, in addition to the reference, exposes the cite-key (as key), the entry's type, the index in the bibliography, and the link to file repository as link. Thus, you could customize the template in your configuration as follows:

scholar:
  bibliography_template: <abbr>[{{key}}]</abbr>{{reference}}

This would be processed into something like:

<li><abbr>[ruby]</abbr><span id="ruby">Matsumoto, Y. (2008). <i>The Ruby Programming Language</i>. O&#8217;Reilly Media.</span></li>

If you have more complex requirements, it quickly becomes tedious to have the template inside the configuration; for this reason, you can also put the bibliography template into your layouts directory. Jekyll-Scholar will load this template if the option set in your configuration matches an existing layout (without the file extension). That is to say, if you set:

scholar:
  bibliography_template: bib

And there is a file _layouts/bib.html (or with another extension) the contents of this file will be used as the template. Please note that it is important for this file to contain the YAML front matter! For example, this would be a more complex template file:

---
---
{{ reference }}

{% if entry.abstract %}
<p>{{ entry.abstract }}</p>
{% endif %}

<pre>{{ entry.bibtex }}</pre>

You can also override the default bibliography template, by passing the --template or -T option parameter to the bibliography tag.

Citations

If you want to reference books or papers from your bibliography in your blog posts, Jekyll-Scholar can help you, too. Simply use the cite tag with the appropriate key of the item you want to cite and Jekyll-Scholar will create a formatted citation reference for you. For a quick example, take following blog post:

---
layout: default
title: A Blogging Scholar
---

{{ page.title }}
================

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis 'aute irure dolor in reprehenderit in voluptate' {% cite derrida:purveyor %}
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, 'sunt in culpa qui officia deserunt mollit anim id est
laborum' {% cite rabinowitz %}.

Duis 'aute irure dolor in reprehenderit in voluptate' {% cite breton:surrealism %}
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, 'sunt in culpa qui officia deserunt mollit anim id est
laborum' {% cite rainey %}.

References
----------

{% bibliography %}

Note that this will print your entire bibliography in the Reference section. If you would like to include only those entries you cited on the page, pass the cited option to the bibliography tag:

{% bibliography --cited %}

By default, the --cited option will still sort your bibliography if you set the sort option. Especially for styles using citation numbers, this is usually not the desired behaviour. In such cases you can use --cited_in_order instead of --cited and your bibliography will contain all cited items in the order they were cited on the page.

For longer quotes, Jekyll-Scholar provides a quote tag:

{% quote derrida:purveyor %}
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor.

Lorem ipsum dolor sit amet, consectetur adipisicing.
{% endquote %}

For example, this could be rendered as:

<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,<br/>
  sed do eiusmod tempor.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing.</p>
  <cite>
    <a href="#derrida:purveyor">(Derrida, 1975)</a>
  </cite>
</blockquote>

Multiple citation

You can cite multiple items in a single citation by referencing all ids of the items you wish to quote separated by spaces. For example, {% cite ruby microscope %} would produce a cite tag like:

<a href="#ruby">(Flanagan &amp; Matsumoto 2008; Shaughnessy 2013)</a>

Citations when there's more than one bibliography

Let's return to the example above where you have two bibliographies stored in _bibliography/books.bib and _bibliography/papers.bib. We also must have the main bibliography, e.g., _bibliography/references.bib. As we know from above, it's possible to use bibliographies other than the main bibliography by calling {% bibliography --file books %} or {% bibliography --file papers %}.

Though what if we want to cite an article that's not in the main bibliography? We use the same approach as above; to cite an article in the books.bib bibliography, we simply call {% cite ruby --file books %}

Suppressing author names

Sometimes you want to suppress author names in a citation, because the name has already been mentioned in your text; for such cases Jekyll-Scholar provides the --suppress_author option (short form: -A): ...as Matz explains {% cite ruby -A -l 42 %} would produce something like: ...as Matz explains (2008, p. 42).

Page numbers and locators

If you would like to add page numbers or similar locators to your citation, use the -l or --locator option. For example, {% cite ruby --locator 23-5 %} would produce a citation like (Matsumoto, 2008, pp. 23-5).

When quoting multiple items (see above) you can add multiple locators after the list of ids. For example, {% cite ruby microscope -l 2 -l 24 & 32 %}.

Page is the default locator, however, you can indicate the type of locator by adding a -L or --label option (one for each locator) for instance, {% cite ruby microscope --label chapter --locator 3 -L figure -l 24 & 32 %} produces something like: (Matsumoto, 2008, chap. 3; Shaughnessy, 2013, figs. 24 & 32).

Displaying formatted references

If you want to display the full formatted reference entry, you can use the reference tag. For example, given the following Bibtex entry,

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

using {% reference ruby %} anywhere in your page, it will print "Flanagan, D., & Matsumoto, Y. (2008). The Ruby Programming Language.. O'Reilly Media" (the exact result depends on your formatting style).

The reference tag accepts the same --file/-f parameter as the bibliography tag. This can be handy if you want to use a special BibTeX file as input for a specific page. As an example, the tag

{% reference ruby --file /home/foo/bar.bib %}

will attempt to read the key ruby from file /home/foo/bar.bib. It will not fallback to the default BibTeX file.

Citation pointing to another page in your site

In some cases, you might want your citation to link to another page on your cite (ex. a separate works cited page). As a solution, add a relative path to your scholar configurations:

    scholar:
      relative: "/relative/path/file.html"

Multiple bibliographies within one document (like multibib.sty)

When you have multiple {% bibliography %} sections in one file, Jekyll-Scholar will generate several lists containing the same publications that have the same id attributes. As a result, when you cite a reference the link to an id attribute cannot be resolved uniquely. Your browser will always take you take you to the first occurrence of the id. Moreover, valid HTML requires unique id attributes. This scenario may happen, for example, if you cite the same reference in different blog posts, and all of these posts are shown in one html document.

As a solution, Jekyll-Scholar provides the --prefix tag. In your first post you might cite as

---
title: Post 1
---
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis 'aute irure dolor in reprehenderit in voluptate'
{% cite derrida:purveyor --prefix post1 %} velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, 'sunt in culpa qui officia deserunt mollit anim id
est laborum' {% cite rabinowitz --prefix post1 %}.

References
----------

{% bibliography --cited --prefix post1 %}

For the second blog post you would cite as follows:

---
title: Post 2
---
Duis 'aute irure dolor in reprehenderit in voluptate'
{% cite rabinowitz --prefix post2 %} velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, 'sunt in culpa qui officia deserunt mollit anim id
est laborum' {% cite rainey --prefix post2  %}.

References
----------

{% bibliography --cited --prefix post2 %}

Even though both posts cite 'rabinowitz', both citations will be assigned unique identifiers linking to the respective references section, although both posts will be rendered into a single HTML document.

Add a custom class for the citation reference

By default Jekyll Scholar generate a link with a class:

<a href="#ruby" class="citation">(Derrida, 1975)</a>

You can custom this class in your configuration:

scholar:
  cite_class: citation

File Repositories

File repository support was added to Jekyll-Scholar starting at version 2.0. Currently, if you have a folder in your site that contains PDF or Postscript files of your papers, you can use the configuration option repository to indicate this directory. When generating bibliographies, Jekyll-Scholar will look in that folder to see if it contains a filename matching each entry's BibTeX key: if it does, the path to that file will be exposed to the bibliography template as the link property.

Since version 4.1.0 repositories are not limited to PDF and PS files. These files are mapped to the links property in your bibliography template. Here is an example of template that utilizes this feature to link to supporting material in a ZIP archive:

{{ reference }} [<a href="{{links.zip}}">Supporting Materials</a>]

Since version 5.9.0, Jekyll-Scholar matches files which begin with a BibTeX key and are immediately followed by a delimiter (default: "."). All text proceeding the delimiter is treated as the file extension. For example, if two files named key.pdf and key.slides.pdf are found, {{links.pdf}} and {{links['slides.pdf']}} will both be populated. You can use the configuration option repository_file_delimiter to change the default delimiter.

Detail Pages

If your layouts directory contains a layout file for bibliography details (the details_layout configuration options), Jekyll-Scholar will generate a details page for each entry in you main bibliography. That is to say, if your bibliography contains the following entry:

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

Then a page 'bibliography/ruby.html' will be generated according to your details page layout. In the layout file, you have access to all fields of your BibTeX entry. Here is an example of a details page layout:

---
---
<html>
<head></head>
<body>
  <h1>{{ page.entry.title }}</h1>
  <h2>{{ page.entry.author }}</h2>
  <p>{{ page.entry.abstract }}</p>
</body>
</html>

When Jekyll-Scholar generates detail pages, it also adds links to each entry's detail page to the generated bibliography. You can alter the name of the link via the 'details_link' configuration option.

Jekyll-Scholar also provides a Liquid tag for conveniently adding links to individual detail pages. For example, if you would like to add a simple link to one of the items in your bibliography on a page or in a blog post you can use the cite_details tag to generate the link. For this to work, you need to pass the BibTeX key of the element you want to reference to the tag and, optionally, provide a text for the link (the default text can be set via the 'details_link' configuration option).

Duis 'aute irure dolor in reprehenderit in voluptate' velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident {% cite_details key --text Click Here For More Details %}.

Alternatively, you can use the details_link tag to get just the URL to a details page. This can be used to link to details pages in markdown the same way you would link to a blog post with Jekyll's link tag.

[See our blog post]({% link _posts/2020-01-01-research-post.md %}) 
or [find more details]({% details_link key %}).

Bibliography Filters

By default, Jekyll-Scholar includes all entries in you main BibTeX file when generating bibliographies. If you want to include only those entries matching certain criteria, you can do so by adjusting the 'query' configuration option. For example:

query: "@book" #=> includes only books
query: "@article[year>=2003]" #=> includes only articles published 2003 or later
query: "@*[url]" #=> includes all entries with a url field
query: "@*[status!=review]" #=> includes all entries whose status field is not set to 'review'
query: "@book[year <= 1900 && author ^= Poe]" #=> Books published before 1900 where the author matches /Poe/
query: "!@book" #=> includes all entries with a type other than book

Please note that some of these queries require BibTeX-Ruby 2.3.0 or later versions. You can also overwrite the configuration's query parameter in each bibliography tag individually as described above.

Contributing

The Jekyll-Scholar source code is hosted on GitHub. You can check out a copy of the latest code using Git:

$ git clone https://github.com/inukshuk/jekyll-scholar.git

To use this lasted version instead of the one provide by RubyGems, just add the line

$:.unshift '/full/path/to/the/repository/lib'

to your _plugins/ext.rb before requiring 'jekyll/scholar', where /full/path/to/the/repository is the path to your local version of Jekyll-Scholar.

When contributing to Jekyll-Scholar, please make sure to install all dependencies and run the cucumber features:

$ bundle install
$ rake

If you've found a bug or have a question, please open an issue on the Jekyll-Scholar issue tracker. Or, for extra credit, clone the Jekyll-Scholar repository, write a failing example, fix the bug and submit a pull request.

Additionally, if we merged at least one of your pull request you will get write permissions to the repository if you want them.

License

Jekyll-Scholar is distributed under the same license as Jekyll.

Copyright (c) 2011-2015 Sylvester Keil

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jekyll-scholar's People

Contributors

alzeih avatar antoinentl avatar ashinkarov avatar bronsonp avatar elotroalex avatar gousiosg avatar hendrikvanantwerpen avatar ignoredambience avatar iiegn avatar inukshuk avatar joostvanpinxten avatar lianne avatar luisggpina avatar mamoll avatar matthieucan avatar mdave avatar nickswalker avatar pbinkley avatar pkok avatar reitzig avatar rkaminsk avatar rseac avatar scotthewitt avatar sgroth avatar shadensmith avatar stevecheckoway avatar thhagelmayer avatar tobias-f avatar tom-jin avatar xvazquezc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jekyll-scholar's Issues

removing url description from reference

Hi,
I have jekyll-scholar setup correctly but I have one remaining issue that whenever I have a URL in my bibtex I get a line at the end of the reference like this:

Maher B. A., Ahmed I. A. M., Davison B., Karloukovski V. and Clarke R. (2013) Impact of roadside tree lines on indoor concentrations of traffic-derived particulate matter. Environmental science & technology 47, 13737–13744. Available at: http://pubs.acs.org/doi/abs/10.1021/es404363m.
Bibtex URL

How can I stop this link from appearing at the end of the reference?

Displaying reference key or prefix for publications

Is it possible to display the reference key along with the reference itself? Alternatively, it would be great to have support for customizing the display. For example:

[C1]  Author1, Author2 , Title, ....

[C2]  Author1, Author2 , Title, ....

[J1]  Author1, Author2 , Title, ....

[J2]  Author1, Author2 , Title, ....

In my case C are prefixes I attach to conference publications, and J to journals. Should we do this in extras or in core scholar?

Create links to preprint, doi from CSL

Hey,

Would it be possible to create additional links to, for example, the preprint in CSL.
A trick that used to work was adding some HTML to a custom CSL macro like

  <macro name="access">
    <!-- custom links -->

    <choose>
      <if variable="preprint">
        <text variable="preprint" prefix="&lt;a href=&quot;" suffix="&quot;&gt;[preprint]&lt;/a&gt; "/>
      </if>
    </choose>

But it just renders as escaped HTML entities now. Is there a fix for this?

Thanks in advance.

Queries do not work as advertised

Hi, it's me again :)

It seems that not all the queries that are mentioned on the page work correctly. For example "@*[url]" doesn't work at all. See an example:

irb(main):001:0> require 'bibtex'
=> true
irb(main):002:0> b = BibTeX.parse("@book{x, url={http://x.x}}  @book{y, title={a}}")
=> #<BibTeX::Bibliography data=[2]>
irb(main):004:0> b["@book"]
=> [#<BibTeX::Entry url = http://x.x>, #<BibTeX::Entry title = a>]
irb(main):005:0> b["@*[url]"]
=> []

May be it is just a matter of the syntax, but it shouldn't return an empty list. Maybe it should go to one of the tests...

Having said that, would it be possible to implement support for query modifiers like negation? I mean the following:

irb(main):004:0> b = BibTeX.parse("@book{xx, title=book} @journal{yy, title=journal}")
=> #<BibTeX::Bibliography data=[2]>
irb(main):005:0> b.query(:not, "@book")
=> [#<BibTeX::Entry title = journal>]

However, when the argument is passed through "[]", you can pass only the last part... So wen you use it from bibliography tags or similar you cannot express this behaviour, which might be very useful.

Second argument to bibliography tag

I like your plugin, it seems to be the best for bibtex & jekyll;
I looked through other issues on the page, and saw a very important suggestion (which is not yet implemented),
regarding filter argument to the bibliography tag;
{% bibliography filter: "@book" %}
It would be exteremely useful. I am a newbie to Jekyll & all this stuff, maybe it is simple to do so, but I think that the following usecase is important:

2012
Publications in year 2012
2011
Publications in year 2011

and so on;

Create a page for peer-reviewed papers and preprints. I can generate the corresponding .bib files in advance, but it is not very natural.
The query tag in the scholar settings is not enought, since it does not allow the generation of publications by year and so forth.

Is there a plan for this implementation, or are there significant difficulties in implementation? I am not an expert in Ruby at all.

Detail Pages Details Links Broken

Links from a bibliography page to the details of an entry via the details page functionality does not work as documented due to the default permalink setting of pretty with Jekyll 2.2.0.

bibliography/ruby.html is actually made as bibliography/ruby/index.html under default settings

Add link to external file other than PDF

Hello,

The current options in the bibliography template below allows only linking a PDF file. I wish to add links to additional materials as DOC and PPT. I am also interested in adding an image file in the form of a collbsable block similar to abstract. Could you please let me know if that is possible?

Thanks.



{{reference}}

{% if entry.abstract %}

{{entry.abstract}}

{% endif %}
{{entry.bibtex}}

conflicit with jekyll_figure plugin

When I use both jekyll_figure and jekyll-scholar, it will show error:

 Liquid Exception: Unknown tag 'figure' in _posts/...

My _config.yml including:

gems: [jekyll/scholar] 
gems: [jekyll_figure]

figures:
  dir: /assets/images
  enumerate: true

scholar:
  style: apa
  locale: en
  sort_by: none
  order: ascending
  # source: ./_bibliography
  source: /assets/bibliography
  bibliography: references.bib
  bibliography_template: "{{reference}}"
  replace_strings: true
  join_strings:    true
  details_dir:    bibliography
  details_layout: bibtex.html
  details_link:   Details
  query: "@*"

Nested braces in .bib files

Hi there

I found out today when I was putting a valid bibtex item in my publication list, that if you have something like:
...
title = {{xyz}, {xyz}},
...

then "rake generate" dies with the following output:

Building site: source -> public
Liquid Exception: Variable '{{Data Layout Inference for Code Vectorisation}' was not properly terminated with regexp: /\}\}/  in data-layouts.html
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:78:in `create_variable'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:38:in `parse'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/document.rb:5:in `initialize'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:58:in `new'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:58:in `parse'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:46:in `parse'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/convertible.rb:79:in `do_layout'
/home/tema/doc/ashinkarov-blog/plugins/post_filters.rb:167:in `do_layout'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/page.rb:100:in `render'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:204:in `block in render'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:203:in `each'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:203:in `render'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:41:in `process'
/home/tema/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/bin/jekyll:264:in `<top (required)>'
/home/tema/.rbenv/versions/1.9.3-p194/bin/jekyll:23:in `load'
/home/tema/.rbenv/versions/1.9.3-p194/bin/jekyll:23:in `<main>'
Build Failed

I am not sure yet who is killing it, but may be you guys will have ideas from the top of your heads?

Cheers,
Artem.

Bad Performance and problem with locale

I am still having a really bad performance with jekyll-scholar. With only 170 md files and 57 bib files jekyll needs more than 2/3 minutes to generate the site. If I remove the plugin of jekyll-scholar, it takes less than 30 sec.

After the last gem update, I am now if a new problem. Looks like the process is interrupted. After 5 min without any output, I interrupted it with CTRL-C. The following is the output:

$ jekyll
Configuration from /mysite/_config.yml
/Library/Ruby/Gems/1.8/gems/citeproc-ruby-0.0.6/lib/plugins/formats/default.rb:9: warning: already initialized constant Token
/Library/Ruby/Gems/1.8/gems/citeproc-ruby-0.0.6/lib/plugins/formats/default.rb:10: warning: already initialized constant AffixFilter
Building site: /mysite -> /mysite/_site

^CERROR  CiteProc : Failed to open locale file, falling back to default:
^CERROR  CiteProc : Failed to open locale file, falling back to default:
^CERROR  CiteProc : Failed to open locale file, falling back to default:
^CERROR  CiteProc : Failed to open locale file, falling back to default:
^CERROR  CiteProc : Failed to open locale file, falling back to default:
^C/Library/Ruby/Gems/1.8/gems/nokogiri-1.5.9/lib/nokogiri/xml/node_set.rb:237:in `each': Interrupt

Any idea?

DOC: should note that bib file needs UTF-8 encoding

this type of error is caused by characters that are not UTF-8 encoded

Liquid Exception: invalid byte sequence in UTF-8 in _posts/2014-01-09-visualizable-regression-network.md

/Library/Ruby/Gems/2.0.0/gems/bibtex-ruby-2.3.4/lib/bibtex/lexer.rb:217:in `scan_until': invalid byte sequence in UTF-8 (ArgumentError)

this can be solved by changing the encoding in emacs or other software to UTF-8

might be nice to document this somewhere.

Inline bibtex

Is it possible to get inline bibtext support? So instead of having a seperate .bib file, you can just use liquid capture tags in the relevant page. Something like:

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

or maybe {% bibliography --inline %} and {% endbibliography %}.

Add per-page configuration options

The cite tag produces the output (missing reference) when a post is using a bibliography specified by the --file parameter.


---

---
Lorem ipsum {% cite foobar1980 %}
{% bibliography --file bibliography2 %}

Additionally passing the bibliography file to the cite tag via the --file parameter causes it to output the cite-key: (foobar1980). It fails to format the citation according to the specified style and fails to generate a link to the bibliography entry at the bottom of the page.


---

---
Lorem ipsum {% cite foobar1980 --file bibliography2 %}
{% bibliography --file bibliography2 %}

I do not have much experience with Ruby and the Jekyll-Scholar codebase, but I believe that citations are only considering the bibliography specified by _config.yml. A simple fix for this issue would be to allow users to specify a post-specific bibliography in the post's YAML front-matter:


---
scholar:
  bibliography: bibliography2
----
Lorem ipsum {% cite foobar1980 %}
{% bibliography %}

Embedded TeX in BibTeX

Are there plans in getting jekyll-scholar to handle TeX commands within the BibTex files? For example, I could have a title that looks like:

title={{$I_{S}A$}},
...

Any suggestions on how to handle this?

Extras: Bibliography ordered By year, By Type, By Author

I believe scholar already has these features through query (maybe not author). However, I find that having special tags or parameters to go along with the bibliography to generate a bibliography ordered by year, bibliography ordered by type, and bibliography ordered by year/type for an author is useful.

Once again, I understand that some of these can be implemented with a combination of existing query features and HTML, which we could just provide alternatively.

Usage information?

Hello,

I'm interested in using jekyll-scholar for my publications. Would it be possible to have more information on the usage of jekyll-scholar?

Thanks for your help.
-- Hiren

Single link for multi-citation

When using multi-citation e.g. {% cite ruby microscope %}, the output HTML has only a single link to the first item in citations, as indicated in the README:

<a href="#ruby">(Flanagan &amp; Matsumoto 2008; Shaughnessy 2013)</a>

It would be nice to have support for multiple links - one for each citation. As discussed further in #41, the citations are rendered by cite processor and there needs to be a way to hook/hack into it.

Regarding "how it should look", I think one solution would be to always hook into the citeproc and add links for the cite item, but not parentheses, e.g. (Flanagan & Matsumoto 2008; Shaughnessy 2013) or [1, 2].

(<a href="#ruby">Flanagan &amp; Matsumoto 2008</a>; <a href="#microscope">Shaughnessy 2013</a>)

For single-cite items it would also change, becoming (Flanagan & Matsumoto 2008) or [1].

(<a href="#ruby">Flanagan &amp; Matsumoto 2008</a>)

Multiple citations

Is there a way to cite multiple keys in the same {% cite .. %} block? I.e. to replicate LaTeX's \cite{citation01,citation02,citation03}?

As I understand, CSL allows indicating delimiters for multi-key citations, but is such the input supported by jekyll-scholar? I tried to guess, e.g. use {% cite citation01 citation02 %}, but it does not seem to be the solution.

Thanks!

Details for a custom file

When using custom file for a bibliography, details are not being generated (htmls are not reneded) for the entries of the file. On the other hand, the links for the items are generated, as the details_layout may exist in config. There is no way to switch it off detail link generation for a particular bibliography item.

  1. I would propose to support detail generation for custom files.
  2. I would propose to have an option to switch the details off for a certain bibliography tag.

Cheers,
Aretm.

absolute paths in reference tag not working

While working on the documentation I think I found a minor bug:

{% reference ruby --file /home/foo/bar.bib %}

does not seem to work as expected. I get the error message

Liquid Exception: No such file or directory - ./_bibliography/home/foo/bar.bib.bib ...

It does seem to work when I specify a filename instead of an absolute path, however.

Unclear how to deal with in-text citations

Under a citation style such as APA for example, it is convenient to be able to control when parentheses must be used. I would like to say for example " Sutton, Precup & Singh (1998) proposes a model [...]" rather than producing " (Sutton, Precup & Singh, 1998) proposes a model" by the current {% cite %} mechanism.

In Latex, these cases can be handled with \parencite, \textcite under Memoir, or \citep and \citet with Natbib.

Is there any plan to include such functionality ?

{{entry.type}} produces "Liquid error: undefined method `to_liquid' for :inproceedings:Symbol:"

Hi, I'm trying to format a custom bibliography based on a bibliography_template layout, and while {{entry.author}} and the like work perfectly fine, I cannot seem to access {{enty.type}}. I'm not sure this is a bug, though:

I found this discussion here about symbols vs. strings as hash table keys and their interplay with liquid, but I don't know enough ruby to connect the dots and produce a workaround in my installation. Could someone perhaps give me a hint on what needs to be done where to enable liquid access to entry.type (ideally in if-clauses)?

Filter based on which tags are cited on current page

This plugin is great! I love being able to easily place citations. However, I'd like the option to have it only include cited references in the bibliography. Similar to how latex works unless you issue a \nocite{*}. This would help so that I don't need different bibliographies for different posts.

Support jekyll's -s command line switch

Installed jekyll-scholar (v 4.0.4) on Debian 7 using gem install jekyll-scholar.
Used the default settings, created a barebones post, and building the site gave this error:

Liquid Exception: No such file or directory @ rb_sysopen - ./_bibliography/references.bib.bib in _posts/2014-07-18-jekyll-scholar.md

Here are the details. The content of the markdown file:


---
layout: post
title: "Adding bibliographies and citations"
date: 2014-07-18 16:00
tags: jekyll scholar

---

{{ page.title }}
================
Duis 'aute irure dolor in reprehenderit in voluptate' velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, 'sunt in culpa qui officia deserunt 
mollit anim id est laborum'.

References
----------
{% bibliography %}

In _plugins/ext.rb I put the line require 'jekyll/scholar'.
I used the default scholar params in _config.yml:

scholar:
  style: apa
  locale: en
  sort_by: none
  order: ascending
  source: ./_bibliography
  bibliography: references.bib
  bibliography_template: "{{reference}}"
  replace_strings: true
  join_strings:    true
  details_dir:    bibliography
  details_layout: bibtex.html
  details_link:   Details
  query: "@*"

(Sidenote: all keys from bibliography_template and down could be removed, jekyll build still gave the same error message.)

I changed the 'bibliography' setting to just references (without the *.bib) but got the same error except it now pointed to the correct file:

Liquid Exception: No such file or directory @ rb_sysopen - ./_bibliography/references.bib in _posts/2014-07-18-jekyll-scholar.md

The bib-file was named references.bib and located in _bibliography, in the jekyll site source directory (next to _posts, _plugins, etc.). For good measure, here it is:

@book{Adachi1999,
author = {Adachi, Sadao},
editor = {Adachi, Sadao},
isbn = {978-0-7923-8567-7},
pages = {714},
publisher = {Springer Verlag},
title = {{Optical Constants of Crystalline and Amorphous Semiconductors - Numerical Data and Graphical Information}},
year = {1999}
}
@book{Albery1975,
address = {Oxford},
author = {Albery, John},
publisher = {Clarendon Press},
title = {{Electrode kinetics}},
year = {1975}
}
@book{Atkins2001,
author = {Atkins, Peter},
edition = {third},
isbn = {0-19-879290-5},
publisher = {Oxford University Press},
title = {{The Elements of Physical Chemistry}},
year = {2001}
}
@book{Atkins2002,
author = {Atkins, Peter and de Paula, Julio},
edition = {seventh},
isbn = {0-19-879285-9},
publisher = {Oxford University Press},
title = {{Atkins' Physical Chemistry}},
year = {2002}
}
@book{Attwood1999,
author = {Attwood, David},
isbn = {0-521-65214-6},
publisher = {Cambridge University Press},
title = {{Soft X-rays and extreme ultraviolet radiation Principles and Applications}},
year = {1999}
}
@phdthesis{Avendano2004,
author = {Avenda\~{n}o, Esteban},
school = {Uppsala university},
title = {{Electrochromism in Nickel-based Oxides}},
type = {PhD thesis},
url = {http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-4307},
year = {2004}
}
@book{Bagotsky2006,
author = {Bagotsky, V. S.},
edition = {2},
isbn = {978-0-471-70058-6},
publisher = {Wiley-Interscience},
title = {{Fundamentals of electrochemistry}},
year = {2006}
}

And I checked, the bibtex file is UTF8/ASCII.

This error causes the site to completely fail to render, and I have found no way around it other than disabling jekyll-scholar and removing all its commands from the markdown file.
As far as I can tell, jekyll-scholar is actually installed properly in the gems folder. I am new to jekyll and ruby, so it could be that I am missing something obvious. Any suggestions?

Render multiple times with different styles?

Hello, Thanks for creating this plugin, its great!

I was wondering if there would be an easy way to select the rendering style for different invocations of {% bibliography %}.

I know it is possible to select the file to use, however I was trying to use the same BibTeX file but render with a summarized style and then in a more verbose one.

I think this somewhat in line with issue #18

Any pointer in the right direction would be appreciated
Thanks

Syntax examples

This is not a real issue but I don't know where else to bring this up.

Is there any reference to the syntax of jekyll-scholar? Should I look for BibTex examples?

For example, I'm looking for making in-text citations of the form:

  • " ...some of the examples can be found in [1] and [2]"
  • "...adapted from Wood and Brown (1982)"

Btw, I appreciate this gem, it's a nice tool.

cite_details tag?

Given that generation of the details pages is a part of the core jekyll-scholar, wouldn't it make sense to have a cite_details tag, which links to the details page? I did this in jekyll-scholar-extras, but it seems to be more of a core functionality ... ? cite_details

Turning URLs into links

I want URLs in citations to be links, and I have monkey patched the reference_tag method to allow this:

module Jekyll
  class Scholar
    module Utilities

      alias_method :original_reference_tag, :reference_tag

      def reference_tag(entry)
        return missing_reference unless entry

        # Change URLs into markdown links
        entry["url"] = "[#{entry["url"]}](#{entry["url"]})" if entry["url"]

        entry = entry.convert(*bibtex_filters) unless bibtex_filters.empty?
        reference = CiteProc.process entry.to_citeproc,
          :style => style, :locale => config['locale'], :format => 'html'

        content_tag reference_tagname, reference,
          :id => [prefix, entry.key].compact.join('-')
      end
    end
  end
end

You can see that I change entry["url"] into a markdown link, which is then picked up my the markdown processor. You can see this at work at http://blog.martinfenner.org/about.html. Is this the correct way of doing this? I'm using Pandoc as markdown processor and in the default configuration it doesn't recognize blank URLs.

We could do something similar for entry["doi"], as some styles display the DOI.

cite outputs (bibtexkey), not (Author year)

I've just installed jekyll-scholar - great piece of kit.

All works fine except that when I insert a citation, the output includes the character string of my tag, such as (frackstop2011), not the correct output (Engelder et al. 2011).
Seems to be related to this issue #36 but the related answer does not work in my case.

Why is this? Seems problematic for default behaviour.
Please see my example page here:

screenshot from 2014-01-01 19 54 22

https://github.com/Robinlovelace/robinlovelace.github.io/blob/master/_posts/2013-01-01-fracking.md

Also (and may be related) I'm getting the following build error sent to me by GitHub: "The tag cite in _posts/2013-01-01-fracking.md/#excerpt is not a recognized Liquid tag."

Any ideas?

Error installing on Yosemite

I installed jekyll-scholar on Ubuntu and it's working fine. On Yosemite however, I'm getting this:

reshut2-86-219-dhcp:~ raulvalenzuela$ sudo gem install jekyll-scholar
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll-scholar:
    ERROR: Failed to build gem native extension.

    /Users/raulvalenzuela/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb
creating Makefile

make  clean

make
compiling unicode.c
make: *** [unicode.o] Segmentation fault: 11

make failed, exit code 2

Gem files will remain installed in /Users/raulvalenzuela/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/gems/1.9.1/gems/unicode-0.4.4.1 for inspection.
Results logged to /Users/raulvalenzuela/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-13/1.9.1/unicode-0.4.4.1/gem_make.out

Using Liquid variable inside query

Hi,

I'd like to access a Liquid variable inside a bibliography query, something like:

{% assign yr = 2008 %}
{% bibliography --query @*[year={{ yr }}] %}

However, the bibliography tag does not evaluate/interpolate yr. Any idea how to get this working?

Thanks!

Trouble running on osx mavericks : cannot load such file -- bibtex (LoadError)

Hi There

Thank you for this wonderful effort. I would love to get this working. Am just starting with jekyllbootstrap so maybe my question is just ignorant.

This is my jkblog:

https://github.com/stnava/stnava.github.com

I followed your instructions (sudo gem install ... ) and then added:

cat _plugins/bib.rb
require 'jekyll/scholar'

but when i do ( * here is the problem * )

jekyll serve

Configuration file: /Users/stnava/code/stnava.github.com/_config.yml
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- bibtex (LoadError) from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-scholar-1.2.4/lib/jekyll/scholar.rb:6:in <top (required)>' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:135:inrequire'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:144:inrequire'
from /Users/stnava/code/stnava.github.com/_plugins/bib.rb:1:in <top (required)>' from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:77:inblock (2 levels) in setup'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:76:in each' from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:76:inblock in setup'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:75:in each' from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:75:insetup'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:29:in initialize' from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:5:innew'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:5:in process' from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.2/bin/jekyll:97:inblock (2 levels) in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in call' from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:incall'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:155:in run' from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:402:inrun_active_command'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:66:in run!' from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/delegates.rb:7:inrun!'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'

my gem list is here:

*** LOCAL GEMS ***

bibtex-ruby (2.3.4)
blankslate (2.1.2.4)
CFPropertyList (2.2.0)
citeproc (0.0.9)
citeproc-ruby (0.0.6)
classifier (1.3.4)
colorator (0.1)
commander (4.1.5)
fast-stemmer (1.0.2)
fastercsv (1.5.5)
ffi (1.9.3)
highline (1.6.20)
jekyll (1.4.2)
jekyll-import (0.1.0)
jekyll-scholar (1.2.4)
kramdown (1.3.1)
latex-decode (0.1.1)
libxml-ruby (2.6.0)
liquid (2.5.4)
listen (1.3.1)
little-plugger (1.1.3)
logging (1.8.1)
maruku (0.7.0)
mini_portile (0.5.2)
multi_json (1.3.7, 1.3.5)
namae (0.8.1)
nokogiri (1.5.6)
parslet (1.5.0)
posix-spawn (0.3.8)
pygments.rb (0.5.4)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
rb-kqueue (0.2.0)
rbibtex (0.1.0)
redcarpet (2.3.0)
rubygems-update (2.2.1)
safe_yaml (0.9.7)
sqlite3 (1.3.7)
toml (0.1.0)
unicode (0.4.4)
yajl-ruby (1.1.0)

can you see the problem here?

again - thanks for your help.

Performance of jekyll-scholar

Before start to use jekyll-scholar, the compilation of my site used to take about 1 or 2 seconds. After start to use jekyll-scholar, the compilation now takes about 20 or more seconds:

$ time jekyll
Configuration from /Users/arademaker/Sites/arademaker.github.com/_config.yml
/Library/Ruby/Gems/1.8/gems/citeproc-ruby-0.0.6/lib/plugins/formats/default.rb:9: warning: already initialized constant Token
/Library/Ruby/Gems/1.8/gems/citeproc-ruby-0.0.6/lib/plugins/formats/default.rb:10: warning: already initialized constant AffixFilter
Building site: /Users/arademaker/Sites/arademaker.github.com -> /Users/arademaker/Sites/arademaker.github.com/_site
Successfully generated site: /Users/arademaker/Sites/arademaker.github.com -> /Users/arademaker/Sites/arademaker.github.com/_site

real    0m20.082s
user    0m18.944s
sys 0m1.059s

Any idea? It doen't seems to be related with the parser of the bibtex file (I have only one). I made some tests with the bibtex-ruby and the parser takes not more than 1 second with the same bibtex file.

YAML error with default scholar settings

When using the default jekyll-scholar settings in my _config.yml file, I get the following error from safe-yaml parse:

found character that cannot start any token while scanning for the next 
token at line 16 column 26 (Psych::SyntaxError)

Line 16 column 26 is the % sign in bibliography_template: %{reference}. If I remove it, the site is generated without errors, but all of the {% cite myCiteKey %} and {% reference myCiteKey %} in my markdown just get rendered as (myCiteKey)

I am not confident that this is actually a problem with jekyll-scholar but have been unable to find an explanation for this behavior anywhere else online... every other reference to this particular error says "you have tabs where you ought to have spaces". Can you offer any insight? I'm fairly competent with some other languages but this foray into Jekyll is my first time with both Ruby and YAML.

Jekyll 1.0.0 compatible?

I got the following error after upgrade jekyll for 1.0.0 version:

/Library/Ruby/Site/1.8/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate jekyll-scholar-1.1.0, because jekyll-1.0.0 conflicts with jekyll (~> 0.10) (Gem::LoadError)

Ideas?

Duplicates in bibliography

When using multiple {% cite %} of the same paper in an article, duplicates are inserted in the bibliography printed with {% bibliography --cite %}. Only one bibliography was used.

I hacked some solution by adding "references = references.uniq" in bibliography.rb

 21           references = cited_references.map do |key|
 22             references.detect { |e| e.key == key }
 23           end          
 24           references = references.uniq
 25         end

BibTeX parser options

It should be possible to configure BibTeX parser options (e.g., :strip => false).

See #16 for more details.

doesn't seem to work on Mac OSX Yosemite

$ sudo gem install jekyll-scholar
Successfully installed jekyll-scholar-4.1.0
Parsing documentation for jekyll-scholar-4.1.0
1 gem installed
Hugos-MacBook-Pro-2:jk hugo$ irb
irb(main):001:0> require 'jekyll/scholar'
LoadError: cannot load such file -- jekyll/scholar
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in
require' from (irb):1 from /usr/bin/irb:12:in

'
irb(main):002:0>

My friend has exactly the same issue on the same configuration. Any help appreciated.

Clean method to expose more fields to bibliography_template

Hi,

If I have custom fields in my bibtex such as "pdflink" and "slides" to denote paper pdfs, and slide pdfs, I would like to be able to define a bibliography_template so that I can format these fields accordingly.

Is there a clean way to do this?

undefined method `sort_by!' and warnings

Hello Sylvester,

Nice plugin, thank you very much for it. I have some warnings and an error when I run jekyll with your plugin:

$ jekyll 
Configuration from /Users/arademaker/Sites/arademaker.github.com/_config.yml
/Library/Ruby/Gems/1.8/gems/citeproc-ruby-0.0.6/lib/plugins/formats/default.rb:9: warning: already initialized constant Token
/Library/Ruby/Gems/1.8/gems/citeproc-ruby-0.0.6/lib/plugins/formats/default.rb:10: warning: already initialized constant AffixFilter
Building site: /Users/arademaker/Sites/arademaker.github.com -> /Users/arademaker/Sites/arademaker.github.com/_site
/Library/Ruby/Gems/1.8/gems/jekyll-scholar-0.0.8/lib/jekyll/scholar/utilities.rb:27:in `entries': undefined method `sort_by!' for #<Array:0x102047c90> (NoMethodError)
...

What are those warnings? Any idea to solve them?

The error "undefined method sort_by! happens when I changed the sort_by variable to "year" in my configuration file:

https://github.com/arademaker/arademaker.github.com/blob/source/_config.yml

Any idea?

Thank you very much!

Another minor problem is the output produzed by the tag {% bibliography %}

http://localhost:4000/publications/index.html

You see? The output is not putting a space before "more details" ! Where can I customize this template?

Best,
Alexandre

no string replacement

It seems that jekyll-scholar is not doing any string replacement in the bibliography.

I think that this should happen by default or at a minimum an option should be available. Being able to specify additional files for string replacement would also be nice. For example IEEE provides two versions (full, abrv) for their journal names.

jekyll-scholar-extras question

I'm trying to have YAML configuration settings for jekyll-scholar-extras, and instantiate a defaults Hash for its configuration. I'm having trouble with it. I wonder if you could help.

I get an error saying that bash Liquid Exception: undefined method extras_defaults' for Jekyll::Scholar:Class in index.html`

It's something I don't understand about Ruby, and Jekyll ... Your help would be much appreciated.

Extras: Download links

In my bibtex file I have special fields to indicate the names of files for presentations and papers. This is picked up by bibliography tag, and HTML with the link is rendered. There is an additional field to make the reference public or not. For example:

@book{python,
  author={M. Lutz},
  year={2001},
  title={Programming Python, Second Edition},
  publisher={O'Reilly Media, Inc.},
  address={Sebastopol, CA},
  pages={1026},
  pdflink1={./hello/python.pdf},
  slides={./hello/slides.pdf},
  public={yes},
  isbn={0596000855}
}

Has pdflink1, slides, and public. If the public is yes then the reference is generated with download links to the paper, and presentation. Associating the download field with the rendered HTML is also done using configuration parameters. For example, pdflink1 renders as paper, and slides and presentation. Example: https://ece.uwaterloo.ca/~hdpatel/uwhtml/publications/index_bytype.html

Feature request: cite-key prefixes

Dear Sylvester,

I would like to have a page with several lists of references, all generated from the same bib-file. (The reason is that I would like to have different research blog posts on the same page). Currently, this leads to multiply defined html id's, due to several references appearing in multiple references sections.

Is it possible to implement something like

{% bibliography_prefix 'post1' %}

so that subsequent citation-keys would all be prefixed by post1? For example, {% cite rabinowitz %} would generate links/id's to post1-rabinowitz instead of a mere rabinowitz (only at the HTML output layer). And of course the idea would be that a subsequent {% bibliography_prefix 'post2' %} will result in links/id's to post2-rabinowitz, etc.
I believe this would work wonderfully for my purposes.

I can try to implement that myself (I'm not a ruby programmer), but I would at least appreciate a pointer in the right direction, where to look.

Thanks in advance!

Björn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.