BIB2GLS(1)

πŸ’– BIB2GLS(1) πŸ’–

okay bestie, you opened bib2gls(1) and honestly? you're about to have a great time. this is the manual page for bib2gls, and she is lowkey doing the work of like three whole tools at once. grab a snack, we're going in 🫢


🌸 SYNOPSIS 🌸

bib2gls [option]+ auxfile

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bib2gls is built to hang out with the glossaries-extra LaTeX package. (the record package option is required, no skips πŸ’…) and the way this app is set up, it's giving two jobs in one:

  1. it selects entries from .bib files based on what it finds in the auxfile (very bibtex coded of her), and
  2. it hierarchically sorts those entries and collates location lists (which is the whole makeindex / xindy vibe).

also, you can totally leave the .aux extension off of auxfile, she'll cope ✨

the auxfile (and the .log file that goes with it) needs to either be chillin' in the current directory, or be in the directory you named with --dir. as for the bib files: they can be relative to the directory the auxfile lives in, or they can be somewhere that kpsewhich can find. that's it, that's the whole geography lesson πŸ—ΊοΈ


✨ OPTIONS ✨

  • --aux-input-action setting β€” what do we do when bib2gls runs into "\@input" in the aux file? setting can be one of these:
    • follow β€” follow the reference, i.e. just input the file like normal.
    • skip-after-bibglsaux (or skip after bibglsaux) β€” follow the reference for every "\@input" we meet, right up until we hit "\@bibgls@input", and after that skip every remaining "\@input". (this is the default πŸ’…)
    • skip β€” skip all the "\@input" instances (but not "\@bibgls@input", that one always gets followed, no exceptions).
side note: "\@bibgls@input" only shows up in the aux file if the package option "bibglsaux" was used. iykyk 🌸
  • --break-space β€” treat the "~" (tilde) character and "\nobreakspace" like a normal, regular, ordinary space. no breaks, just vibes.
  • --cite-as-record β€” treat "\citation" as an ignored record.
  • --collapse-same-location-range β€” collapse an explicit range whose start and end location are the same little duplicate into a normal record. (default ✨)
  • --custom-packages list β€” tell the TeX parser library to try parsing the packages named in list. this is meant for simple custom packages that don't contain complex code, so like, keep expectations realistic bestie πŸ™ˆ
  • --datatool-sort-markers β€” the interpreter will use the datatool-base.sty marker commands to match their localised definitions inside "\DTLsortwordlist" (datatool v3.0+). heads up: you'll need a sort method that doesn't ignore the control characters those commands use. πŸ‘‘
  • --date-in-header (or -D) β€” the header comment at the top of the .glstex file will include the file modification date. timestamps, iconic ⭐
  • --debug [n] β€” switch debug mode on at setting n, which should be a non-negative integer. if n is 0, debug mode goes off. if you leave n out, it's set to 1, which is the same as --debug-mode io. any positive number enables all of bib2gls's debugging messages. how many TeX Parser Library debugging messages you get depends on the bitwise operation of n. math girlies rise πŸ”₯
  • --debug-mode setting β€” use this instead of --debug when the level number is just too hard to remember (relatable 😭). setting can be a comma-separated list of any of these keywords:
    • all β€” highest level (likely to result in a large transcript file). equivalent to switching on all settings.
    • catcode β€” TeX Parser category code changes.
    • cs β€” TeX Parser command definitions.
    • decl β€” TeX Parser declarations.
    • expansion β€” TeX Parser expansions (may result in a large transcript file).
    • expansion-list β€” TeX Parser stack expansions (may result in a large transcript file).
    • expansion-once β€” TeX Parser one-level expansions.
    • expansion-once-list β€” TeX Parser one-level list expansions.
    • io β€” TeX Parser I/O operations (open, close and fetch token).
    • popped β€” TeX Parser stack popping.
    • process β€” TeX Parser macro process (may result in a large transcript file).
    • process-generic-cs β€” TeX Parser generic command process.
    • process-stack β€” TeX Parser stack process (may result in a large transcript file).
    • process-stack-list β€” TeX Parser detailed stack process (may result in a large transcript file).
    • read β€” TeX Parser codepoint read from file (likely to result in a large transcript file).
    • sty-data β€” TeX Parser data (typically relates to internal objects that don't have an analogous TeX macro). this includes data gathered from the aux file.

for example: bib2gls --debug-mode io,catcode,sty-data mydoc πŸ’…

  • --default-encoding name β€” set the default character encoding for input and output files. if you omit it, the JVM default encoding is assumed. slay, defaults πŸŽ€
  • --dir directory (or -d <directory>) β€” files are relative to directory. (this does not change the current working directory, she's not that kind of girl πŸ’–)
  • --expand-fields β€” don't write "\glsnoexpandfields" to the .glstex file.
  • --force-cross-resource-refs or -x β€” force cross-resource referencing mode on. no takebacks.
  • --group or -g β€” add the group field to entries. organizing queen πŸ‘‘
  • --help or -h β€” display the help message and exit. (hi, bye πŸ¦‹)
  • --ignore-packages list (or -k list) β€” don't parse the log file for the packages named in list. careful though: --packages overrides this option, so if the same package is in both --ignore-packages and --packages, the interpreter will check whether it's supported. this option has a cumulative action. and only known packages may be included in list 🌈
  • --interpret β€” use the TeX Parser Library to interpret known (La)TeX commands (default). she's reading, she's understanding, she's thriving ✨
  • --list-known-packages β€” lists all the packages known to the TeX parser library and then exits (with exit code 0). any of the listed packages can be used in --packages or --ignore-packages. window shopping πŸ›οΈ
  • --locale lang (or -l lang) β€” use the language resource file for lang (which should be an IETF locale tag).
  • --log-encoding name β€” set the character encoding for the log files (which might not be the same as the encoding for the document LaTeX files β€” they're different girls, they have different needs πŸ’…).
  • --log-file file (or -t <file>) β€” set the transcript file.
  • --merge-nameref-on rule β€” the rule for merging locations created with the record=nameref package option (requires glossaries-extra.sty version 1.37+). rule can be one of: hcounter, href, title or location.
  • --merge-wrglossary-records β€” merge an entry's wrglossary records for the same page locations. (for use with the indexcounter package option.)
  • --mfirstuc-math-protection β€” switch on the auto-insertion of an empty group for math-shift ("$").
if mfirstuc v2.08+, glossaries v4.50+ and glossaries-extra v1.49+ are detected, the default becomes --no-mfirstuc-math-protection, because there should no longer be any need for this protection. the future is now 🧚
  • --mfirstuc-protection fields|all (or -u fields|all) β€” insert an empty group if fields start with certain problematic commands, to protect against case-changing commands like "\Gls".

the default is to do this for all fields. to do it for only a subset of fields, set fields to a comma-separated list of fields (e.g. name,short,long). the keyword all indicates all fields.

if mfirstuc v2.08+, glossaries v4.50+ and glossaries-extra v1.49+ are detected, the default becomes --no-mfirstuc-protection, since there should no longer be any need for this protection πŸ’œ
  • --nested-link-check list|none β€” check each field listed in list for potentially problematic nested link text. (default list: name, text, plural, first, firstplural, short, shortplural, long, longplural, symbol.)

if none, the check is disabled. πŸ”

  • --no-break-space β€” interpret "~" (tilde) and "\nobreakspace" as a non-breaking space (default). she holds it together, literally 🌸
  • --no-cite-as-record β€” don't check for instances of "\citation" in the .aux file (default).
  • --no-collapse-same-location-range β€” don't collapse an explicit range that has a duplicate start and end location into a normal record.
  • --no-datatool-sort-markers β€” the interpreter will use the normal definition of the datatool-base.sty sort marker commands.
  • --no-date-in-header β€” the header comment at the start of the .glstex file will not include the file modification date (default).
  • --no-debug (or --nodebug) β€” switch debug mode off. (equivalent to --debug 0) 😴
  • --no-expand-fields β€” write "\glsnoexpandfields" to the .glstex file (default).
  • --no-force-cross-resource-refs β€” don't force cross-resource referencing mode on (default).
  • --no-group β€” don't add the group field to entries (default).
  • --no-interpret β€” don't try interpreting (La)TeX commands. the TeX Parser Library will still be used to parse the aux and bib files, she's just not going to interpret anything. respect the boundaries 🚧
  • --no-merge-wrglossary-records β€” don't merge an entry's wrglossary records.
  • --no-mfirstuc-math-protection β€” switch off the auto-insertion of an empty group for math-shift ("$").
  • --no-mfirstuc-protection β€” switch off the auto-insertion of an empty group for all fields.
  • --no-nested-link-check β€” don't check for potentially problematic nested link text. (equivalent to --nested-link-check none) πŸ™ˆ
  • --no-obey-aux-catcode β€” ignore category code changing commands encountered in the aux file.
  • --no-provide-glossaries β€” don't write "\provideignoredglossary*" to the .glstex file to provide unknown glossaries, except in documented situations (master, secondary and trigger-type resource options). this setting is the default.
  • --no-record-count β€” don't add the record count field to entries (default). heads up bestie: this option automatically implements --no-record-count-unit. two birds, one flag 🐦
  • --no-record-count-unit β€” don't add the unit record count field to entries (default).
  • --no-replace-quotes β€” don't replace quote characters (default).
  • --no-retain-formats β€” normal location merging rules apply (default).
  • --no-support-unicode-script β€” text superscript ("\textsuperscript") or subscripts ("\textsubscript") won't be converted to Unicode superscript/subscript characters. for example, "\textsuperscript{2}" will be converted to "<sup>2</sup>" and the markup will be stripped, leaving just the character 2. gone, reduced to atoms πŸ’€
  • --no-trim-fields β€” don't trim leading and trailing spaces from fields (default). this option cancels --trim-only-fields and --trim-fields. she said leave my whitespace ALONE 😭
  • --no-verbose (or --noverbose) β€” switch verbose mode off. (some messages will still be written to STDOUT, so don't think you've escaped completely πŸ‘€)
  • --no-warn-non-bib-fields β€” don't warn if internal non-bib fields are found in the .bib file.
⚠️ for real though: the use of these internal fields can cause unexpected results, so only use this option if you've taken appropriate precautions. this is the "she's not mad, she's just disappointed" flag πŸ’…
  • --no-warn-unknown-entry-types β€” the opposite of the warn one: if the .bib file has entry types nobody recognises, bestie, you just keep scrolling. No lecture. πŸ™ˆ
  • --obey-aux-catcode β€” do what the aux file says when it hits category code changing commands you actually know about. Respect the catcode, periodt. πŸ’…
  • --packages list (or -p list) β€” tells the TeX parser library to pretend the document already used every package in list. Heads up though: the TeX parser library only supports a limited number of packages, so don't get too creative. This one is cumulative, meaning --packages wasysym,pifont hits exactly the same as --packages wasysym --packages pifont. Slay, consistency. ✨

Wanna know which packages are actually supported? Run --list-known-packages. iykyk. πŸ”

  • --provide-glossaries β€” writes "\provideignoredglossary*" into the .glstex file so unknown glossaries get provided. Iconic safety net behaviour. 🫢
  • --quiet (or -q) β€” errors only, babe. Every other message just quietly goes to the transcript file like it's not even there. 🀫
  • --record-count or -c β€” adds record count fields to your entries. Counting era. πŸ”’
  • --record-count-rule rule or -r rule β€” sets the rule that --record-count and --record-count-unit obey. Note that this option automatically implements --record-count too, so it's doing double duty, lowkey overachiever. πŸ’ͺ

So what can rule be? Here's the menu:

  • "all" or "a" β€” count literally all the records
  • "non-ignored" or "n" β€” count all the non-ignored records
  • "f/"regex"/" β€” only count records where the format matches the regular expression regex
  • "c/"regex"/" β€” only count records where the counter name matches the regular expression regex
  • "f/"regex1"/c/"regex2"/"op β€” only count records where the format matches the regular expression regex1 and/or the counter name matches the regular expression regex2

The op part is optional. If you do include it, it's one of: "and" (format AND counter both have to match) or "or" (format OR counter has to match). Leave op out and AND is just assumed. No pressure. πŸŽ€

  • --record-count-unit or -n β€” adds unit record count fields to entries. And yep, this one automatically implements --record-count as well. Two birds. πŸ¦‹
  • --replace-quotes β€” swaps the single and double quote characters ("'" and """) for "\bibglsaposchar" and "\bibglsdoublequotechar" in field values and in the group information written out to the .glstex file. Quotation marks? Replaced. Gone. πŸ’€
  • --retain-formats list β€” says which location formats should always be retained, even when keeping them causes a partial duplicate. Only exact duplicates get merged, so don't come for the near-misses. πŸ‘‘
  • --shortcuts option β€” check for the shortcut commands when it's out here searching for dependencies. Permitted values of option: acronyms (or acro), ac, abbreviations (or abbr), all (or true), none (or false). And this overrides whatever setting the auxfile gave you. Sorry auxfile, she said what she said. πŸ’…
  • --map-format *key:value[,key:value]** (or -m *key:value[,key:value]**) β€” set location format mappings. Short and sweet. ✨
  • --silent β€” errors only, everything else gets written to the transcript file. It's literally a synonym of --quiet, same vibe, different name. 🌸
  • --support-unicode-script β€” text superscripts ("\textsuperscript") or subscripts ("\textsubscript") will use Unicode superscript/subscript characters if they're available. Example bestie: "\textsuperscript{2}" gets converted to U+00B2 (superscript two). Glow-up for your exponents. πŸ”₯
  • --tex-encoding name β€” sets the character encoding for the glstex files. Overrides whatever the auxfile said, because this girl makes her own choices. πŸ’œ
  • --trim-except-fields list β€” trims leading and trailing spaces off all the fields except the ones you listed. It's cumulative, but it gets cancelled by --trim-fields and --no-trim-fields. Also? You may not use this one together with --trim-only-fields. Pick a lane, bestie. 🚫
  • --trim-fields β€” trims leading and trailing spaces off every single field. This one cancels --trim-only-fields and --no-trim-fields. Clean sweep. 🧹
  • --trim-only-fields list β€” trims leading and trailing spaces off only the fields you listed. Cumulative, but cancelled by --trim-fields and --no-trim-fields. And just like its sibling, you may not use it with --trim-except-fields. Same rule, other direction. πŸ™…β€β™€οΈ
  • --verbose β€” switch on verbose mode. She's telling you everything. 😭
  • --version or -v β€” display version information and exit. Quick lil flex and she's out. ⭐
  • --warn-non-bib-fields β€” warns you if internal non-bib fields show up in the .bib file. Snitch mode, but make it helpful. πŸ‘€
  • --warn-unknown-entry-types β€” warns you if any unknown entry types show up in the .bib file. Same energy, different crime scene. πŸ•΅οΈ

🫢 REQUIRES

Java 8 or later and a TeX distribution. That's the whole checklist, no notes.


πŸ“œ LICENSE

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Okay so real talk: NO WARRANTY, bestie. Not even a little. To the extent permitted by law, obviously. πŸ’€

The bib2gls manual:

texdoc bib2gls

The glossaries-extra manual:

texdoc glossaries-extra

The glossaries manual:

texdoc glossaries

Three manuals. Go read, queen. πŸ‘‘


πŸ‘‘ AUTHOR

Nicola L. C. Talbot, <https://www.dickimaw-books.com/>


And that's the whole page, bestie! πŸŽ€ This beauty lives on perl v5.40.2, dated 2025-02-02, and it's page BIB2GLS(1) β€” go forth and cite responsibly. πŸ’–βœ¨

πŸ“¦ where this page comes from