BIB2GLS(1)
π bib2gls β BIB2GLS(1) π
β¨ SYNOPSIS β¨
bib2gls [option]+ auxfile
π DESCRIPTION π
okay so bib2gls is literally designed to work with the glossaries-extra LaTeX package. (The record package option is required β no cap.) This app does two functions in one: (1) selects entries from .bib files according to information found in the auxfile (similar to bibtex); (2) hierarchically sorts entries and collates location lists (similar to makeindex and xindy). The .aux extension may be omitted from auxfile.
The auxfile (and corresponding .log file) should either be in the current directory or in the directory specified by --dir. Bib files can either be relative to the directory the auxfile is in or in a location that can be found by kpsewhich.
π OPTIONS π
--aux-input-actionsetting β Determines what to do whenbib2glsencounters\@inputin the aux file. The setting may be one of:followβ Follow the reference (that is, input the file as usual).skip-after-bibglsaux(orskip after bibglsaux) β Follow the reference for each\@inputencountered until\@bibgls@inputis encountered, after which skip all remaining instances of\@input(default).skipβ Skip all instances of\@input(but not\@bibgls@input, which is always followed).
The \@bibgls@input command will be in the aux file if the package option bibglsaux has been used.
--break-spaceβ Interpret~(tilde) character and\nobreakspaceas a normal space.--cite-as-recordβ Treat\citationas an ignored record.--collapse-same-location-rangeβ Collapse an explicit range that has a duplicate start and end location into a normal record (default).--custom-packageslist β Instruct the TeX parser library to attempt to parse the packages listed in list. This is intended for simple custom packages that don't contain complex code.--datatool-sort-markersβ The interpreter will use thedatatool-base.stymarker commands to match their localised definitions within\DTLsortwordlist(datatool v3.0+). You will need a sort method that doesn't ignore the control characters used by those commands.--date-in-header(or-D) β The header comment at the start of the.glstexfile will include the file modification date.--debug[n] β Switch on the debug mode at the given setting n, which should be a non-negative integer. If n is 0 then the debug mode is switched off. If omitted, n is set to 1, which corresponds to--debug-mode io. Any positive number will enable all ofbib2gls's debugging messages. The amount of TeX Parser Library debugging messages depends on bitwise operation of n.--debug-modesetting β May be used instead of--debugwhere the level number is difficult to remember. The setting may be a comma-separated list of any of the 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 omitted, the JVM default encoding is assumed.--dirdirectory (or-d <directory>) β Files are relative to directory. (This doesn't change the current working directory.)--expand-fieldsβ Don't write\glsnoexpandfieldsto the.glstexfile.--force-cross-resource-refsor-xβ Force cross-resource referencing mode on.--groupor-gβ Add group field to entries.--helpor-hβ Display help message and exit.--ignore-packageslist (or-klist) β Don't parse the log file for the packages listed in list. Note that--packagesoverrides this option, so if the same package is listed in both--ignore-packagesand--packagesthen the interpreter will check if it's supported. This option has a cumulative action. Only known packages may be included in list.--interpretβ Use the TeX Parser Library to interpret known (La)TeX commands (default).--list-known-packagesβ Lists all the packages that are known to the TeX parser library and then exits (with exit code 0). Any of the listed packages may be used in--packagesor--ignore-packages.--localelang (or-llang) β Use language resource file for lang (which should be an IETF locale tag).--log-encodingname β Set the character encoding for the log files (which may not be the same as the encoding for the document LaTeX files).--log-filefile (or-t <file>) β Set the transcript file.--merge-nameref-onrule β Rule for merging locations created with therecord=namerefpackage option (requiresglossaries-extra.styversion 1.37+). The rule may be one of:hcounter,href,titleorlocation.--merge-wrglossary-recordsβ Merge an entry's wrglossary records 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 will be --no-mfirstuc-math-protection as there should no longer be any need for this protection.
--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 this 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 will be --no-mfirstuc-protection as 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, disable check.
--no-break-spaceβ Interpret~(tilde) and\nobreakspaceas a non-breaking space (default).--no-cite-as-recordβ Don't check for instances of\citationin 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 off debug mode. (Equivalent to--debug 0)--no-expand-fieldsβ Write\glsnoexpandfieldsto the.glstexfile (default).--no-force-cross-resource-refsβ Don't force cross-resource referencing mode on (default).--no-groupβ Don't add 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.--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.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 record count field to entries (default). This option automatically implements--no-record-count-unit.--no-record-count-unitβ Don't add 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-shift-zero-sectionsβ Don't check for locations ending with.0(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.--no-trim-fieldsβ Don't trim leading and trailing spaces from fields (default). This option cancels--trim-only-fieldsand--trim-fields.--no-verbose(or--noverbose) β Switch off verbose mode. (Some messages will still be written to STDOUT.)--no-warn-non-bib-fieldsβ opposite energy of the warn version below: don't complain when internal non-bib fields show up in the.bibfile. Fr though, those internal fields can cause unexpected results, so only reach for this if you've taken appropriate precautions. π«Ά--no-warn-unknown-entry-typesβ big "i don't wanna hear it" to the warning about unknown entry types in the.bibfile.--obey-aux-catcodeβ obey the known category code changing commands you run into in the aux file. yes ma'am, following orders β¨--packageslist (or-plist) β tells the TeX parser library to pretend the document used the packages in list. heads up though: only a limited number of packages are supported by the TeX parser library π this one's cumulative, so--packages wasysym,pifonthits exactly the same as--packages wasysym --packages pifont.
You can find out the full supported list with --list-known-packages. iykyk.
--provide-glossariesβ writes\provideignoredglossary*into the.glstexfile so unknown glossaries get provided. considerate queen behavior π--quiet(or-q) β only error messages get displayed, everything else just goes quietly into the transcript file. lowkey introvert mode π€«--record-count(or-c) β adds record count fields to entries. cute little receipts for your records π--record-count-rulerule (or-rrule) β sets the rule that--record-countand--record-count-unituse. also, this option automatically implements--record-count, so it's a package deal.
The rule may be one of these:
"all"or"a"β count all records"non-ignored"or"n"β count all 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 present it may be "and" (format AND counter must match) or "or" (format OR counter must match). If op is omitted, AND is assumed. no chaos, just vibes β¨
--record-count-unit(or-n) β adds unit record count fields to entries. this one also automatically implements--record-count, so yeah, they're besties fr fr.--replace-quotesβ replaces single'and double"quote characters with\bibglsaposcharand\bibglsdoublequotecharin field values and group information written to the.glstexfile. literal glow-up for your quotes π--retain-formatslist β says which location formats should always be retained, even if it causes a partial duplicate. only exact duplicates get merged. not me protecting my faves π--shift-zero-sectionsβ shifts up section locations ending with.0(for sections deeper than chapter). this action is applied recursively, so it keeps going.
For example, if a record has counter "subsection" and location 2.0.0, then this will first be replaced with counter "section" and location 2.0 β but since that still has a section location ending with .0, the function gets applied again and the counter changes to "chapter" with location changed to 2 (so location subsection 2.0.0 ends up as chapter 2). the log file (and verbose mode) will have a line for each change in the recursion. π
--shortcutsoption β checks for the shortcut commands when searching for dependencies. permitted values of option are:acronyms(oracro),ac,abbreviations(orabbr),all(ortrue),none(orfalse). this overrides the setting given in auxfile.--map-format*key:value[,key:value]** (or-m*key:value[,key:value]**) β sets location format mappings. πΊοΈ--silentβ only error messages get displayed, everything else just goes to the transcript file. it's a synonym of--quiet, so pick whichever one sounds cuter.--support-unicode-scriptβ text superscript (\textsuperscript) or subscripts (\textsubscript) will use Unicode superscript/subscript characters if available. for example,\textsuperscript{2}gets converted to U+00B2 (superscript two). slay π¦--tex-encodingname β sets the character encoding for the glstex files. this overrides the setting given in auxfile.--trim-except-fieldslist β trims leading and trailing spaces from all fields except the ones listed. this option is cumulative but gets cancelled by--trim-fieldsand--no-trim-fields. > also it may not be used with--trim-only-fieldsβ they simply cannot coexist, periodt.--trim-fieldsβ trims leading and trailing spaces from all fields. this option cancels--trim-only-fieldsand--no-trim-fields. it's giving "clean slate" πΈ--trim-only-fieldslist β trims leading and trailing spaces from only the listed fields. cumulative, but cancelled by--trim-fieldsand--no-trim-fields. > and again: may not be used with--trim-except-fields. pick a lane bestie π€--verboseβ switches on verbose mode. main character energy: it tells you everything that's happening π₯--versionor-vβ displays version information and exits. short and sweet π--warn-non-bib-fieldsβ warns you if internal non-bib fields are found in the.bibfile.--warn-unknown-entry-typesβ warns you if any unknown entry types are found in the.bibfile.
β¨ REQUIRES β¨
Java 8 or later, plus a TeX distribution. that's the entry fee, no exceptions ποΈ
π 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. (yes the all-caps is on purpose, it's serious π)
π RECOMMENDED READING π
- The bib2gls manual:
texdoc bib2gls
- The glossaries-extra manual:
texdoc glossaries-extra
- The glossaries manual:
texdoc glossaries
π AUTHOR π
Nicola L. C. Talbot, <https://www.dickimaw-books.com/> β an absolute icon π
and that's a wrap on BIB2GLS(1)! π this one's from perl v5.40.3, dated 2025-11-13 β so go forth, feed it your .bib files, and let it cook. bye bestie, mwah π
π
π¦ where this page comes from
- alpine 3.24: texmf-dist-bibtexextra-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms