Git Product home page Git Product logo

gatsby-remark-bibliography's Introduction

gatsby-remark-bibliography

gatsby-remark-bibliography adds bibtex to gatsby. Inspired by and reused code from http://distill.pub.

bibtex

Usage

Add a bibliography tag inside your markdown e.g.

<bibliography>
@article{gregor2015draw,
    title={DRAW: A recurrent neural network for image generation},
    author={Gregor, Karol and Danihelka, Ivo and Graves, Alex and Rezende, Danilo Jimenez and Wierstra, Daan},
    journal={arXivreprint arXiv:1502.04623},
    year={2015},
    url={https://arxiv.org/pdf/1502.04623.pdf},
}
</bibliography>

and reference it using \cite{gregor2015draw}. This will get transformed to a citation [n] and a bibliography list at the place of bibliography tag.

MDX Usage

Unfortunatelly mdx doesn't like <bibliography> tags. Instead you should use @@bibliography. e.g:

@@bibliography@@
@article{goyal2019infobot,
  title={InfoBot: Transfer and Exploration via the Information Bottleneck},
  author={Goyal, Anirudh and Islam, Riashat and Strouse, Daniel and Ahmed, Zafarali and Botvinick, Matthew and Larochelle, Hugo and Levine, Sergey and Bengio, Yoshua},
  journal={arXiv preprint arXiv:1901.10902},
  year={2019}
}
@article{kottur2017natural,
  title={Natural Language Does Not Emerge Naturally in Multi-Agent Dialog},
  author={Kottur, Satwik and Moura, Jos{\'e} MF and Lee, Stefan and Batra, Dhruv},
  journal={arXiv preprint arXiv:1706.08502},
  year={2017}
}
@article{jaques2018intrinsic,
  title={Intrinsic social motivation via causal influence in multi-agent RL},
  author={Jaques, Natasha and Lazaridou, Angeliki and Hughes, Edward and Gulcehre, Caglar and Ortega, Pedro A and Strouse, DJ and Leibo, Joel Z and de Freitas, Nando},
  journal={arXiv preprint arXiv:1810.08647},
  year={2018}
}
@book{lewis1968convention,
  title={Convention: A philosophical study},
  author={Lewis, David},
  year={1968}
}
@@bibliography@@

Install

npm install --save gatsby-transformer-remark gatsby-remark-bibliography bibtex-parse-js

gatsby-remark-bibliography's People

Contributors

ptigas avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

gatsby-remark-bibliography's Issues

<undefined> HTML nodes generated

Hey! Thanks for this library.

I'm using the the following Gatsby configuration to generate the bibliography in my MDX file.

   {
      resolve: `gatsby-plugin-mdx`,
      options: {
        gatsbyRemarkPlugins: [
          {
            resolve: `gatsby-remark-bibliography`
          }
        ]
      }
    }

For a sample MDX which looks like

Cite something \cite{lewis1968convention}

@@bibliography@@
@book{lewis1968convention,
  title={Convention: A philosophical study},
  author={Lewis, David},
  year={1968}
}
@@bibliography@@

the HTML generated around the text looks like

<p class="css-1jie8q0">
  <undefined>
    Cite something<span id="citation-0" data-hover=""><span class="citation number">[1]</span></span>
  </undefined>
</p>

I think this is causing troubles with the linking and hover behavior. Any help is greatly appreciated!

Load bib from external file

First of all: thanks for the great plugin! Very useful.

How likely would it be to make it possible to import the bibliography from an external bib file (instead of including the bibliography directly in the md/mdx file)?

I realize this is more of a feature request than an actual issue.

Thanks!

Package is not available on NPM

Error message:

$ npm install --save gatsby-transformer-remark gatsby-remark-bibliography bibtex-parse-js
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/gatsby-remark-bibliography - Not found
npm ERR! 404
npm ERR! 404  'gatsby-remark-bibliography@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Wrong index if cite the same article more than once

As shown in the below image, I'm trying to use the reference 2 and 3 a second time. And two problems occurs:

  1. the inline citation index jumps to 6, which should be 4
  2. the 4 and 5 entries of the bibliography part are the same as 3 and 2, which shouldn't be displayed.

image

This is the line I add to package.json to load the gatsby-remark-bibliography plugin,

    "gatsby-remark-bibliography": "git+https://github.com/ptigas/gatsby-remark-bibliography.git",

And here is the what I wrote in my md file

---
title: Important References
description: 
---

Here are some references for our models, piezoelectric \cite{cao-PiezoelectricResponseSinglecrystal-2010}, elastic \cite{hu-PhasefieldModelEvolving-2001,wang-PhaseTransitionsDomain-2013}, dielectric \cite{wang-PhaseTransitionsDomain-2013}, \cite{hu-PhasefieldModelEvolving-2001}, magnetic \cite{wang-StaticMagneticSolution-2015}, magnetoelectric \cite{yang-PredictingEffectiveMagnetoelectric-2014}, diffusion \cite{zhu-ComputingEffectiveDiffusivity-2001}

<bibliography>
@article{cao-PiezoelectricResponseSinglecrystal-2010,
  title = {Piezoelectric Response of Single-Crystal {{PbZr1}}-{{xTixO3}} near Morphotropic Phase Boundary Predicted by Phase-Field Simulation},
  author = {Cao, Y. and Sheng, G. and Zhang, J. X. and Choudhury, S. and Li, Y. L. and Randall, C. A. and Chen, L. Q.},
  year = {2010},
  month = dec,
  volume = {97},
  pages = {252904},
  publisher = {{American Institute of Physics}},
  issn = {0003-6951},
  doi = {10.1063/1.3530443},
  journal = {Applied Physics Letters},
  number = {25}
}
@article{hu-PhasefieldModelEvolving-2001,
  title = {A Phase-Field Model for Evolving Microstructures with Strong Elastic Inhomogeneity},
  author = {Hu, S. Y. and Chen, L. Q.},
  year = {2001},
  month = jun,
  volume = {49},
  pages = {1879--1890},
  issn = {1359-6454},
  doi = {10.1016/S1359-6454(01)00118-5},
  journal = {Acta Materialia},
  keywords = {Diffusion; interface,Elastic,Microstructure,Phase field},
  language = {en},
  number = {11}
}
@article{wang-PhaseTransitionsDomain-2013,
  title = {Phase Transitions and Domain Structures of Ferroelectric Nanoparticles: {{Phase}} Field Model Incorporating Strong Elastic and Dielectric Inhomogeneity},
  shorttitle = {Phase Transitions and Domain Structures of Ferroelectric Nanoparticles},
  author = {Wang, J. J. and Ma, X. Q. and Li, Q. and Britson, J. and Chen, Long-Qing},
  year = {2013},
  month = dec,
  volume = {61},
  pages = {7591--7603},
  issn = {1359-6454},
  doi = {10.1016/j.actamat.2013.08.055},
  journal = {Acta Materialia},
  keywords = {Dielectric inhomogeneity,Ferroelectric nanoparticle,Ferroelectric phase transitions,Phase field method},
  language = {en},
  number = {20}
}
@article{wang-StaticMagneticSolution-2015,
  title = {Static Magnetic Solution in Magnetic Composites with Arbitrary Susceptibility Inhomogeneity and Anisotropy},
  author = {Wang, J. J. and Song, Y. and Ma, X. Q. and Chen, Long-Qing and Nan, Ce-Wen},
  year = {2015},
  month = jan,
  volume = {117},
  pages = {043907},
  publisher = {{American Institute of Physics}},
  issn = {0021-8979},
  doi = {10.1063/1.4906567},
  journal = {Journal of Applied Physics},
  number = {4}
}
@article{yang-PredictingEffectiveMagnetoelectric-2014,
  title = {Predicting Effective Magnetoelectric Response in Magnetic-Ferroelectric Composites via Phase-Field Modeling},
  author = {Yang, T. N. and Hu, Jia-Mian and Nan, C. W. and Chen, L. Q.},
  year = {2014},
  month = feb,
  volume = {104},
  pages = {052904},
  publisher = {{American Institute of Physics}},
  issn = {0003-6951},
  doi = {10.1063/1.4863941},
  journal = {Applied Physics Letters},
  number = {5}
}
@article{zhu-ComputingEffectiveDiffusivity-2001,
  title = {Computing the Effective Diffusivity Using a Spectral Method},
  author = {Zhu, Jingzhi and Chen, Long-Qing and Shen, Jie and Tikare, Veena},
  year = {2001},
  month = jul,
  volume = {311},
  pages = {135--141},
  issn = {0921-5093},
  doi = {10.1016/S0921-5093(01)00961-3},
  journal = {Materials Science and Engineering: A},
  keywords = {Diffuse interface,Diffusion equation,Effective diffusivity,Microstructures,Spectral method},
  language = {en},
  number = {1}
}
</bibliography>

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.