我的问题是我无法在文档中加载“cals 包”。我尝试在另一个单独的文档中测试此包,并且运行正常。我猜想有命令与此包发生冲突,所以我无法加载 cals 包。错误显示:
cals.sty error Command \thead already defined. \cals@thead@tokens}
我注释了 cals 包,以便可以编译它,并假设当我取消注释(包括)cals 包并且它顺利运行而没有错误时,问题将得到解决。我没有提供整个文档,但这里是我使用的所有包和前言,因此您可以告诉我哪个包或命令导致 cals 包加载失败以及如何解决它。请帮帮我。
\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{pgf, tikz}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[titles]{tocloft}
\usepackage{tocbibind}
\usepackage{indentfirst}
\usepackage{etoolbox}
\usepackage[none]{hyphenat}
\sloppy
\usepackage{times}
\usepackage{enumitem}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{array}
\usepackage[column=O]{cellspace}
\usepackage{caption}
\usepackage{afterpage}
\usepackage{mathtools}
\usepackage{longtable}
\usepackage{lipsum}
\usepackage{lscape}
\usepackage{makecell}
\usepackage{booktabs}
\usepackage{ragged2e}
\usepackage{natbib}
\usepackage[depth=2]{bookmark}
\usepackage{hyperref}
\usepackage{multirow}
\hypersetup{hidelinks}
\usepackage{tabularx}
\usepackage{textcomp}
%\usepackage{cals}
%%%%%%%%%%%%%%%%%%%%5 BAD BOXES %%%%%%%%%%%%%%%%%%%%%%%%%
\hfuzz=60pt
\hbadness=10000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newlist{ColEnum}{enumerate}{1}
\setlist[ColEnum,1]{label = \arabic*), left = 0pt, nosep,
before= {\begin{minipage}[t]{\hsize}\RaggedRight},
after = {\end{minipage}}}
\newcolumntype{P}[1]{>{\endgraf\vspace*{-\baselineskip}}p{#1}}
\newlist{tabitem}{itemize}{1}
\setlist[tabitem]{label=\textbullet, noitemsep,leftmargin=*,topsep=0pt,partopsep=0pt, nosep, before=\begin{minipage}[t]{\hsize}, after=\end{minipage}}
\DeclareMathOperator{\Res}{Res}
\numberwithin{equation}{section}
\setlength{\cellspacetoplimit}{5pt}
\setlength{\cellspacebottomlimit}{4pt}
\setlength\bibhang{25pt}
\setlength{\headheight}{14.5pt}
\theoremstyle{plain}
\newtheorem{thm}{Teorema}[section]
\newtheorem{cl}{Corollary}[section]
\newtheorem{lm}{Lemma}[section]
\theoremstyle{definition}
\newtheorem{defn}{Definisi}[section]
\newtheorem{exmp}{Contoh}
\renewcommand{\proofname}{\rm\bf{Bukti}}
\renewcommand\tablename{Tabel}
\renewcommand\figurename{Gambar}
\patchcmd{\section}{\bfseries}{\bfseries\boldmath}{}{}
\setlength{\cftbeforesecskip}{10pt}
\setlength{\cftbeforesubsecskip}{10pt}
\fancyhf{}
\cfoot{\thepage}
\linespread{1.5}
\pagestyle{plain}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftdotsep}{1}
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand{\cftchapfont}{\bfseries}
\renewcommand{\cftsecfont}{\bfseries}
\renewcommand{\cftchappagefont}{}
\titleformat{\chapter}[block]
{\normalfont\bfseries\centering}
{}{0pt}{}
\titleformat{\section}
{\normalfont\bfseries}
{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\bfseries}
{\thesubsection}{1em}{}
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
\titlespacing*{\section}{0pt}{0pt}{0pt}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\listtablename}{DAFTAR TABEL}
\renewcommand{\listfigurename}{DAFTAR GAMBAR}
\newcommand\dd{\mathop{}\!\mathrm{d}}
\setlength\parindent{1.25cm}
\addtocontents{toc}{~\hfill{Halaman}\par}
\addtocontents{lot}{~\hfill{Halaman}\par}
\addtocontents{lof}{~\hfill{Halaman}\par}
\addtocontents{app}{~\hfill{Halaman}\par}
\makeatletter
\def\ttl@mkchap@i#1#2#3#4#5#6#7{%
\ttl@assign\@tempskipa#3\relax\beforetitleunit
\vspace{\@tempskipa}%<<<<<< REMOVE THE * AFTER \vspace
\global\@afterindenttrue
\ifcase#5 \global\@afterindentfalse\fi
\ttl@assign\@tempskipb#4\relax\aftertitleunit
\ttl@topmode{\@tempskipb}{%
\ttl@select{#6}{#1}{#2}{#7}}%
\ttl@finmarks
\@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}}
\makeatother
\newcommand{\listappendixname}{DAFTAR LAMPIRAN}
\newlistof{appendix}{app}{\listappendixname}
\setcounter{appdepth}{2}
\renewcommand{\theappendix}{Lampiran\space\arabic{appendix}}
\renewcommand{\cftappendixpresnum}{}
\setlength{\cftbeforeappendixskip}{0pt}
\setlength{\cftappendixnumwidth}{.9in}
\newlistentry[appendix]{subappendix}{app}{1}
\renewcommand{\thesubappendix}{\theappendix.\arabic{subappendix}}
\renewcommand{\cftsubappendixpresnum}{Appendix\space}
\setlength{\cftsubappendixnumwidth}{1in}
\setlength{\cftsubappendixindent}{0em}
\renewcommand{\listofappendix}{\begingroup
\tocfile{\listappendixname}{app}
\endgroup}
\newcommand{\myappendix}[1]{%
\refstepcounter{appendix}%
\section*{\theappendix\space #1}%
\addcontentsline{app}{appendix}{\protect\numberline{\theappendix}#1}%
\par
}
\newcommand{\subappendix}[1]{%
\refstepcounter{subappendix}%
\subsection*{\thesubappendix\space #1}%
\addcontentsline{app}{subappendix}{\protect\numberline{\thesubappendix}#1}%
}
\begin{document}
\clearpage
\thispagestyle{empty}
\frontmatter %
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\bibname}{DAFTAR PUSTAKA}
\begin{spacing}{0.1}
\tableofcontents
\end{spacing}
\begin{spacing}{1.5}
\listoffigures
\listoftables
\listofappendix
\end{spacing}
\mainmatter
\pagestyle{fancyplain}
\fancyhf{}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\backmatter
\bibliography{dafpus}
\bibliographystyle{unejstyle}
\nocite{*}
\end{document}