在编译我的 LaTeX 文档时,我在一开始(第一行)就遇到了这个错误,错误是file ended while scanning use of \xdblarg
。以下是我的代码:
\documentclass[11pt,a4,2side]{report}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\onehalfspacing
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{arial}\usepackage{authblk} % for affiliation
\usepackage{graphicx} % for pictures
\usepackage{amsmath, amssymb, amsfonts} % for maths mode
\usepackage{siunitx} % This helps to write units such as angstrom, micrometer, etc.
\usepackage{nicefrac} % for nice fraction
\usepackage{subfig}
\usepackage{sidecap}
\usepackage{mhchem} % for molecular formulae as in chemistry.
\usepackage[font=small]{caption} % for bold font caption
\usepackage{enumitem} % package for creating lists
\usepackage{color} % for using colour
\usepackage{hyperref} % for labeling and cross-referencing in texts which is
\usepackage{refstyle}
\usepackage[square, super]{natbib} % for the bibliography\reference citation number as a supescript in square brackets.
\usepackage[nottoc]{tocbibind} % This helps to include the References(Bibliography) in the table of contents if it isn't
% already included there.
\usepackage[titletoc]{appendix} % This helps to include the Appendices in
\begin{document}
所以错误仅指向第 1 行。有人能帮我解决这个问题吗?谢谢
答案1
我发现这会导致“文件在扫描@xdblarg 的使用时结束”错误:
\subsubsection{这是编号子节的标题]
注意右端的方括号,应该是花括号。我认为任何以错误括号结尾的命令都可能导致此错误。
我通过在每一页中输入“\end{document}”来找到它,直到找到导致错误的页面,并将注意力集中在该页面上。