3

I'm using classicthesis.sty to write my master's thesis. In this style the tocloft is set up with the subfig package, which is now deprecated, so i'm using instead the subcaption package, the problem is that they are incompatible and the classicthesis.sty has a lot of options with subfig.

I need some help to solve the compatibility issues. The table of contents is not getting compiled and neither are the references to bibliography or to figures in the document. I'm using Kile in Ubuntu and just beginning to learn Latex.

Here is some of my code:

\documentclass{scrreprt}

% \input{classicthesis-config}
% In this input I have some of the following:
\PassOptionsToPackage{eulerchapternumbers,listings,drafting,
             pdfspacing,
             subfig,
             beramono,eulermath,parts}{classicthesis}

\usepackage{ifthen}
\newboolean{enable-backrefs} 
\setboolean{enable-backrefs}{false}

\newcounter{dummy}

\PassOptionsToPackage{spanish,es-lcroman}{babel}
\usepackage{babel}                  
\PassOptionsToPackage{utf8}{inputenc} 
\usepackage{inputenc} 

\usepackage{caption}
\usepackage{subcaption}
 \captionsetup{format=hang,font=small}
\usepackage{float} 
%\usepackage{subfig} 

\usepackage{classicthesis} 

\PassOptionsToPackage{hyperfootnotes=false,pdfpagelabels}{hyperref} 
    \usepackage{hyperref}

\pdfcompresslevel=9
\pdfadjustspacing=1 

\PassOptionsToPackage{pdftex}{graphicx}
    \usepackage{graphicx} 

\ifthenelse{\boolean{enable-backrefs}}%
{%
    \PassOptionsToPackage{hyperpageref}{backref}
    \usepackage{backref} 
       \renewcommand{\backreftwosep}{ and~} 
       \renewcommand{\backreflastsep}{, and~} 
       \renewcommand*{\backref}[1]{}  
       \renewcommand*{\backrefalt}[4]{
          \ifcase #1 %
             \backrefnotcitedstring%
          \or%
             \backrefcitedsinglestring{#2}%
          \else%
             \backrefcitedmultistring{#2}%
          \fi}%
}{\relax}    

\hypersetup{%
colorlinks=true, linktocpage=true, pdfstartpage=3, pdfstartview=FitV,%
breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%
plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%
hypertexnames=true, pdfhighlight=/O,
urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, 
pdfsubject={},%
pdfkeywords={},%
pdfcreator={pdfLaTeX},%
}   

\makeatletter
\@ifpackageloaded{babel}%
    {%
   \addto\extrasspanish{%
                \renewcommand*{\figureautorefname}{Figura}%
                \renewcommand*{\tableautorefname}{Cuadro}%
                \renewcommand*{\chapterautorefname}{Capítulo}%
                \renewcommand*{\sectionautorefname}{Sección}%
                \renewcommand*{\subsectionautorefname}{Sección}%
                \renewcommand*{\subsubsectionautorefname}{Sección}%     
          }%

            \providecommand{\subfigureautorefname}{\figureautorefname}%             
}{\relax}
\makeatother

\usepackage{lipsum}
\usepackage[demo]{graphicx}

\begin{document}

\frenchspacing
\raggedbottom
\selectlanguage{spanish} 
\pagenumbering{roman}
\pagestyle{plain}

\pagestyle{scrheadings}

% Table of Contents
\refstepcounter{dummy}
\pdfbookmark[1]{\contentsname}{tableofcontents}
\setcounter{tocdepth}{2} 
\setcounter{secnumdepth}{3} 
\manualmark
\markboth{\spacedlowsmallcaps{\contentsname}}        {\spacedlowsmallcaps{\contentsname}}
\tableofcontents 
\automark[section]{chapter}
\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}}

% List of Figures and Tables
\clearpage

\begingroup 
\let\clearpage\relax
\let\cleardoublepage\relax
\let\cleardoublepage\relax
% List of Figures
\refstepcounter{dummy}
\addcontentsline{toc}{chapter}{\listfigurename}
\pdfbookmark[1]{\listfigurename}{lof}
\listoffigures
\vspace*{8ex}

% List of Tables
\refstepcounter{dummy}
\addcontentsline{toc}{chapter}{\listtablename}
\pdfbookmark[1]{\listtablename}{lot}
\listoftables
\vspace*{8ex}
\endgroup

\pagenumbering{arabic}

\chapter{Dummy text} % 

\section{Lorem}

\lipsum[1-2] 
Foo bar baz (figure ~\ref{fig:ex1}).

\begin{figure}[H]
\begin{center}
\includegraphics{graphs/dataset17b.pdf}
\end{center}
\caption{Example 1.}
\label{fig:ex1}
\end{figure}

\end{document}

Thanks.

  • 1
    Welcome to TeX.SX! It's not really clear how this question can be answered at the moment. Can you put together a minimal working example (MWE) that actually shows what sort of incompatibility you need help resolving? Also, why not just use subfig? It's actually not deprecated. subfigure is the package that is deprecated. The only problem with subfig arises if you need to use hyperref, too. – Adam Liter Mar 23 '15 at 1:14
  • @AdamLiter Thanks. I've uploaded an example that reproduces the problem (I'm sorry it's so long). And yes, I would like to use hyperref too. – Tina Mar 23 '15 at 2:27
  • @cfr Yes, classicthesis seems to be a pain. Could you recommend me something better? – Tina Mar 23 '15 at 2:29
  • @Tina Just use the KOMA class you've got and load the packages you need. That is, just drop classicthesis and tidy up your preamble so you can see what you are doing. – cfr Mar 23 '15 at 2:45
2

You have

\PassOptionsToPackage{eulerchapternumbers,listings,drafting,
             pdfspacing,
             subfig,
             beramono,eulermath,parts}{classicthesis}

\usepackage{classicthesis}

First, there is no reason to do this in the preamble for either this package or the others. Instead, just say

\usepackage[eulerchapternumbers,listings,drafting,
             pdfspacing,
             subfig,
             beramono,eulermath,parts]{classicthesis}

Second, the option subfig is an option requesting subfig. So if you don't want subfig, don't tell the package to load it:

\usepackage[eulerchapternumbers,listings,drafting,
             pdfspacing,
             beramono,eulermath,parts]{classicthesis}
  • Right, but this doesn't fix the table of contents nor the references within the text. The error message is: ./classicthesis.sty:428:Option clash for package tocloft.\newlength and There were undefined references. – Tina Mar 23 '15 at 2:54
  • @Tina Then you have another conflicting package or are passing tocloft incompatible options. Not loading subfig will avoid a conflict between subfig and subcaption. Obviously it will not fix further incompatibilities. For the references, you need to run any helper programmes (bibtex or biber and/or makeglossaries and/or whatever) and compile twice more. That warning is entirely normal. It just tells you further stuff needs doing. – cfr Mar 23 '15 at 18:05
  • @Tina You are loading graphicx twice, for example, and with a different set of options the second time. In general, your preamble is weird. Why all the conditional stuff? Why the \PassOptions... rather than \usepackage[].... Sorting your preamble out will likely make it a lot easier to diagnose any remaining problems. – cfr Mar 23 '15 at 18:08
  • Yes, there was some incompatible option with tocloft, that fixed the table of contents. Now, the references issue is not a problem with bibtex, I meant the references to labeled figures within the same document. I'm not sure about the conditional stuff, they come in an separate input file that allows to configure the classicthesis and that you have to load on the main file, I put it in the preamble of the example above just to show how it was structured because there might be some errors with it. – Tina Mar 24 '15 at 19:39
  • @Tina You need to compile twice for the cross-references to resolve correctly. – cfr Mar 24 '15 at 20:04

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.