在文档末尾使用 \printbibliography 时,biblatex 不断出现“未定义控制序列”错误。这些错误与某些参考文献标题中的特殊字符有关,例如 \textgreek。
我已经寻找过解决方案,但不幸的是,到目前为止我找到的任何方法都没有奏效。
我正在使用 TeXStudio 2.12.6,MiKTeX 中的所有软件包都已更新到最新版本。
我的非常简单、最小的示例文档是:
\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}
reference.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},
}
错误源于标题中的 \textgreek{j}:
! 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.
提前谢谢了!
答案1
\textgreek{j}
需求greek-babel
;(最小化的)示例是
\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}
或者,你可以使用textgreek
一些强制转换,但编辑条目以便拥有
title = {Predicting times to low strain for a 1CrMoV rotor
steel using a 6-\texttheta\ projection technique},
以下是未经此类编辑的示例。
\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}
笔记
该filecontents*
环境仅用于使示例自成一体。
在您的长篇序言中,有一些事情需要修复。
删除:当 LaTeX 缺少 TIFF 支持时,
\DeclareGraphicsExtensions
定义诸如 之类的扩展是没有意义的.TIF
hyperref
应该最后加载latexsym
是无用的,当你有amssymb
。