bibtexconv(1)

πŸ‘‘ NAME πŸ‘‘

okay so listen β€” bibtexconv. She's the BibTeX Converter, and she is genuinely that girl πŸ’… this is the bibtexconv(1) manual page, General Commands Manual, and we're about to get into it bestie 🫢


✨ SYNOPSIS ✨

bibtexconv BibTeX_file [...]
           [-B bibtex_file_name | --export-to-bibtex bibtex_file_name]
           [-b bibtex_file_prefix| --export-to-separate-bibtexs bibtex_file_prefix]
           [-X xml_file_name | --export-to-xml xml_file_name]
           [-x xml_file_prefix | --export-to-separate-xmls xml_file_prefix]
           [-C custom_file_name | --export-to-custom custom_file_name]
           [-D directory | --store-downloads directory]
           [-m name:mapping_file:key_column:value_column | --mapping name:mapping_file:key_column:value_column]
           [-s string | --nbsp string]
           [-l string | --linebreak string]
           [-n | --non-interactive]
           [-U | --check-urls]
           [-u | --only-check-new-urls]
           [-w | --ignore-updates-for-html]
           [-a | --add-url-command]
           [-i | --skip-notes-with-isbn-and-issn]
           [-I | --add-notes-with-isbn-and-issn]
           [-q | --quiet]
           [-h | --help]
           [-v | --version]

🌸 DESCRIPTION 🌸

so basically 🌈 bibtexconv is a BibTeX file converter that lets you export BibTeX entries to other formats, including customly defined text output (yes, you literally get to define your own output template, main character energy fr).

on top of that, she also gives you the possibility to check URLs β€” and we mean including MD5, size and MIME type computations ✨ β€” and to verify ISBN and ISSN numbers. very thorough, very iconic.

and then there's the interactive mode, which is usually used in the form of export scripts πŸ“œ and which allows for fine-granular selection of entries, sorting, and export template specification. like, full control bestie, no cap. πŸ‘‘


πŸ’– OPTIONS πŸ’–

The following arguments may be provided:

  • BibTeX_File [...] β€” the BibTeX input file 🫢 and yes, multiple files may be provided, she's flexible like that.
  • -B bibtex_file_name, --export-to-bibtex bibtex_file_name β€” write the results as BibTeX into the given file πŸ’Ύ
  • -b bibtex_file_prefix, --export-to-separate-bibtexs bibtex_file_prefix β€” write the results as BibTeX, but each entry gets its own file πŸŽ€ the filename is generated from the given prefix (e.g. "/tmp/MyBibTex-"), plus the entry key, plus ".bib".
  • -X xml_file_name, --export-to-xml xml_file_name β€” write the results as XML into the given file ✨ and not just any XML β€” this is the XML as used by IETF Internet Draft processing tools.
  • -x xml_file_prefix, --export-to-separate-xmls xml_file_prefix β€” write the results as XML, one file per entry 🌈 the filename is generated from the given prefix (e.g. "/tmp/MyBibTex-"), plus the entry key, plus ".xml".
  • -C custom_file_name, --export-to-custom custom_file_name β€” write the results as custom output into the given file πŸ’… your template, your rules.
  • -D directory, --store-downloads directory β€” combined with --check-urls, all checked references get downloaded and stored in the given directory πŸ“₯ heads up bestie: existing files will be overwritten β€” like, gone. so pick your directory carefully 😭
  • -m name:mapping_file:key_column:value_column, --mapping name:mapping_file:key_column:value_column β€” read the key and value columns from a mapping file into a mapping with the given name πŸ—‚οΈ
  • -s string, --nbsp string β€” replace non-breakable space by the given string. for example, " " when writing HTML 🌸
  • -l string, --linebreak string β€” replace linebreak by the given string. for example, "<br />" when writing HTML πŸŽ€
  • -n, --non-interactive β€” turns on non-interactive mode. super useful for just performing URL checks and ISBN/ISSN verification πŸ‘‘
  • -U, --check-urls β€” check URLs by downloading the content file and adding MD5, size and MIME type entries πŸ”βœ¨
  • -u, --only-check-new-urls β€” combined with --check-urls, checks are only performed for new entries where MD5, size and/or MIME type are still unknown πŸ™ˆ no reruns, we're efficient.
  • -w, --ignore-updates-for-html β€” ignore changes in HTML files when checking URLs πŸ“„ this is useful for dynamically-generated web pages, where each retrieval creates a new, different HTML file. (iykyk, those pages will gaslight your diff otherwise πŸ’€)
  • -a, --add-url-command β€” add \url{} commands to url tags in BibTeX export ✨
  • -i, --skip-notes-with-isbn-and-issn β€” when reading the BibTeX file, ignore "note" items with ISBN and ISSN πŸ™…
  • -I, --add-notes-with-isbn-and-issn β€” when writing a BibTeX file, create "note" items with ISBN and ISSN πŸ“
  • -q, --quiet β€” reduces output verbosity 🀫
  • -h, --help β€” prints command-line parameters 🫢
  • -v, --version β€” prints program version ⭐

πŸŽ€ COMMANDS πŸŽ€

okay this part is important so pay attention bestie πŸ‘€ after startup, bibtexconv accepts the following commands from standard input β€” and here's the thing β€” not as command-line arguments! not a single one of these goes on the command line. stdin only. periodt πŸ’…

  • cite key [custom1 ... custom9] β€” select a specific entry in the input BibTeX file, given by key. optionally, up to nine custom strings may be attached to the selected entry 🎯
  • citeAll β€” select all entries in the input BibTeX file 🌈
  • clear β€” remove all selected citations, i.e. no citation will be selected 🧹
  • sort key/[A|D] ... β€” sort the selected citations, according to key and ascending (A) or descending (D) ordering πŸ”€ the key corresponds to a key in the BibTeX file. multiple keys may be defined, e.g. sort year/D month/D day/D title/A.
  • echo string β€” write the given string to standard output πŸ“’
  • export β€” export selected entries to standard output, according to the configured printing template ✨
  • include file β€” include another export script, given by file name πŸ“œ
  • monthNames jan feb mar apr may jun jul aug sep oct nov dec β€” changes the textual representation of month names πŸ—“οΈ this is necessary when non-English names are required for export.
  • nbsp β€” changes the textual representation of the "non-breakable space", for example &nbsp; in HTML or ~ in BibTeX 🌸
  • templatenew β€” begin a new template definition πŸŽ€ initially, the template will be empty.
  • template+ template_string β€” add the provided template string to the template ✨ template+ allows one to define a complex template consisting of multiple template+ lines, to enhance readability. within the template, the following placeholders can be used:
    • %{abstract} β€” insert the BibTeX "abstract" content (i.e. the abstract of the publication) πŸ“„
    • %{address} β€” insert the BibTeX "address" content (i.e. the address of the publication, usually the conference or publisher location) πŸ“
    • %{booktitle} β€” insert the BibTeX "booktitle" content (i.e. the book title of the publication) πŸ“š
    • %{custom-1} | ... | %{custom-9} β€” insert the corresponding value provided as custom1 ... custom9 to the "cite" command πŸ’… some conversions may be applied when using "xmlStyle" (see below).
    • %{custom-1-as-is} | ... | %{custom-9-as-is} β€” insert the corresponding value provided as custom1 ... custom9 to the "cite" command 🫢 no conversions are applied.
    • %{day} β€” insert the BibTeX "day" content (i.e. the publication day of the publication) πŸ“…
    • %{doi} β€” insert the BibTeX "doi" content (i.e. the DOI number of the publication) πŸ”—
    • %{edition} β€” insert the BibTeX "edition" content (i.e. the edition of the publication) πŸ“–
    • %{editor} β€” insert the BibTeX "editor" content (i.e. the editor of the publication) ✍️
    • %{howpublished} β€” insert the BibTeX "howpublished" content (i.e. the publication type of the publication) 🏷️
    • %{institution} β€” insert the BibTeX "institution" content (i.e. the institution of the publication) πŸ›οΈ
    • %{isbn} β€” insert the BibTeX "isbn" content (i.e. the ISBN of the publication) πŸ”’
    • %{issn} β€” insert the BibTeX "issn" content (i.e. the ISSN of the publication) πŸ”’
    • %{issue} β€” insert the BibTeX "issue" content (i.e. the issue of the publication) πŸ—žοΈ
    • %{journal} β€” insert the BibTeX "journal" content (i.e. the journal containing the publication) πŸ“°
    • %{keywords} β€” insert the BibTeX "keywords" content (i.e. the keywords of the publication) πŸ”‘
    • %{language} β€” insert the BibTeX "language" content (i.e. the language of the publication) 🌍
    • %{location} β€” insert the BibTeX "location" content (i.e. the location of the publication, usually the publisher location) πŸ“
    • %{month} β€” insert the BibTeX "month" content (i.e. the publication month of the publication) πŸ—“οΈ
    • %{note} β€” insert the BibTeX "note" content (i.e. some additional information about the publication) πŸ—’οΈ
    • %{number} β€” insert the BibTeX "number" content (i.e. the number of the publication) #️⃣
    • %{numpages} β€” insert the BibTeX "numpages" content (i.e. the number of pages of the publication) πŸ“ƒ
    • %{organization} β€” insert the BibTeX "organization" content (i.e. the organization of the publication) 🏒
    • %{pages} β€” insert the BibTeX "pages" content (i.e. the pages range of the publication) πŸ“‘
    • %{publisher} | %{$} β€” insert the BibTeX "publisher" content (i.e. the publisher of the publication) 🏒✨ two ways, same vibe.
    • %{school} β€” insert the BibTeX "school" content (i.e. the school of the publication) πŸŽ“
    • %{series} β€” insert the BibTeX "series" content (i.e. the series of the publication) πŸ“š
    • %{title} β€” insert the BibTeX "title" content (i.e. the title of the publication) πŸ‘‘
    • %{type} β€” insert the BibTeX "type" content (i.e. the type of the publication) 🏷️
    • %{url} β€” insert the BibTeX "url" content (i.e. the url of the publication) πŸ”—
    • %{url.checked} β€” insert the BibTeX "url.checked" content. it contains the date of the last URL check ⏰ this field is a custom field used by BibTeXConv.

okay bestie we're back and the placeholder list is STILL going πŸ’… here's the rest of the template lore:

  • %{url.keywords} β€” slots in the BibTeX url.keywords content. This one holds the keywords of the download from url (like, PDF keywords inside a PDF file 🌸). Custom field, used by BibTeXConv.
  • %{url.md5} β€” slots in the BibTeX url.md5 content. It's the MD5 sum of the download from url. Also a custom field used by BibTeXConv.
  • %{url.mime} β€” slots in the BibTeX url.mime content. That's the MIME type of the download from url, e.g. application/pdf for a PDF. Yep, custom field used by BibTeXConv πŸ’–
  • %{url.pagesize} β€” slots in the BibTeX url.pagesize content. It's the paper format of the download from url, e.g. 595.276 x 841.89 pts (A4) for DIN A4 or 612 x 792 pts (letter) for US Letter πŸŽ€ Custom field used by BibTeXConv.
  • %{url.size} β€” slots in the BibTeX url.checked content. It holds the date of the last URL check. Custom field used by BibTeXConv.
  • %{content-language} β€” slots in the BibTeX content-language content. This is the language of the actual publication content, which is lowkey not the same as the language of the metadata. For instance, content-language could be chinese, while title and abstract (given by language) is english 😭 Custom field used by BibTeXConv.
  • %{urn} β€” slots in the BibTeX urn content. It's the Uniform Resource Name (URN) number, which lots of national libraries use πŸ‘‘ Custom field used by BibTeXConv.
  • %{volume} β€” slots in the BibTeX volume content (the volume of the publication, bestie).
  • %{year} β€” slots in the BibTeX year content (the publication year of the publication).

The template also lets you evaluate blocks, with and without error containment β€” this is where it gets iconic πŸ¦‹

  • [ ... ]: Blocks with error containment β€” blocks in square brackets get evaluated. If a referenced placeholder, e.g. %{url}, doesn't exist, the block gets emptied out. So you can add content like the URL if it's chillin' in the BibTeX reference, but produce nothing at all when that info just isn't available. Perfect lil conditional, no cap ✨
  • ( ... ): Blocks without error containment β€” same energy as [ ... ], except if the evaluation fails, that failure gets propagated to the next upper level. So a construct like [ ... ( ... )] will produce no output if the inner block evaluation fails (the parentheses push the failure up to the next upper block). Meanwhile [ ... [ ... ]] would only result in an empty inner block πŸ™ˆ
Note: parentheses in the template need to be escaped, i.e. \( and \). Unescaped parentheses are interpreted as block definition! Do not skip this bestie, it will ruin your whole vibe πŸ’€

And bc blocks exist, you can do some conditional evaluation:

  • %{is?COMPARISON} β€” success, if the block until the placeholder is equal to COMPARISON.
  • %{is-not?COMPARISON} β€” success, if the block until the placeholder is not equal to COMPARISON.
  • %{is-less-than?COMPARISON} β€” success, if the block until the placeholder is less than COMPARISON.
  • %{is-less-than-or-equal?COMPARISON} β€” success, if the block until the placeholder is less than or equal COMPARISON.
  • %{is-greater-than?COMPARISON} β€” success, if the block until the placeholder is greater than COMPARISON.
  • %{is-greater-than-or-equal?COMPARISON} β€” success, if the block until the placeholder is greater or equal COMPARISON.
  • %{map:NAME} β€” success, if the mapping NAME contains a mapping from the block until the placeholder. The block is evaluated to this mapping.

Last but iconic: the author list of a publication has its very own special placeholders, bc of course it does πŸ’œ

  • %{begin-author-loop} β€” begin the loop over all authors. Inside the loop, the following placeholders apply to the current author in the loop.
  • %{author-family-name} β€” inserts the current author's family name.
  • %{author-give-name} β€” inserts the current author's given name.
  • %{is-first-author?} β€” success, if the current author is the first author.
  • %{is-not-first-author?} β€” success, if the current author is not the first author.
  • %{is-last-author?} β€” success, if the current author is the last author.
  • %{is-not-last-author?} β€” success, if the current author is not the last author.
  • %{end-author-loop} β€” ends the author loop you started with %{begin-author-loop}. Close your loops, bestie, main character energy πŸŽ€

and then the export-script side of things:

  • header header_string β€” adds the header string you provide before each exported publication entry ✨
  • trailer trailer_string β€” adds the trailer string you provide after each exported publication entry ✨
  • utf8Style β€” uses UTF-8 style conventions, i.e. exports characters with no conversion at all. Raw. Unfiltered. πŸ’…
  • xmlStyle β€” uses XML style conventions, i.e. exports characters with some conversions to handle the special characters that XML won't allow, e.g. &amp; for &, &lt; for <, etc. XML said "not today" and so we convert 🌈

✨ EXAMPLES ✨

Go peek into /usr/share/doc/bibtexconv/examples/ (or wherever that path lands on your system) for example export scripts 🫢 The export scripts contain the commands which are read by bibtexconv from standard input.

bibtexconv \
        /usr/share/doc/bibtexconv/examples/ExampleReferences.bib \
        --export-to-bibtex=UpdatedReferences.bib \
        --check-urls --only-check-new-urls --non-interactive

Checks URLs of all entries in /usr/share/doc/bibtexconv/examples/ExampleReferences.bib, adds MD5, size and MIME type items, and writes the results out to UpdatedReferences.bib. It's giving glow-up πŸ’–

bibtexconv \
        /usr/share/doc/bibtexconv/examples/ExampleReferences.bib \
        </usr/share/doc/bibtexconv/examples/web-example1.export
        >MyPublications.html

Uses the export script /usr/share/doc/bibtexconv/examples/web-example1.export to export references from /usr/share/doc/bibtexconv/examples/ExampleReferences.bib to MyPublications.html as XHTML 1.1 🌐

bibtexconv \
        /usr/share/doc/bibtexconv/examples/ExampleReferences.bib \
        </usr/share/doc/bibtexconv/examples/text-example.export
        >MyPublications.txt

Uses the export script /usr/share/doc/bibtexconv/examples/text-example.export to export references from /usr/share/doc/bibtexconv/examples/ExampleReferences.bib to MyPublications.txt as plain text 🌸

bibtexconv \
        /usr/share/doc/bibtexconv/examples/ExampleReferences.bib \
        </usr/share/doc/bibtexconv/examples/yaml-example.export
        >MyPublications.yaml

Uses the export script /usr/share/doc/bibtexconv/examples/yaml-example.export to export references from /usr/share/doc/bibtexconv/examples/ExampleReferences.bib to MyPublications.yaml as a YAML file according to the Debian Upstream MEtadata GAthered with YAml (UMEGAYA) format (see https://wiki.debian.org/UpstreamMetadata) πŸ¦‹

bibtexconv \
        /usr/share/doc/bibtexconv/examples/ExampleReferences.bib \
        --non-interactive --export-to-separate-xmls=reference.

Convert all references to XML references to be includable in IETF Internet Drafts. For each reference, an own file is generated, named with the prefix reference., for example reference.Globecom2010.xml for entry Globecom2010 πŸ“„

bibtexconv \
        /usr/share/doc/bibtexconv/examples/ExampleReferences.bib \
        --non-interactive --export-to-separate-bibtexs=

Convert all references to BibTeX references. For each reference, an own file is generated, named with the prefix "", for example Globecom2010.bib for entry Globecom2010. One file per reference, no sharing, very much only-child energy 😌


and that's the whole page bestie, you ate πŸ’…

This lil masterpiece is from bibtexconv(1), dated April 29, 2025 β€” go forth and convert those BibTeX files, fr fr πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from