1

I'm wrestling with a custom document class which I'm required to use for my thesis:

https://github.com/sigchi/Document-Formats/blob/master/LaTeX/sigchi.cls

It disallows having a table of contents by default, but I managed to define a basic one with the help of this answer: https://tex.stackexchange.com/a/346018/19179

My next problem is styling the TOC entries. I'm trying to include the tocloft package so that I can do \renewcommand{\cftsecfont} etc, but it fails with

! Extra \fi.
\@cfttocfinish ...f@restonecol \twocolumn \fi \fi

There must be something in either the .cls or the custom tableofcontents definition which it doesn't like?

Here's the MWE:

\documentclass{sigchi}

\usepackage{tocloft}

% Redefine the table of contents because sigchi class is shit.
% https://tex.stackexchange.com/questions/346012/define-tableofcontents-in-document-class-that-doesnt-support-it?noredirect=1#comment849020_346012
\makeatletter
\newcommand{\contentsname}{\MakeUppercase{Contents}}
\renewcommand{\tableofcontents}{
    \section*{\contentsname}
      \@starttoc{toc}
    }

% sigchi.cls does \let\thepage\relax (don't ask!), so define it again
\newcommand{\thepage}{\arabic{page}}

\begin{document}

\tableofcontents

\section{First section}

\end{document}

The document compiles if either \tableofcontents or \usepackage{tocloft} is removed, but having both in there gives me the above error.

  • sigchi.cls is a bad, bad class ... – user31729 Dec 29 '16 at 8:48
  • 1
    Try \usepackage[titles]{tocloft} – user31729 Dec 29 '16 at 8:55
  • @ChristianHupfer That works! I'm able to modify the fonts just before my appendix listings, too. The only problem is that the line heights in my TOC are now very stretched... – Elise Dec 29 '16 at 9:06
  • 1
    It is a by-passing solution at the moment only. Most likely you have to change the \cftbeforeXskip values, where X stands for chapter or sec etc. (see page 9 of current tocloft manual, please) – user31729 Dec 29 '16 at 9:09
  • Small correction: It's chap, not chapter... – user31729 Dec 30 '16 at 12:36
2

The sigchi.cls does not really conform to a standard class and as such tocloft's sophisticated features can't take grip off the class definitions.

The best is to activate the titles option of tocloft to prevent strange class definitions.

Whether this will be allowed by potential editors is another issue ;-)

\documentclass{sigchi}


\usepackage[titles]{tocloft}

% Redefine the table of contents because sigchi class is ...
% http://tex.stackexchange.com/questions/346012/define-tableofcontents-in-document-class-that-doesnt-support-it?noredirect=1#comment849020_346012
\makeatletter
%\@cftnctoctrue
%\AtBeginDocument{%
\newcommand{\contentsname}{Contents}
\renewcommand{\tableofcontents}{%
    \section*{\contentsname
        \@mkboth{%
          \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
    \@starttoc{toc}%
    }
%}
\makeatother


% sigchi.cls does \let\thepage\relax (don't ask!), so define it again
\newcommand{\thepage}{\arabic{page}}

\begin{document}

\tableofcontents

\section{First section}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.