[Tex/LaTex] Undefined control sequence errors from biblatex

biblatexbibliographies

I keep getting "undefined control sequence" errors from biblatex when using \printbibliography at the end of the document.
These errors are related to special characters in the titles of some of the references, for example in \textgreek.

I have searched for a solution, but unfortunately, nothing I found so far did the trick.

I am using TeXStudio 2.12.6, all packages in MiKTeX are updated to the newest versions.

My very simple, minimal example document is:

\documentclass[11pt,a4paper]{article}

\usepackage{fullpage}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{lineno}
\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks = true,
        linkcolor = blue,
        urlcolor  = blue,
        citecolor = blue,
        anchorcolor = blue]{hyperref}
\usepackage{etoolbox}
\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}
\usepackage{authblk}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[section]{placeins}
\usepackage{amsmath}
\usepackage{textgreek}
\usepackage{siunitx}
\usepackage{float}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{rotating}
\usepackage[backend=biber,bibstyle=numeric,citestyle=numeric-comp,sorting=none]{biblatex}
\addbibresource{reference.bib}

\begin{document}

This reference \cite{Evans.2000} will cause an error.

\printbibliography[title={References},heading=bibnumbered]

\end{document}

The reference.bib file contains just this one reference:

@Article{Evans.2000,
  author     = {Evans, M.},
  title      = {Predicting times to low strain for a 1CrMoV rotor steel using a 6-\textgreek{j} projection technique},
  journal    = {Journal of Materials Science},
  year       = {2000},
  volume     = {35},
  number     = {12},
  pages      = {2937--2948},
  issn       = {00222461},
  doi        = {10.1023/A:1004770525118},
  pagination = {page},
}

The error then arises from the \textgreek{j} in the title:

! Undefined control sequence.
<argument> ... for a 1CrMoV rotor steel using a 6-\textgreek 
                                              {j} projection technique
l.42 ...aphy[title={References},heading=bibnumbered]

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Many thanks in advance!

Best Answer

\textgreek{j} needs greek-babel; the (minimized) example is

\begin{filecontents*}{\jobname.bib}
@Article{Evans.2000,
  author     = {Evans, M.},
  title      = {Predicting times to low strain for a 1CrMoV rotor 
                steel using a 6-\textgreek{j} projection technique},
  journal    = {Journal of Materials Science},
  year       = {2000},
  volume     = {35},
  number     = {12},
  pages      = {2937--2948},
  issn       = {00222461},
  doi        = {10.1023/A:1004770525118},
  pagination = {page},
}
\end{filecontents*}

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}

\usepackage{csquotes}
\usepackage[
  backend=biber,
  bibstyle=numeric,
  citestyle=numeric-comp,
  sorting=none
]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}

This reference \cite{Evans.2000} will cause an error.

\printbibliography[title={References},heading=bibnumbered]

\end{document}

enter image description here

Alternatively, you can use textgreek with some coercion, but it's probably easier to edit the entry to have

  title      = {Predicting times to low strain for a 1CrMoV rotor 
                steel using a 6-\texttheta\ projection technique},

Here's the example without such editing.

\begin{filecontents*}{\jobname.bib}
@Article{Evans.2000,
  author     = {Evans, M.},
  title      = {Predicting times to low strain for a 1CrMoV rotor 
                steel using a 6-\textgreek{j} projection technique},
  journal    = {Journal of Materials Science},
  year       = {2000},
  volume     = {35},
  number     = {12},
  pages      = {2937--2948},
  issn       = {00222461},
  doi        = {10.1023/A:1004770525118},
  pagination = {page},
}
\end{filecontents*}

\documentclass[11pt,a4paper]{article}

\usepackage{textgreek}

\usepackage{csquotes}
\usepackage[
  backend=biber,
  bibstyle=numeric,
  citestyle=numeric-comp,
  sorting=none
]{biblatex}

\addbibresource{\jobname.bib}

\newcommand{\textgreek}[1]{\csname sulzergreek#1\endcsname}
\newcommand{\sulzergreekj}{\texttheta}
% add all other needed letters

\begin{document}

This reference \cite{Evans.2000} will cause an error.

\printbibliography[title={References},heading=bibnumbered]

\end{document}

Notes

The filecontents* environment is used just to make the example self-contained.

In your long preamble there are some things to fix.

  • Remove \DeclareGraphicsExtensions: it's useless to define extensions such as .TIF, when TIFF support is missing for LaTeX

  • hyperref should be loaded last

  • latexsym is useless when you have amssymb.