Giter Site home page Giter Site logo

heinwol / bibtex2style Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 222 KB

bibtex2style is a script that takes .bib file as an input and produces an .xlsx file with entries processed by biblatex with an according style (like `gost`). It also respects bold an italics fonts!

License: GNU General Public License v3.0

Python 44.16% Nix 34.38% TeX 21.46%
bibliography latex nix python style bibtex citations

bibtex2style's Introduction

bibtex2style

Imagine you're an organized person and you manage all your bibliography with some bibliography manager like jabref. The manager you prefer stores all the data inside .bib files, hence it's straightforward to use it in latex. Now imagine that for whatever reason you need to have your bibliography in text format. Maybe your institution wants a report in .docx format from you, or you want to include references in a presentation, or send them via email... who knows why. The point where you convert .bib file to text is the tricky one. There are solutions like CSL, but they don't have good support for some citation styles. The script presented here utilizes latex to create citations, so if your citation style is supported in latex this script also supports it.

bibtex2style is a script that takes .bib file as an input and produces an .xlsx file with entries processed by biblatex with an according style (like gost). It also respects bold an italics fonts!

bibtex2style also adds cite keys to .xlsx file (see example), so it should be easy to find and manage citations.

By default bibtex2style uses biblatex-gost style. One can modify tex source to change the style (temporary solution).

Usage

Using the script is simple:

$ bibtex2style test.bib [styled_result.xlsx]

Docker

If you use docker then this command should do the trick:

$ docker run -it -v $(pwd):/temp --rm bibtex2style:latest bibtex2style test.bib [styled_result.xlsx]

Beware though:

  1. The line above works for linux, if you run it on windows use the windows $(pwd) alternative, idk what it is;
  2. At least on linux, modifying files with docker has the issue when whatever file it creates becomes owned by root. To avoid this you can either perform some nontrivial steps as described in e.g. here or use podman.

Example

Input

test.bib contents:

@article{Безверхний2014,
    author = {Безверхний, Н. В.},
    journal = {Научное издание МГТУ им. Н.Э.Баумана},
    title = {Кольцевые диаграммы с периодическими метками и проблема степенной
             сопряжённости в группах с условиями C(3)-T(6)},
    year = {2014},
    language = {ru},
    pages = {238--256},
    volume = {No11},
}

@article{Shpilrain2004,
    author = {Shpilrain, Vladimir and Zapata, Gabriel},
    title = {Combinatorial group theory and public key cryptography},
    year = {2004},
    month = oct,
    archiveprefix = {arXiv},
    copyright = {Assumed arXiv.org perpetual, non-exclusive license to
                 distribute this article for submissions made before January 2004
                 },
    doi = {10.48550/ARXIV.MATH/0410068},
    eprint = {math/0410068},
    file = {:http\://arxiv.org/pdf/math/0410068v1:PDF},
    keywords = {Group Theory (math.GR), Cryptography and Security (cs.CR), FOS:
                Mathematics, FOS: Computer and information sciences},
    primaryclass = {math.GR},
    publisher = {arXiv},
}

@article{Anshel1999,
    author = {Iris Anshel and Michael Anshel and Dorian Goldfeld},
    journal = {Mathematical Research Letters},
    title = {An algebraic method for public-key cryptography},
    year = {1999},
    number = {3},
    pages = {287--291},
    volume = {6},
    doi = {10.4310/mrl.1999.v6.n3.a3},
    priority = {prio2},
    publisher = {International Press of Boston},
}

Output

styled_result.xlsx contents:

result

Installation

Nix

If you happen to use nix with flakes you can build it with:

$ nix build github:heinwol/bibtex2style#default

Or install directly to your profile:

$ nix profile install github:heinwol/bibtex2style#default

All the dependencies are already there, it's plug&play.

Docker

Provided you have docker installed on your system just load the downloaded image:

$ docker load -i docker-image-bibtex2style-0.1.0.tar.gz 

then run the container as described above.

Manual

git clone https://github.com/heinwol/bibtex2style
cd bibtex2style
pip install poetry
poetry build
pip install dist/bibtex2style-0.1.0-py3-none-any.whl

Along with lines above you are expected to have some programs installed, see Requirements.

Requirements

  • python with pip installed. I used 3.10, in theory it should work with several prior releases
  • perl. Required by latexmk
  • LaTeX. Whatever distribution and version of latex you can find with the following packages (this list is made for texlive, package names for MiKTeX may differ):
    • biber
    • biblatex
    • cm-unicode -- fonts. Maybe you'll need to install cm-super if your language is not supported.
    • latexmk
    • luatex
    • luatex85
    • luatexbase
    • polyglossia
    • standalone
    • varwidth
    • language package for the according language, by default it is collection-langcyrillic
    • style package you want to use with biblatex, by default it is biblatex-gost

bibtex2style's People

Contributors

heinwol avatar

Stargazers

Kirill Chirkov avatar Maria Nesterova avatar

Watchers

 avatar

Forkers

rlridenour

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.