1

When using thmtools to define my own theorem style as follows:

\documentclass{book}

\usepackage{amsthm}
\usepackage{mdframed}
\usepackage{thmtools}


\definecolor{thmBgColor}{RGB}{250,250,250}
\definecolor{thmLnColor}{RGB}{200,200,200}
\definecolor{davysgrey}{rgb}{0.33, 0.33, 0.33}

\declaretheoremstyle[
    headfont=\color{davysgrey}\sffamily\bfseries\lsstyle,
    within=chapter,  
    headpunct={},
    postheadspace=2mm, 
    notefont=\color{davysgrey}\mdseries, 
    notebraces = {\quad}{},
    spaceabove = 8pt,
    spacebelow = 16pt,
    bodyfont=\color{black}\normalfont\itshape,
    mdframed={
        linecolor=thmLnColor,
        backgroundcolor=thmBgColor,
        linewidth=1pt,
        topline=true,
        bottomline=true,
        rightline=false,
        leftline=false,
        outerlinewidth=2pt,
        roundcorner=0pt,
        innertopmargin=4pt,
        innerbottommargin=4pt,
        innerrightmargin=3pt,
        innerleftmargin=3pt,
        skipabove=\topskip,
        skipbelow=\topskip,
        nobreak=true} 
    ]{mydefstyle}

\declaretheorem[
    style=mydefstyle,
    name=Definition,
    numberwithin=chapter
]{mydef}



\begin{document}

\begin{mydef}[this is my title]
content
\end{mydef}


\end{document}

With pdflatex I got this error in the log:

Package mdframed Info: mdframed works in twoside mode on input line 51.
Package mdframed Info: mdframed detected package amsthm 
 changed the theorem header of amsthm
(mdframed)              on input line 51.
! Undefined control sequence.
<inserted text> ...y}\sffamily \bfseries \lsstyle 

l.51 \begin{mydef}[this is my title]

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Precisions:

  • The error appears in both book and article document classes
  • The document is generated despite the error

How can I avoid the error?

  • 1
    Add \usepackage{microtype} to your preamble. \lsstyle was not defined. – Troy Jun 7 '18 at 16:07
2

As pointed out by @troy , adding the microtype package solves the problem.

  • Usually one would ask the person who has solved the problem to write up an answer. – TeXnician Jun 8 '18 at 12:13
  • @TeXnician Sorry about that, I am new to stackexchange. Noted for next time – cfri Jun 8 '18 at 20:44

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.