TransWikia.com

Can't load cals package

TeX - LaTeX Asked on March 16, 2021

Here my problem is i can’t load "cals package" on my document. I’ve tried to test this package in another separated document and it worked perfectly. I’m guessing that there are commands colliding with this package so i can’t load the cals package. The error said :
cals.sty error Command thead already defined. cals@thead@tokens}

I commented the cals package so it can be compiled and assuming the problem will be resolved if when i uncomment (include) the cals package and it goes well without errors. I’m not providing the whole document, but here is all of my packages and preamble that i used so you can tell me which package or command made the cals package fail lo load and how to solve it. Please help me.

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]{>{endgrafvspace*{-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}
setlengthbibhang{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}{rmbf{Bukti}}

renewcommandtablename{Tabel}
renewcommandfigurename{Gambar}



patchcmd{section}{bfseries}{bfseriesboldmath}{}{}
setlength{cftbeforesecskip}{10pt}
setlength{cftbeforesubsecskip}{10pt}

fancyhf{}
cfoot{thepage}
linespread{1.5}
pagestyle{plain}
renewcommand{cftchapleader}{cftdotfill{cftdotsep}}
renewcommand{cftdotsep}{1}
renewcommandcftchapdotsep{cftdotsep}
renewcommand{cftchapfont}{bfseries}
renewcommand{cftsecfont}{bfseries}
renewcommand{cftchappagefont}{}
titleformat{chapter}[block]
{normalfontbfseriescentering}
{}{0pt}{}
titleformat{section}
{normalfontbfseries}
{thesection}{1em}{}
titleformat{subsection}
{normalfontbfseries}
{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}
newcommanddd{mathop{}!mathrm{d}}

setlengthparindent{1.25cm} 

addtocontents{toc}{~hfill{Halaman}par}
addtocontents{lot}{~hfill{Halaman}par}
addtocontents{lof}{~hfill{Halaman}par}
addtocontents{app}{~hfill{Halaman}par}

makeatletter
defttl@mkchap@i#1#2#3#4#5#6#7{%
    ttl@assign@tempskipa#3relaxbeforetitleunit
    vspace{@tempskipa}%<<<<<< REMOVE THE * AFTER vspace
    global@afterindenttrue
    ifcase#5 global@afterindentfalsefi
    ttl@assign@tempskipb#4relaxaftertitleunit
    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}{Lampiranspacearabic{appendix}}
renewcommand{cftappendixpresnum}{}
setlength{cftbeforeappendixskip}{0pt}
setlength{cftappendixnumwidth}{.9in}
newlistentry[appendix]{subappendix}{app}{1}
renewcommand{thesubappendix}{theappendix.arabic{subappendix}}
renewcommand{cftsubappendixpresnum}{Appendixspace}
setlength{cftsubappendixnumwidth}{1in}
setlength{cftsubappendixindent}{0em}
renewcommand{listofappendix}{begingroup
    tocfile{listappendixname}{app}
    endgroup}

newcommand{myappendix}[1]{%
    refstepcounter{appendix}%
    section*{theappendixspace #1}%
    addcontentsline{app}{appendix}{protectnumberline{theappendix}#1}%
    par
}

newcommand{subappendix}[1]{%
    refstepcounter{subappendix}%
    subsection*{thesubappendixspace #1}%
    addcontentsline{app}{subappendix}{protectnumberline{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}

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP