Skip to main content

Create a subset of BibTeX entries based on an author's name (and entrytype), which is coverted into a LaTeX list.

Project description

PyPI version

bib2tex

A Python package to create a subset of BibTeX entries based on an author's name (and an entrytype). The result is converted into a LaTeX list in which the author can get highlighted with an underline. The list is sorted from the newest to the oldest entry.

The motivation for writing this package was to create a tool that generates lists with own publications for e.g. a curriculum vitae.

Installation

You can install bib2tex from the Python Package Index using pip:

pip install bib2tex

Usage

CLI

The CLI can be called with the command bib2tex, if the package is installed. Run it with the --help option to get the following usage information and a list of all options:

Usage: bib2tex [OPTIONS]

  CLI to filter and convert BibTeX entries to a LaTeX list.

  This command allows to filter BibTeX entries by an author's name (and
  entrytype). The resulting subset is coverted into a LaTeX list. The defined
  author can be highlighted with an underline in the result. By default, the
  list is sorted from the newest to the oldest entry.

Options:
  -i, --bibtex-path PATH    (input) Path to the BibTeX file.  [default:
                            /mnt/data/Documents/Literature/database.bib;
                            required]
  -o, --latex-path PATH     (output) Path to the LaTeX file  [required]
  -a, --author TEXT         Author name for filtering entries.  [required]
  -e, --entrytype TEXT      BibTeX entry type for filtering.
  -f, --format-scheme TEXT  Format scheme for LaTeX item.
  -r, --reverse             Sort entries from old to new.
  -u, --underline           Underline the author in LaTeX.
  -v, --verbose             Print verbose output.
  --item TEXT               Options for LaTeX item, e.g. '[--]'.
  --itemize TEXT            Options for LaTeX itemze.
  -h, --help                Show this message and exit.

  by Cs137, 2023 - development on Codeberg: https://codeberg.org/Cs137/bib2tex

Example

In order to obtain all articles for the author MyName from the default BibTeX file and write them into the file my_articles.tex, call the CLI as follows:

bib2tex -a MyName -e article -o my_articles.tex -v

The example above assumes that the --bibtex-path is defined via the environment variable BIB. Provide a path to it if the variable is undefined (-i path/to/example.bib). If no --latex-path | -o is provided, a prompt will request it.

Configuration

The path to the default BibTeX file can be defined with the environment variable BIB.

Dependencies

  • click (to provide the CLI)

Notes

Changelog

All notable changes to this project are documented in the CHANGELOG.md file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bib2tex-0.1.3.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

bib2tex-0.1.3-py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page