.TH BIB-GEN 1 "June 2026" "bibutils" "User Commands" .SH NAME bib-gen \- generate a bibtex entry .SH SYNOPSIS .B bib-gen .RB [ \-t .IR type ] .RI [ field = value " ...]" .br .B bib-gen .RB [ \-t .IR type ] .B \-F .IR field , field ,... .SH DESCRIPTION .B bib-gen builds bibtex entries and emits them on standard output, with citation keys generated as by .BR bib-key (1). It runs in one of three modes: .TP .B interactive With no field arguments and no .BR \-F , the user is prompted for the entry type and then for each field appropriate to that type. Fields left empty are omitted. .TP .B argument Each .IR field = value argument supplies one field of a single entry. .TP .B batch With .BR \-F , one entry is generated per line of standard input. Lines are split on tabs, with columns assigned to the listed fields in order. .SH OPTIONS .TP .BI \-t " type" The bibtex entry type (default .BR article ). .TP .BI \-F " field,field,..." Enable batch mode with the given column-to-field mapping. .SH EXIT STATUS 0 on success, 1 if no fields were supplied, 2 on usage error. .SH EXAMPLES .nf bib-gen -t book author='D. E. Knuth' title='The TeXbook' \\ publisher='Addison-Wesley' year=1984 | bib-add refs.bib printf 'A. Author\\tSome Title\\tSome Journal\\t1999\\n' | bib-gen -F author,title,journal,year .fi .SH SEE ALSO .BR bib-add (1), .BR bib-key (1), .BR bib-util (1)