我想使用这里给出的模板 sharifthesis关联创建我的论文(请参阅最小示例)。但它给出了 2 个错误:
line 1: Missing number, treated as zero. ...ons and labels\relax }}{1}{table.caption.2}
line 1: Illegal unit of measure (pt inserted). ...ons and labels\relax }}{1}{table.caption.2}
错误指向的文件test.lot
如下:
\contentsline {table}{\numberline {\relax 0.1}{\ignorespaces Table to test captions and labels\relax }}{1}{table.caption.2}%
最小的例子如下:
\documentclass[PhDThesis,twoside]{sharifthesis2}
\begin{document}
\listoftables
\begin{table}[h!]
\centering
\begin{tabular}{||c c c c||}
\hline
Col1 & Col2 & Col2 & Col3 \\
\hline\hline
1 & 6 & 87837 & 787 \\
2 & 7 & 78 & 5415 \\
\hline
\end{tabular}
\caption{Table to test captions and labels}
\end{table}
\end{document}
我不知道问题的根源在哪里。我两年前在另一台电脑上使用过这个模板,一切都很好。
编辑:我还提供了重现错误的模板的最小版本(sharifthesis2.cls
):
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sharifthesis2}[2017/08/03 Sharif Thesis v1.5.1]
\DeclareOption{PhDThesis}{\def\@fordegree{test}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions
\LoadClass[12pt,a4paper,BCOR=.7cm,headsepline,bibliography=totoc]{scrbook}
\RequirePackage{xepersian}
\settextfont[Scale=1]{Arial}
答案1
尝试这个:
\documentclass[PhDThesis,twoside]{sharifthesis2}
\usepackage{xpatch}
\makeatletter
\xpatchcmd\scr@dte@tocline
{\@nameuse{scr@tso@#1@pagenumberbox}}
{\expandafter\let\expandafter\scr@dte@pagenumberwidth
\csname scr@tso@#1@pagenumberwidth\endcsname
\@nameuse{scr@tso@#1@pagenumberbox}}
{}{\fail}
\makeatother
\begin{document}
\listoftables
\begin{table}[h!]
\centering
\begin{tabular}{||c c c c||}
\hline
Col1 & Col2 & Col2 & Col3 \\
\hline\hline
1 & 6 & 87837 & 787 \\
2 & 7 & 78 & 5415 \\
\hline
\end{tabular}
\caption{Table to test captions and labels}
\end{table}
\end{document}
这是一个已知的软件包问题bidi
,已在https://github.com/persiantex/bidi/issues/7。我也回复了这个问题。