%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title:    bibupdate manual
% Author:   Andrew Mathas
% Created:  November 2026
% Modified: 15:54 Monday, 02 November 2026
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{amsart}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[
  layout       = a4paper,
  footskip     = 16mm,
  hmargin      = 16mm,
  includefoot,
  top          = 0.05\paperheight,
  bottom       = 0.12\paperheight,
]{geometry}

\usepackage[svgnames]{xcolor}
\usepackage{booktabs}
\usepackage{fvextra}

% BEGIN GENERATED BIBUPDATE PREAMBLE
\usepackage[T1]{fontenc}
\usepackage{needspace}
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\makeatletter
\newcommand{\BibUpdateOptionHeading}{\@startsection{paragraph}{4}{0pt}
  {-6pt plus -2pt minus -1pt}{3pt}
  {\normalfont\bfseries\color{NavyBlue}}}
\makeatother
\newenvironment{BibUpdateOptionDescription}
  {\begin{list}{}{\setlength{\leftmargin}{2em}\setlength{\rightmargin}{0pt}%
    \setlength{\listparindent}{0pt}%
    \setlength{\topsep}{0pt}\setlength{\parsep}{4pt plus 1pt}%
    \setlength{\itemsep}{0pt}}\item\relax}
  {\end{list}}
% END GENERATED BIBUPDATE PREAMBLE

\usepackage{imakeidx}
\indexsetup{level=\section*, toclevel=section, noclearpage}
\makeindex[intoc,columns=3]

\newcommand\option[2]{%
  \medskip\noindent\textsf{\textcolor{NavyBlue}{#1}} (default: #2)%
  \index{#1}%
}

\newcommand\ctan[1]{\href{https://www.ctan.org/pkg/#1}{\texttt{#1}}}

\ExplSyntaxOn
\prop_new:N \l__bibupdate_prop

\cs_new_protected:Npn \__bibupdate_read_line:w #1 = #2 \q_stop
{
  \prop_put:Nee \l__bibupdate_prop { \tl_trim_spaces:n {#1} } { \tl_trim_spaces:n {#2} }
}

\ior_new:N \l__bibupdate_ior
\ior_open:Nn \l__bibupdate_ior { bibupdate.ini }
\ior_str_map_inline:Nn \l__bibupdate_ior
{
  \tl_if_in:nnT {#1} { = } { \__bibupdate_read_line:w #1 \q_stop }
}
\ior_close:N \l__bibupdate_ior

\NewExpandableDocumentCommand\BibUpdateIni{m}{ \prop_item:Nn \l__bibupdate_prop {#1} }
\ExplSyntaxOff


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\Section[1]{\subsection*{\textcolor{blue}{#1}}}

\makeatletter
% README-style headings: left aligned, unnumbered, and on their own line.
\renewcommand\subsection{\@startsection{subsection}{2}{0pt}
  {-12pt plus -3pt minus -2pt}{6pt}
  {\normalfont\large\bfseries\color{NavyBlue}}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{0pt}
  {-8pt plus -2pt minus -1pt}{3pt}
  {\normalfont\bfseries\color{NavyBlue}}}
\author{Andrew Mathas}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\tikzset{
    shadowed/.style={
        blur shadow={shadow blur steps=5},
        bottom color=Teal!80,
        draw=NavyBlue!70,shade,
      % font=\normalfont\Huge\bfseries\scshape,
        rounded corners=8pt,
        top color=MidnightBlue,
      },
      boxes/.style={
        draw=SteelBlue,
        fill=LightSkyBlue!20,
        font=\sffamily\small,
        inner sep=5pt,
        rectangle,
        rounded corners=8pt,
        text=RoyalBlue,
     }
}

\usepackage{hologo}
\usepackage{xspace}
\newcommand\BibUpdate{\textsc{Bib}\textsf{Update}\xspace}
\newcommand\BibUpdateTitle
{%
  \begin{tikzpicture}[remember picture,overlay]
      \node[yshift=-3cm] at (current page.north west)
        {\begin{tikzpicture}[remember picture, overlay]
          \draw[shadowed](30mm,0) rectangle node[white]{\BibUpdate} (\paperwidth-30mm,16mm);
          \node[anchor=west,boxes] at (4cm,0cm) {Andrew Mathas};
          \node[anchor=east,boxes] at (\paperwidth-4cm,0) {Version \BibUpdateIni{version}};
         \end{tikzpicture}
        };
   \end{tikzpicture}
   \vspace*{20mm}
}

\def\@evenfoot{\thepage\hfill\BibUpdate}
\def\@oddfoot {Version \BibUpdateIni{version} --- \BibUpdateIni{release date}\hfill\thepage}
\def\@evenhead{}
\def\@oddhead{}

\usepackage[colorlinks=true,linkcolor=MidnightBlue,urlcolor=SlateBlue]{hyperref}
\hypersetup{
    pdfcreator = { Generated by pdfLaTeX },
    pdfinfo    = {
      Author   = { \BibUpdateIni{author} },
      Keywords = { \BibUpdateIni{keywords} },
      License  = { \BibUpdateIni{license} },
      Subject  = { \BibUpdateIni{description} },
      Title    = { bibupdate - \BibUpdateIni{version} }
    },
}
\makeatother


\begin{document}
\raggedbottom
\setlength{\parindent}{0pt}
\setlength{\parskip}{4pt plus 1pt}

    \BibUpdateTitle


% BEGIN GENERATED BIBUPDATE HELP
% Generated from bibupdate.__doc__; edit the help, then run python3 setup.py readme.
Automatically update bibtex files

Usage:

\begin{Verbatim}[breaklines=true,fontsize=\small]
bibupdate [-h|-H] [-a] [-x] [-c] [-k] [-i FIELDS] [-l LOG]
          [-m | -M | -n] [-o] [-q] [--threads N] [-w LEN]
          [--deduplicate] [--remove-duplicate-papers] [--rename-duplicate-keys]
          [--list-duplicates] [--list-papers] [--list-keys]
          [-t FILE.tex [FILE.tex ...]]
          [--output FILE.bib] bibtexfile [outputfile]
bibupdate --merge [options] FILE.bib FILE.bib [FILE.bib ...]
\end{Verbatim}

This is a command line tool for updating the entries in a
\href{http://www.bibtex.org/}{BibTeX} file using the tools provided by
the American Mathematical Society:
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup},
\href{https://mathscinet.ams.org/mathscinet/publications-search}{MathSciNet}
and \href{https://mathscinet.ams.org/mathscinet/freetools/mref}{MRef}.
By default \href{https://github.com/AndrewMathas/BibUpdate}{bibupdate}
uses
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
to update \texttt{article}, \texttt{book}, \texttt{inproceedings} and
\texttt{incollection} entries when they do not have an \texttt{mrnumber}
field. Entries are not updated if they already have an \texttt{mrnumber}
field, even an empty one, unless \texttt{-\/-all} or \texttt{-\/-check}
is used. The \texttt{-x} option makes
\href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} look for
each paper in the \href{http://arxiv.org/}{arXiv} and add
\texttt{eprint} and \texttt{archiveprefix} fields for all the papers
that it finds. In addition,
\href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} is able to
merge bibliography files, removing duplicate papers and keys in the
process and, optionally, updating citations to renamed duplicate keys in
\href{https://latex-project.org/}{LaTeX} files.

By default, \href{https://github.com/AndrewMathas/BibUpdate}{bibupdate}
does not change your original file. Instead, it writes the updated
entries to a new file, with the filename given by adding an
\texttt{updated\_} prefix, so \emph{file.bib} becomes
\emph{updated\_file.bib}. To update the bib file in place, use
\texttt{-\/-overwrite}, or give a output filename. Existing output files
are backed up with \texttt{.bak} extensions, but \texttt{-\/-overwrite}
should still be used with care.

This should be used with care because you can potentially lose data.

\textbf{Options by task}:

\Needspace{4\baselineskip}
\textbf{Updating and checking}

\begin{Verbatim}[breaklines=true,fontsize=\small]
-m, --mrlookup        use mrlookup to update bibtex entries (default)
-M, --mathscinet      use mathscinet to update bibtex entries (less flexible)
-n, --mref            use mref to update bibtex entries
-a, --all             update or validate ALL BibTeX entries
-x, --arxiv           add arXiv eprint fields to entries
-c, --check           check all entries and report duplicates without writing a file
\end{Verbatim}

\Needspace{4\baselineskip}
\textbf{Duplicate listing}

\begin{Verbatim}[breaklines=true,fontsize=\small]
--list-duplicates     list duplicate papers and keys without writing a file
--list-papers         list duplicate papers only
--list-keys           list repeated citation keys only
\end{Verbatim}

\Needspace{4\baselineskip}
\textbf{Duplicate cleanup}

\begin{Verbatim}[breaklines=true,fontsize=\small]
--deduplicate         remove duplicate papers and rename repeated keys
--remove-duplicate-papers
                      remove duplicate papers, keeping the first
--rename-duplicate-keys
                      rename repeated keys using authors and year
--merge               merge two or more .bib files and clean up duplicates
-t, --texfile FILE.tex [FILE.tex ...]
                      update citations in listed TeX files during cleanup
\end{Verbatim}

\Needspace{4\baselineskip}
\textbf{Output and formatting}

\begin{Verbatim}[breaklines=true,fontsize=\small]
--output FILE.bib     write the bibliography to this file
-o, --overwrite       update/overwrite the bibtex file (use with care)
-i FIELDS, --ignored-fields FIELDS
                      space-separated list of bibtex fields to ignore
-k, --keep-fonts      do NOT replace fonts \Bbb, \germ and \scr in titles
-w LEN, --wrap LEN    wrap bibtex fields to specified width
--threads N           number of concurrent AMS lookups (default: 1)
\end{Verbatim}

\Needspace{4\baselineskip}
\textbf{Reports and logging}

\begin{Verbatim}[breaklines=true,fontsize=\small]
-q, --quiet           brief updates and missed lookups
-qq                   only print errors
-l LOG, --log LOG     log messages to specified file (defaults to stdout)
\end{Verbatim}

\Needspace{4\baselineskip}
\textbf{Help and version}

\begin{Verbatim}[breaklines=true,fontsize=\small]
-h, --help            show grouped options and exit
-H, --Help            print full program description
\end{Verbatim}

\textbf{Note:} As described below, you should check the updated
\texttt{.bib} file for errors before deleting the original
\href{http://www.bibtex.org/}{BibTeX} file.

\href{http://www.bibtex.org/}{BibTeX} is widely used by the
\href{https://latex-project.org/}{LaTeX} community to maintain
publication databases. This script attempts to add missing fields to the
papers in a \href{http://www.bibtex.org/}{BibTeX} database file by
querying
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
and getting the missing publication data from there. This is not
completely routine because an
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
search requires either the names of the authors, or the title of the
article, and both of these can have non-standard representations. If the
article is already published, then it is also possible to use the
publication year and its page numbers as part of the search. To search
on
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
we:

\begin{itemize}
\tightlist
\item
  use the first author\textquotesingle s surname (accents and compound
  surnames can be problematic)
\item
  use numeric page ranges, or a single numeric page, when available
\item
  include the year for books, or when a numeric first page is available
\item
  use the cleaned title when a numeric first page is not available
\end{itemize}

The author query uses only the first author\textquotesingle s surname
because
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
does not accept multiple author names joined by
\textquotesingle and\textquotesingle. Braces used to protect capitals in
titles (for example \texttt{\{Kac-Moody\}}) are removed when searching
and matching, with the title stored in the
\href{http://www.bibtex.org/}{BibTeX} file retaining its braces.

If there is a unique match from
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup},
then \href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} updates
the entry in the \href{http://www.bibtex.org/}{BibTeX} file using the
field values returned by an
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
search, except for the citation key and any fields excluded by
\texttt{-\/-ignored-fields}. Any fields that are not returned by
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup},
such as \texttt{eprint}, are retained. By default, a message is printed
whenever an entry in the database is changed. If the title of the
retrieved paper does not (fuzzily) match that of the original article,
then the entry is NOT updated and a warning message is printed.

Although some care is taken to ensure that the new
\href{http://www.bibtex.org/}{BibTeX} entries correspond to the original
entry in the \href{http://www.bibtex.org/}{BibTeX} file, there is always
a (small?) chance the new entry corresponds to a completely different
paper. In my experience this happens rarely, and mostly with unpublished
manuscripts. In any case, before you delete your original
\href{http://www.bibtex.org/}{BibTeX} file \emph{you are strongly
advised to check the updated BibTeX file carefully for errors!}

By default, the program prints a compact listing of any updated paper in
the \href{http://www.bibtex.org/}{BibTeX} file, including any added
\href{http://arxiv.org/}{arXiv} fields. This can generate a lot of
output the first time
\href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} is run on
large files, later runs produce much less output.

As \href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} calls
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup},
this program will only be useful if you have papers in your database
that are listed in
\href{https://mathscinet.ams.org/mathscinet/publications-search}{MathSciNet}.
As described below it is also possible to call
\href{https://mathscinet.ams.org/mathscinet/publications-search}{MathSciNet}
directly, however, this is less flexible because the \texttt{mrnumber}
field for each paper is required.

I wrote this script because I wanted to automatically update the papers
in my \href{http://www.bibtex.org/}{BibTeX} files when they were
published, so that the file has up-to-date information on all of the
papers in the file, including journal names,
\href{http://arxiv.org/}{arXiv} links, and DOIs for each paper. As a
bonus the script helped me to correct many minor errors that had crept
into my \href{http://www.bibtex.org/}{BibTeX} file over the years (for
example, incorrect page numbers and publication years).

\subsection*{Options and defaults}\label{options-and-defaults}

By default, \href{https://github.com/AndrewMathas/BibUpdate}{bibupdate}
uses
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup},
sending one AMS lookup request at a time. It prints a compact listing
for each entry in the file that is updated, writing the updated
\href{http://www.bibtex.org/}{BibTeX} file to \texttt{updated\_file.bib}
if the original input file was \texttt{file.bib}.

\subsubsection*{Updating and checking}\label{updating-and-checking}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-m,\ -\/-mrlookup}}{-m, -\/-mrlookup}}\label{-m---mrlookup}

\begin{BibUpdateOptionDescription}

Use
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
to update \href{http://www.bibtex.org/}{BibTeX} entries (default)

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-M,\ -\/-mathscinet}}{-M, -\/-mathscinet}}\label{-m---mathscinet}

\begin{BibUpdateOptionDescription}

Use
\href{https://mathscinet.ams.org/mathscinet/publications-search}{MathSciNet}
to update \href{http://www.bibtex.org/}{BibTeX} entries

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-n,\ -\/-mref}}{-n, -\/-mref}}\label{-n---mref}

\begin{BibUpdateOptionDescription}

Use \href{https://mathscinet.ams.org/mathscinet/freetools/mref}{MRef} to
update \href{http://www.bibtex.org/}{BibTeX} entries

By default
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
is used. Its main advantage is that it has a more flexible search
mechanism using author, title, year and page numbers, so it can find
papers even when they do not yet have an \texttt{mrnumber}.

With \texttt{-M}, the entry is looked up using its \texttt{mrnumber}.
Entries with missing, empty or non-numeric MR numbers are skipped,
including with \texttt{-\/-all} and \texttt{-\/-check}.

With \texttt{-n}, the full \href{http://www.bibtex.org/}{BibTeX} entry
is handed to
\href{https://mathscinet.ams.org/mathscinet/freetools/mref}{MRef} as a
free-form reference. The best matching record is then checked against
the original title. Like
\href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup},
\href{https://mathscinet.ams.org/mathscinet/freetools/mref}{MRef}
normally checks only \texttt{article}, \texttt{book},
\texttt{inproceedings} and \texttt{incollection} entries without an
\texttt{mrnumber} field. Use \texttt{-\/-all} to check all recognised
entry types.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-a,\ -\/-all}}{-a, -\/-all}}\label{-a---all}

\begin{BibUpdateOptionDescription}

Update or validate ALL BibTeX entries

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-x,\ -\/-arxiv}}{-x, -\/-arxiv}}\label{-x---arxiv}

\begin{BibUpdateOptionDescription}

Update the arXiv entry for each paper

When the paper is found, add \texttt{eprint} and \texttt{archiveprefix}
fields to the \href{http://www.bibtex.org/}{BibTeX} entry:

\begin{Verbatim}[breaklines=true,fontsize=\small]
eprint = {2211.07069},
archiveprefix = {arXiv}
\end{Verbatim}

\href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} searches the
\href{http://arxiv.org/}{arXiv} using the significant words in the
title. A paper returned by the \href{http://arxiv.org/}{arXiv} is
counted as a match only when there is a unique paper with a sufficiently
good (fuzzy) match. The \texttt{-x} option can be combined with any of
the \texttt{-m}, \texttt{-M} or \texttt{-n} lookup tools. Entries with
an existing \texttt{eprint} field, even an empty one, are skipped unless
\texttt{-a} or \texttt{-\/-check} is used. Entries without a usable
title cannot be searched.

As requested by the \href{http://arxiv.org/}{arXiv},
\href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} waits at
least 3 seconds after each completed \href{http://arxiv.org/}{arXiv}
request before sending the next one. Updating a large database with
\texttt{-x} can take a long time.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-c,\ -\/-check}}{-c, -\/-check}}\label{-c---check}

\begin{BibUpdateOptionDescription}

Check all entries and report duplicates, printing compact listings for
each database entry that would be changed. No output file is written.
This option implies \texttt{-\/-all}.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-threads\ N}}{-\/-threads N}}\label{--threads-n}

\begin{BibUpdateOptionDescription}

Number of concurrent AMS lookups

Use \texttt{-\/-threads\ N} to run \texttt{N} searches in parallel.
\href{http://arxiv.org/}{arXiv} lookups remain sequential and keep their
delay between requests, regardless of the thread count.

\end{BibUpdateOptionDescription}

\subsubsection*{Duplicate listing}\label{duplicate-listing}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-list-duplicates}}{-\/-list-duplicates}}\label{--list-duplicates}

\begin{BibUpdateOptionDescription}

List any duplicated papers, or citation keys, in the
\href{http://www.bibtex.org/}{BibTeX} database.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-list-papers}}{-\/-list-papers}}\label{--list-papers}

\begin{BibUpdateOptionDescription}

List duplicate papers only, including possible title-and-author matches

Two entries are treated as the same paper if they share a DOI, an MR
number or an arXiv identifier. As a fallback, entries whose normalized
titles and author lists (surnames and first initials) agree are reported
as \emph{possible} duplicates. Entries linked through a chain of such
matches are grouped together. The same rules are used by
\texttt{-\/-check}, \texttt{-\/-remove-duplicate-papers} and
\texttt{-\/-deduplicate}.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-list-keys}}{-\/-list-keys}}\label{--list-keys}

\begin{BibUpdateOptionDescription}

List repeated citation keys only

\end{BibUpdateOptionDescription}

\subsubsection*{Duplicate cleanup}\label{duplicate-cleanup}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-deduplicate}}{-\/-deduplicate}}\label{--deduplicate}

\begin{BibUpdateOptionDescription}

Remove duplicate papers and rename repeated citation keys

This offline cleanup first removes repeated papers, then renames
repeated keys among the remaining entries. As usual, the updated file is
written to \texttt{updated\_file.bib} unless \texttt{-\/-overwrite} is
used. Existing fields and formatting are preserved; missing fields are
added from later copies. Ignored-field, font-conversion and wrapping
options do not apply to cleanup. Cleanup cannot be combined with listing
options or \texttt{-\/-check}, and the lookup options (\texttt{-m},
\texttt{-M}, \texttt{-n}, \texttt{-a} and \texttt{-x}) are ignored.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-remove-duplicate-papers}}{-\/-remove-duplicate-papers}}\label{--remove-duplicate-papers}

\begin{BibUpdateOptionDescription}

Remove repeated papers, keeping the first occurrence in file order

Papers are matched as described under \texttt{-\/-list-papers}.
Title-and-author matching is heuristic, so inspect the output of
\texttt{-\/-list-papers} before removing entries.

The first entry is the base. Missing fields are copied from later
entries in file order. Existing fields, including empty fields, are
kept; if several copies supply the same missing field, the first value
wins. Field expressions and macros are copied without expansion. Each
removal reports the removed key and the retained key, with source lines.
Literal \texttt{crossref}, \texttt{xref}, \texttt{related},
\texttt{entryset} and \texttt{xdata} references inside the bibliography
are updated where the mapping is unambiguous. Use \texttt{-t} to update
citations in external \href{https://latex-project.org/}{LaTeX} files;
otherwise these must be updated manually.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-rename-duplicate-keys}}{-\/-rename-duplicate-keys}}\label{--rename-duplicate-keys}

\begin{BibUpdateOptionDescription}

Rename repeated keys without deleting papers. The first occurrence of
each key is kept. Duplicated key names are replaced with a key formed
from the authors\textquotesingle{} surnames and the year, for example
\texttt{AcharRiche2019}. Editors\textquotesingle{} names are used if
there are no authors. If necessary, a suffix of \texttt{a}, \texttt{b},
..., \texttt{z}, \texttt{aa}, etc. is added to ensure that the key names
are unique.

Using \texttt{-\/-remove-duplicate-papers} together with
\texttt{-\/-rename-duplicate-keys} is equivalent to
\texttt{-\/-deduplicate}.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-merge}}{-\/-merge}}\label{--merge}

\begin{BibUpdateOptionDescription}

Merge two or more BibTeX files, removing duplicate papers and keys

The input files must have a \texttt{.bib} extension and are processed in
the order given. When removing duplicates, the rules used by
\texttt{-\/-deduplicate} apply: the first copy of each paper and key is
kept, and any repeated keys are renamed using the
authors\textquotesingle{} names and the publication year. Fields missing
from the first copy are added from later entries, with earlier values
having precedence. Retained entries, comments, preambles and string
macros keep their original formatting; macros are not expanded for
duplicate matching.

Merging is offline and cannot be combined with \texttt{-\/-check} or
duplicate listing options.

By default, the merged \href{http://www.bibtex.org/}{BibTeX} file is
written to \texttt{merged\_first.bib} if the first
\href{http://www.bibtex.org/}{BibTeX} file is called \texttt{first.bib}.
Use \texttt{-\/-output} to write to a different filename, or
\texttt{-\/-overwrite} to overwrite the first
\href{http://www.bibtex.org/}{BibTeX} file, which will be backed up with
a \texttt{.bak} extension.

\begin{Verbatim}[breaklines=true,fontsize=\small]
bibupdate --merge first.bib second.bib --output combined.bib
bibupdate --merge first.bib second.bib -t paper.tex --output combined.bib
\end{Verbatim}

Use \texttt{-t}/\texttt{-\/-texfile} to update unambiguous citations in
associated \href{https://latex-project.org/}{LaTeX} files, which are
backed up with \texttt{.bak} extensions.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-t,\ -\/-texfile\ FILE.tex\ {[}FILE.tex\ ...{]}}}{-t, -\/-texfile FILE.tex {[}FILE.tex ...{]}}}\label{-t---texfile-filetex-filetex-}

\begin{BibUpdateOptionDescription}

Update citation keys in the listed
\href{https://latex-project.org/}{LaTeX} files when cleaning duplicate
entries

This option requires \texttt{-\/-merge}, \texttt{-\/-deduplicate},
\texttt{-\/-remove-duplicate-papers} or
\texttt{-\/-rename-duplicate-keys}. The \texttt{.tex} and \texttt{.bib}
extensions distinguish the TeX files from the bibliography and optional
output file, for example:

\begin{Verbatim}[breaklines=true,fontsize=\small]
bibupdate --deduplicate -t chapter.tex appendix.tex papers.bib
\end{Verbatim}

Only unambiguous citation key mappings are applied to the
\href{https://latex-project.org/}{LaTeX} files. If different papers
share a key, citations of that key in the
\href{https://latex-project.org/}{LaTeX} files are left unchanged and a
warning is printed. The later papers are given new unique keys in the
merged \href{http://www.bibtex.org/}{BibTeX} file.

Standard literal citation commands such as
\texttt{\textbackslash{}cite}, \texttt{\textbackslash{}citep},
\texttt{\textbackslash{}nocite}, \texttt{\textbackslash{}parencite} and
\texttt{\textbackslash{}textcites} are supported, including optional
notes and comma-separated key lists. Comments, verbatim text and other
commands are preserved. Custom citation macros are not expanded, and
included files are only processed if explicitly listed.

Before changing a TeX file, its original contents are saved with a
\texttt{.bak} extension, for example \texttt{chapter.tex.bak}. Unchanged
files are not rewritten or backed up. Existing backups of changed files
are replaced.

\end{BibUpdateOptionDescription}

\subsubsection*{Output and formatting}\label{output-and-formatting}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-\/-output\ FILE.bib}}{-\/-output FILE.bib}}\label{--output-filebib}

\begin{BibUpdateOptionDescription}

Write the bibliography to the specified file

Use this option to specify the name of the new
\href{http://www.bibtex.org/}{BibTeX} output file. An existing non-empty
output file is first backed up with a \texttt{.bak} extension. This
option cannot be combined with \texttt{-\/-overwrite}, or with an output
file given as a second positional argument.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-o,\ -\/-overwrite}}{-o, -\/-overwrite}}\label{-o---overwrite}

\begin{BibUpdateOptionDescription}

Overwrite the existing \href{http://www.bibtex.org/}{BibTeX} file with
the updated version. The original file is first backed up with a
\texttt{.bak} extension. This option cannot be combined with
\texttt{-\/-output}.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-i\ FIELDS,\ -\/-ignored-fields=FIELDS}}{-i FIELDS, -\/-ignored-fields=FIELDS}}\label{-i-fields---ignored-fieldsfields}

\begin{BibUpdateOptionDescription}

A space-separated list of \href{http://www.bibtex.org/}{BibTeX} fields
to omit when writing the updated \href{http://www.bibtex.org/}{BibTeX}
file

By default \href{https://github.com/AndrewMathas/BibUpdate}{bibupdate}
removes the following fields from each
\href{http://www.bibtex.org/}{BibTeX} entry:

\begin{itemize}
\tightlist
\item
  \texttt{coden}
\item
  \texttt{mrreviewer}
\end{itemize}

The \texttt{-i} option replaces this default list. Repeated \texttt{-i}
options are combined; field names are case-insensitive and separated by
spaces. An empty string keeps every field:

\begin{Verbatim}[breaklines=true,fontsize=\small]
bibupdate -i "coden fjournal" file.bib   # ignore coden and fjournal
bibupdate -i coden -i fjournal file.bib  # ignore coden and fjournal
bibupdate -i "" file.bib                 # do not ignore any fields
\end{Verbatim}

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-k,\ -\/-keep-fonts}}{-k, -\/-keep-fonts}}\label{-k---keep-fonts}

\begin{BibUpdateOptionDescription}

Use \texttt{-k} to retain legacy LaTeX font names in titles. By default,
the following font substitutions are automatically applied:

\begin{itemize}
\tightlist
\item
  \texttt{\textbackslash{}Bbb\ X} -\/-\textgreater{}
  \texttt{\textbackslash{}mathbb\{X\}}
\item
  \texttt{\textbackslash{}scr\ X} -\/-\textgreater{}
  \texttt{\textbackslash{}mathcal\{X\}}
\item
  \texttt{\textbackslash{}germ\ X} -\/-\textgreater{}
  \texttt{\textbackslash{}mathfrak\{X\}}
\end{itemize}

This applies both to input titles and to titles retrieved from AMS.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-w\ LEN,\ -\/-wrap\ LEN}}{-w LEN, -\/-wrap LEN}}\label{-w-len---wrap-len}

\begin{BibUpdateOptionDescription}

Wrap \href{http://www.bibtex.org/}{BibTeX} fields to specified width

By default, lines are not wrapped (a wrap length of \texttt{0}). A
positive wrap length \texttt{LEN} wraps each field value to that width,
with a tab before continuation lines.

\end{BibUpdateOptionDescription}

\subsubsection*{Reports and logging}\label{reports-and-logging}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-q,\ -\/-quiet}}{-q, -\/-quiet}}\label{-q---quiet}

\begin{BibUpdateOptionDescription}

Print fewer messages

By default, \href{https://github.com/AndrewMathas/BibUpdate}{bibupdate}
prints a compact reference for each paper that is updated, and a warning
for each paper for which the AMS lookup fails. With \texttt{-q} (or
\texttt{-\/-quiet}) only a one-line message is printed for updated
papers, together with the warnings for failed lookups. With \texttt{-qq}
only errors are printed. Failed lookups are printed in red when the
output is a terminal.

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-l\ LOG,\ -\/-log\ LOG}}{-l LOG, -\/-log LOG}}\label{-l-log---log-log}

\begin{BibUpdateOptionDescription}

Log output to file (defaults to stdout)

By default, reports and warnings go to standard output. Use \texttt{-l}
to write them to a file. Existing log files are overwritten. Fatal
errors are always printed to standard error.

\end{BibUpdateOptionDescription}

\subsubsection*{Help and version}\label{help-and-version}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-h,\ -\/-help}}{-h, -\/-help}}\label{-h---help}

\begin{BibUpdateOptionDescription}

Print a short list of command-line options

\end{BibUpdateOptionDescription}

\BibUpdateOptionHeading*{\texorpdfstring{\texttt{-H,\ -\/-Help}}{-H, -\/-Help}}\label{-h---help-1}

\begin{BibUpdateOptionDescription}

Print the full-help message

\end{BibUpdateOptionDescription}

\subsection*{Known issues}\label{known-issues}

\begin{itemize}
\tightlist
\item
  \textbf{BibTeX syntax:} the parser uses regular expressions rather
  than a full BibTeX grammar. Use brace-delimited entries with one field
  per line and braced values or simple words. Multiple fields on one
  line, quoted values, \texttt{\#} concatenation, string-macro
  expansion, and fields containing \texttt{@} or \texttt{=\{...\}} can
  be misread or omitted. Inspect the output carefully when using these
  forms. Duplicate listing and cleanup use a source scanner that
  preserves quoted and nested values, comments and macros; macros are
  not expanded for duplicate matching.
\item
  \textbf{Title matching:} capitalization braces and apostrophes are
  removed before searching and comparing. Mathematics is also removed,
  which can make distinct titles look similar. TeX commands and accents
  are not fully decoded, so equivalent spellings can still fail to
  match. A unique fuzzy title match is a heuristic, not a guarantee that
  a paper has been correctly identified.
\item
  \textbf{Author names:}
  \href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
  uses only the first author\textquotesingle s surname. A compound
  surname is preserved in \texttt{surname,\ given\ names} form; without
  a comma, only the last word is used. Accents, name particles and
  alternative spellings can therefore affect searches.
\item
  \textbf{Page numbers:} numeric ranges and single numeric pages are
  supported. Article identifiers and prefixed page numbers are not
  handled reliably. When only non-numeric page numbers are given, the
  title is used instead. For non-book entries the year is then omitted
  from the query.
\item
  \textbf{Ambiguous or missing results:} an AMS entry is updated only
  when there is a unique match. \href{http://www.bibtex.org/}{BibTeX}
  entries are not changed when no matches, or multiple matches, are
  found. Entries without a usable title are more likely to receive an
  incorrect match. By default, skipped entries, such as those with an
  existing \texttt{mrnumber}, are never changed.
\item
  \textbf{arXiv searches:} searches use significant title words and
  examine at most ten results. Titles dominated by mathematics or short
  words are more likely to receive false matches. As with
  \href{https://mathscinet.ams.org/mathscinet/freetools/mrlookup}{mrlookup}
  searches, the \href{http://arxiv.org/}{arXiv} fields for a paper are
  updated only if there is a unique match.
\item
  \textbf{Network services:} connections can fail, time out or return
  unexpected data. Requests use a 30-second timeout. Connection errors
  and timeouts produce warnings, and processing continues. A missed
  lookup does not prove that the paper is absent from the database.
\end{itemize}
% END GENERATED BIBUPDATE HELP

\Needspace{8\baselineskip}
\subsection*{Feature requests and bug reports}

  Please make any feature requests and bug reports on the \BibUpdate github
  page:
  \begin{center}
    \href{\BibUpdateIni{repository}/issues}{\texttt{\BibUpdateIni{repository}/issues}}.
  \end{center}
  Please provide as much detail as possible when submitting requests.

  Bug reports must be accompanied by a \textit{minimal working
  example}, which is a minimal \hologo{BibTeX} entry that demonstrates the
  problem.

% BEGIN GENERATED BIBUPDATE LICENCE
\subsection*{Licence}\label{licence}

Andrew Mathas

GNU General Public License, Version 3, 29 June 2007

\href{https://github.com/AndrewMathas/BibUpdate}{bibupdate} Version
2.1.0. Copyright (C) 2012-2026

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License
(\href{http://www.gnu.org/licenses/gpl.html}{GPL}) as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
% END GENERATED BIBUPDATE LICENCE

\end{document}
