我在 Windows(texstudio) 和 Overleaf 中使用了同一个 Latex 文档,没有任何错误。现在在 ubuntu Texstudio 中,我得到了这三个错误。
Undefined control sequence. {\blx@err@patch{\addtocontents}}
Argument of \addtocontents has an extra }. {\blx@err@patch{\addtocontents}}
Paragraph ended before \addtocontents was complete. {\blx@err@patch{\addtocontents}}
\documentclass[12pt,a4paper,twoside,headsepline,captions=tableheading,toc=bibliography,openany,chapterprefix]{scrbook}
\usepackage{etoolbox} \usepackage{interval} \usepackage{hhline}
\usepackage{placeins} \usepackage{array}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\usepackage{placeins} \usepackage{pdfpages} \usepackage{siunitx}
\usepackage[export]{adjustbox} \usepackage{graphicx}
\usepackage{enumitem} \usepackage{booktabs}
\input{settings/packages} \input{settings/hyphenations}
\input{settings/commands} \input{settings/colordef}
\input{settings/tikzdef} \input{settings/tikzexternalize}
\input{settings/theorems}
\graphicspath{{./images/}} \setlength{\parindent}{0cm}
\newtoggle{lang_eng} \settoggle{lang_eng}{true} \newtoggle{enable_svg}
\settoggle{enable_svg}{false}
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside
\ifodd\c@page\else \hbox{} \vspace*{\fill} \begin{center}
\begin{quote} {\textit{This page intentionally left blank}}
\end{quote} \end{center} \vspace{\fill} \thispagestyle{empty}
\newpage \if@twocolumn\hbox{}\newpage\fi\fi\fi} \makeatother
\begin{document} \pagenumbering{alph} \pagestyle{empty}
\let\chapterpagestyleorig\chapterpagestyle
\renewcommand*{\chapterpagestyle}{empty}
\newcommand{\SubItem}[1]{\setlength\itemindent{15pt} \item[-] #1}
\input{content/titlepage_english} \maketitle
\input{content/dedication} \cleardoublepage
\input{content/acknowledgement} \cleardoublepage
\input{content/abstract} \cleardoublepage
\setcounter{page}{1} \pagestyle{headings} \pagenumbering{roman}
\renewcommand*{\chapterpagestyle}{\chapterpagestyleorig}
\tableofcontents \newpage
\input{content/nomenclature} \cleardoublepage
\pagenumbering{arabic} \pagestyle{headings}
\input{content/chapter1_english} \cleardoublepage
\input{content/chapter2_english} \cleardoublepage
\input{content/chapter3_english} \cleardoublepage
\input{content/chapter4_english} \cleardoublepage
\input{content/chapter5_english} \cleardoublepage
\input{content/chapter6_english} \cleardoublepage
\printbibliography \cleardoublepage \listoffigures \cleardoublepage
\listoftables \cleardoublepage
\input{content/appendix}
\end{document}
我已经将 biblatex 包包含在文档中,因此我不确定为什么会出现此错误。我怀疑这可能与 \blx@err@patch 命令有关,但我找不到有关它的任何信息。
这是针对上述问题的接受 MWE,其中包含包和组件。
\documentclass{article}
\usepackage{xcolor}
\usepackage{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}
\usepackage[sc]{mathpazo}
\linespread{1.05}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{enumitem}
\usepackage{scrhack}
\usepackage[activate={true,nocompatibility},tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\usepackage{textcomp}
\usepackage{newclude}
\usepackage{twoopt}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage[english]{babel}
\usepackage[babel,autostyle]{csquotes}
\usepackage{ifpdf}
\usepackage{ifplatform}
\usepackage{newclude}
\usepackage[normal,small]{caption}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{float}
\usepackage{subcaption}
\usepackage{color}
\usepackage{colortbl}
\usepackage{sidecap}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage{import}
\usepackage{tikz,pgfplots}
\usepackage{grffile}
\usepackage{currfile}
\usepackage{pdfpages}
\usepackage[chapter, ruled]{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{epstopdf}
\usepackage{psfrag}
\usepackage[noprefix,intoc,english]{nomencl}
\setlength{\nomlabelwidth}{.25\hsize}
\setlength{\nomitemsep}{-\parsep}
\makenomenclature
\usepackage[autolang=hyphen,style=authoryear-comp,giveninits=true,uniquename=init,isbn=false,doi=false,dashed=false,backend=bibtex,maxnames=2,minnames=1,maxbibnames=99]{biblatex}
\setlength{\bibitemsep}{0.5\baselineskip}
\addbibresource{thesis.bib}
\usepackage{xpatch}
\xpretobibmacro{author}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{author}{\egroup}{}{}
\xpretobibmacro{bbx:editor}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{bbx:editor}{\egroup}{}{}
\renewcommand*{\labelnamepunct}{\mkbibbold{\addcolon\space}}
\usepackage{settings/bibspacing}
\setlength{\bibspacing}{\baselineskip}
\usepackage{comment}
\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks=false,hidelinks,pdfpagelayout=TwoPageRight]{hyperref}
\ifpdf
\else
\usepackage[anythingbreaks]{breakurl}
\fi
\begin{document}
\section{Introduction}
This is the introduction section.
\end{document}