VonbatenBach
VonbatenBach

Reputation: 21

BibTex: undefined control sequence. ...author} {\bibnamefont {#ref},\ }\href@noop

I have a problem with BibTex citations. I use the following setup: Vim + VimTex (latexmk) + revtex4-2 class + custom preamble. The problem occurs when I try to compile my main file master.tex, in which there is a bibliography forced to one column mode:

\onecolumngrid{
\bibliography{references}}

(Edit: I don't get the error without \onecolumngrid{}). My references.bib file looks as follows:

@misc{KGOF,
    author = {KGOF},
    title = {Zadania zawodów {I} stopnia {LV} {Olimpiady} {Fizycznej}},
    howpublished = {Dostępne na: \url{http://www.kgof.edu.pl/baza_zadan/files/LV-ID2.pdf} (\today)},
}

@misc{reg,
    author = {SciPy},
    title = {{Orthogonal} {Distance} {Regression}},
    howpublished = {Dostępne na: \url{https://docs.scipy.org/doc/scipy/reference/odr.html} (\today)},
}

The error mentioned in title occurs for each entry in my references:

 ./master.bbl:56 error: Undefined control sequence. ...uthor} {\bibnamefont {KGOF}},\ }\href@noop

Relevant lines in master.bbl read as:

\bibitem [{\citenamefont {KGOF}()}]{KGOF}%
  \BibitemOpen
  \bibfield  {author} {\bibinfo {author} {\bibnamefont {KGOF}},\ }\href@noop {}
  {\bibinfo {title} {Zadania zawodów {I} stopnia {LV} {Olimpiady}
  {Fizycznej}}},\ \bibinfo {howpublished} {Dostępne na:
  \url{http://www.kgof.edu.pl/baza_zadan/files/LV-ID2.pdf}
  (\today)}\BibitemShut {NoStop}%

I have no idea how to solve this error, nor what does it really mean. Help, please!

Edit: I provide the minimal code to reproduce the problem:

\documentclass[reprint,aps]{revtex4-2}

\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}


\begin{document}

\title{Test}

\maketitle

\cite{KGOF} and \cite{reg}

\onecolumngrid{
\bibliography{references}}

\end{document}

Best wishes, Szymon

PS. The main file master.tex compiles so that I get what I would expect, but I constantly get that compilation error.

Upvotes: 1

Views: 3079

Answers (1)

The syntax is wrong. \onecolumngrid is a switch and does not take an argument

\documentclass[reprint,aps]{revtex4-2}

\usepackage[T1]{fontenc}
\usepackage{dcolumn}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

\begin{document}

\title{Test}

\maketitle

\cite{KGOF} and \cite{reg}

\onecolumngrid
\bibliography{references}


\end{document}

Upvotes: 1

Related Questions