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

Bibtex in citation tag not rendering #2

Open
futureneer opened this issue Feb 28, 2014 · 2 comments
Open

Bibtex in citation tag not rendering #2

futureneer opened this issue Feb 28, 2014 · 2 comments

Comments

@futureneer
Copy link

Hello,

I followed the instructions in the readme.md file, and successfully installed all the dependencies, as well as making changes to my files and adding the liquid tag in my .md file. However, after building with Jekyll and serving, I don't see any rendered text from the bibtex item. I have copied the citation.rb to my _plugins folder. Do I need to do anything else?

Thanks!

@PJK
Copy link

PJK commented May 2, 2014

It's not your fault. It didn't work for me either, so I looked into it. Basically, the

CiteProc.process b.to_citeproc, :style => @config['citation_style'], :locale => @config['citation_locale'], :format => 'html'

part doesn't work. I presume there were some breaking changes in the CiteProc gem.

I will probably try to fix it tomorrow.

Update:

So just in case you wanted to dig deeper into this, the following works

    def render(context)

      # get the content of the {% bibtex %} block
      content = super
      cp = CiteProc::Processor.new style: 'apa', format: 'html'
      bibtex = BibTeX.parse(content, :include => [:meta_content]).to_citeproc
      cp.import bibtex

      # so apparently we need to render them one by one
      bibtex.map {|item| cp.render(:bibliography, id: item['id']).pop}.join
    end

but it obviously doesn't forward the settings and the output is not very pretty... The citeproc gem could use some docs. I'm afraid I currently don't have time to make this really work, so I can only wish you the best of luck.

  • you need both citeproc-ruby and csl-styles in your gemfile.

@Sciss
Copy link

Sciss commented Nov 22, 2014

Thanks, your update works but additional one must add require 'csl/styles' to the top of the file.

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

3 participants