derric / cleanthesis

Clean Thesis is a clean, simple, and elegant LaTeX style (or template) for thesis documents.
http://cleanthesis.der-ric.de/
902 stars 116 forks source link

Incompatibility with mhchem package #123

Closed a-seyler closed 4 years ago

a-seyler commented 4 years ago

Hi, I am experiencing a incompatibility between cleanthesis and the mhchem package. If I include the mhchem package into my document, compiling fails and I get an error message regarding an undefined control sequence on the first \section{} command.

Minimal (not-)working example:

\usepackage{cleanthesis}
\usepackage[version=4]{mhchem}

\begin{document}

\section{Title of section}
bla bla bla...

\end{document}

(needs the bib-refs.bib from the zip-folder) or just including \usepackage[version=4]{mhchem} in the provided example my-thesis.tex.

The complete error message is:

ERROR: Undefined control sequence.

--- TeX said ---
\in@ #1#2->\begingroup \def \in@@ 
                                  ##1#1{}\toks@ \expandafter {\in@@ #2{}{}#1...l.8 \section{Title of section}

--- HELP ---
TeX encountered an unknown command name. You probably misspelled the
name. If this message occurs when a LaTeX command is being processed,
the command is probably in the wrong place---for example, the error
can be produced by an \item command that's not inside a list-making
environment. The error can also be caused by a missing \documentclass
command.
a-seyler commented 4 years ago

The following code from cleanthesis.sty causes the error:

\newlength{\lensectionnumber}
\renewcommand{\sectionmark}[1]{%
    \markright{%
        \ctfontfootertext
        \setlength{\lensectionnumber}{0em}
        \settowidth{\lensectionnumber}{\textbf{\thesection}\quad}
        \protect\begin{minipage}[t]{.72\textwidth}%
            {\ }% bad hack to prevent a wrong baseline for the minipage
            \protect\raggedleft%
            \hangindent=\lensectionnumber%
            {\color{ctcolorfootermark}\textbf{\thesection}}%
            \quad%
            #1%
        \protect\end{minipage}%
    }%
}

If I comment these lines out, the document compiles fine. Seems to be the same problem as in issue #101

derric commented 4 years ago

This issue seems to be fixed in cleanthesis version 0.4.1 (c5b2c2683166168980ff9f8e5649c052528a73a1), see release. Can you confirm that?

a-seyler commented 4 years ago

Yes, with the new version the problem is fixed.