Skip to content


undefined method `sort_by!' and warnings #3

arademaker opened this Issue · 11 comments

2 participants


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/
/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/ -> /Users/arademaker/Sites/
/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:

Any idea?

Thank you very much!

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


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




thanks for spotting this bug! The missing #sort_by! is a Ruby compatibility issue – you're using an old Ruby version that does not support this method yet – but this should be fixed now if you update the jekyll-scholar gem. (Actually, I missed another bug, so make sure to install version 0.0.10

Sorry about the other warnings – we're currently rewriting citeproc-ruby completely.

Regarding the space, you'll need to host your site on a public server if you want me to take a look ;-) Anyway, I assume you're talking about adding a space before the details link? Right now there isn't really a template: the link is generated in lib/jekyll/scholar/tags/bibliography.rb:24 and uses the details_link configuration setting. However, since this is a separate anchor tag it should be easy to add either padding or margin to it in your stylesheet – that was the solution I had in mind originally.

@inukshuk inukshuk closed this

Ops! I am using the MacOS default Ruby! I updated the gem and the sort is now working, thank you!

Sorry, my mistake. I post the address of my devel environment. My site is hosted at github:

To use CSS, it would help if that anchor has a class attached to it. What you think? That would you think about something like

<a class="jekyll-scholar-link" ...>....</a>

You said:

"...Right now there isn't really a template: the link is generated in lib/jekyll/scholar/tags/bibliography.rb:24 and uses the details_link configuration setting..."

I have also noted that the titles are not capitalized as expected. I my case, note the difference between the title h1 and the result of the citeproc:

In my bibtex, the title of the entry is protected by {}

  author =  {Rademaker, Alexandre},
  title =   {{Uma ferramenta formal para especifica{\c{c}}{\~a}o e an{\'a}lise de arquiteturas de software}},
  year =    {2005},
  school =  {Universidade Federal Fluminense}

The formatting of the title is decided by the CSL style. Which style did you use? It is probably easy to change the style if it does not fit your requirements.


Thank you again!! ;-) I was using the mla CSL but changed to apa! I will open another issue about performance, right?


If you take a look at the MLA style here you'll see that it specifies how to capitalize the title. You could copy that (or any other) style and simply change the text-case attribute to your needs. But typically for those basic styles it should be safe to just take them as they are ;-)


Well, thank you for the information. When I am writing an article in LaTeX, I usually use {} to protect the capitalization. That usually works regarding the style... If I understood it right, CSL is different. It ignores {}, right?

I am having another issue with the APA CSL. Take a look in the reference 23 of my publications' list:

The name of my co-author is "Fernando Náufel do Amaral". The APA style inverted and joined the last name with the first: "AmaralFernando Náufel do"

Is it a bug in the APA CSL or its normal behavior? Sorry, maybe this is not an issue to be opened here! ;-)



You're right, CSL will ignore the {}. Actually, the CSL will not see the braces at all, because the latex-decode gem will remove them. If this a problem, you will have to remove the text-case attribute from the style.

There are actually a couple of problems in reference 23: the second name is wrong, too, and there are two dots at the end of the author list. Maybe the names were not parsed correctly. Could you post your BibTeX entry so that I can take a look at it?


You found more than me!! The BibTeX file is here:

Once more, thank you very much for your support! :-)


I created a gist that features one of your publications. It's interesting that both problems do not happen there: neither are there duplicate periods nor are the names erroneous. Could you try and put the source.rb file from the gist into a file and execute it with Ruby on your system? Basically, the output should be exactly as in result.html.


By the way, BibTeX does not distinguish between dropping and non-dropping particles. Normally, in BibTeX you would probably write you co-author's name like this:

do Amaral, Fernando Náufel

BibTeX-Ruby defaults to using dropping particles when converting to CiteProc, so if you want to use non-dropping particles you could write the name as above and then, in the gist line 11 write:

citeproc.import, :filter => :latex).to_citeproc(:particle => 'non-dropping-particle')

If you do this then the name will appear as 'do Amaral' in you bibliography.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.