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:
- it selects entries from
.bibfiles based on what it finds in the auxfile (verybibtexcoded of her), and - it hierarchically sorts those entries and collates location lists (which is the whole
makeindex/xindyvibe).
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-actionsetting β what do we do whenbib2glsruns 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(orskip 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-packageslist β 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 thedatatool-base.stymarker 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.glstexfile 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 is0, debug mode goes off. if you leave n out, it's set to1, which is the same as--debug-mode io. any positive number enables all ofbib2gls's debugging messages. how many TeX Parser Library debugging messages you get depends on the bitwise operation of n. math girlies rise π₯--debug-modesetting β use this instead of--debugwhen 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-encodingname β set the default character encoding for input and output files. if you omit it, the JVM default encoding is assumed. slay, defaults π--dirdirectory (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.glstexfile.--force-cross-resource-refsor-xβ force cross-resource referencing mode on. no takebacks.--groupor-gβ add the group field to entries. organizing queen π--helpor-hβ display the help message and exit. (hi, bye π¦)--ignore-packageslist (or-klist) β don't parse the log file for the packages named in list. careful though:--packagesoverrides this option, so if the same package is in both--ignore-packagesand--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 code0). any of the listed packages can be used in--packagesor--ignore-packages. window shopping ποΈ--localelang (or-llang) β use the language resource file for lang (which should be an IETF locale tag).--log-encodingname β 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-filefile (or-t<file>) β set the transcript file.--merge-nameref-onrule β the rule for merging locations created with therecord=namerefpackage option (requiresglossaries-extra.styversion 1.37+). rule can be one of:hcounter,href,titleorlocation.--merge-wrglossary-recordsβ merge an entry'swrglossaryrecords for the same page locations. (for use with theindexcounterpackage 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-protectionfields|all (or-ufields|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-checklist|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.auxfile (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 thedatatool-base.stysort marker commands.--no-date-in-headerβ the header comment at the start of the.glstexfile 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.glstexfile (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'swrglossaryrecords.--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.glstexfile 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 character2. gone, reduced to atoms π--no-trim-fieldsβ don't trim leading and trailing spaces from fields (default). this option cancels--trim-only-fieldsand--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.bibfile.
β οΈ 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.bibfile 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. π--packageslist (or-plist) β 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,pifonthits 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.glstexfile 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-countor-cβ adds record count fields to your entries. Counting era. π’--record-count-rulerule or-rrule β sets the rule that--record-countand--record-count-unitobey. Note that this option automatically implements--record-counttoo, 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-unitor-nβ adds unit record count fields to entries. And yep, this one automatically implements--record-countas 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.glstexfile. Quotation marks? Replaced. Gone. π--retain-formatslist β 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. π--shortcutsoption β check for the shortcut commands when it's out here searching for dependencies. Permitted values of option:acronyms(oracro),ac,abbreviations(orabbr),all(ortrue),none(orfalse). 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-encodingname β sets the character encoding for the glstex files. Overrides whatever the auxfile said, because this girl makes her own choices. π--trim-except-fieldslist β trims leading and trailing spaces off all the fields except the ones you listed. It's cumulative, but it gets cancelled by--trim-fieldsand--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-fieldsand--no-trim-fields. Clean sweep. π§Ή--trim-only-fieldslist β trims leading and trailing spaces off only the fields you listed. Cumulative, but cancelled by--trim-fieldsand--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. π--versionor-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.bibfile. Snitch mode, but make it helpful. π--warn-unknown-entry-typesβ warns you if any unknown entry types show up in the.bibfile. 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. π
π RECOMMENDED READING
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
- fedora 44: texlive-bib2gls 12:svn76845-105.fc44 Β· GPL-3.0-or-later
- fedora 44: texlive-bib2gls 12:svn76845-111.fc44 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms