1

I am making a custom book style for my thesis, and I came up with a style for the theorem environments that I like, as you can see in the image below. However I have two problems:

  1. I would like the theorem's title to be in parenthesis, as is the case with the usual amsthm's theorem
  2. I would like the theorem environments to be similar to amsthm's environments. For example, the theorem's body would be in italics, and the remark's title would be in not boldface italics.

I know that these issues can be solved by using the package thmtools, however I could not find a way to reproduce this style and colors, in particular I could not make the title to appear in this shaded bar, and I also had issues with shaded theorems not braking along pages, wich is a must for me, as I am going to have some long ones.

Could somebody tell me how I can produce the same result, but with my two issues solved?

Extra question: I learnt from experience that when I'm having a hard time changing latex styles, there is a good reason for that, and changes produce worse results. I guess it's a matter of taste, but from a typesetting point of view, is there a good reason to avoid doing the changes I'm asking here?

enter image description here

\documentclass{article}

\usepackage{amsthm}
\usepackage{lipsum} %dummy text
\usepackage[usenames,dvipsnames,table]{xcolor} 
\definecolor{lightblue}{rgb}{.31,.506,.741}
\definecolor{pale}{HTML}{F7F8E0}

\usepackage[framemethod=TikZ]{mdframed}
\usepackage{tikz}

\theoremstyle{theorem}
\mdfdefinestyle{mytheoremstyle}{%
linewidth =0pt, %
frametitlerule =true, %
frametitlebackgroundcolor=lightblue!20,
backgroundcolor=pale,
} 

\theoremstyle{theorem}
\mdfdefinestyle{mytheoremstyle}{%
linewidth =0pt, %
frametitlerule =true, %
frametitlebackgroundcolor=lightblue!20,
backgroundcolor=pale,
} 

\mdtheorem[style=mytheoremstyle]{theorem}{Theorem}[section]

\theoremstyle{remark}
\mdfdefinestyle{myremarkstyle}{%
linewidth =0pt, %
frametitlerule =true, %
frametitlebackgroundcolor=lightblue!20,
backgroundcolor=pale,
} 

\mdtheorem[style=myremarkstyle]{remark}[theorem]{Remark}

\begin{document}
\section{A section}
\lipsum[1]
\begin{theorem}[The theorem's title]
    I would like two things:
    \begin{enumerate}
    \item the theorem's title to appear in parentheses, 
          like ``Theorem 1.1. (The theorem's title.)''
    \item the fonts to be in italics, like the
    amsthm's theorem style
    \end{enumerate}
\end{theorem}
\lipsum[2]

\begin{remark}
I would like the fonts to be as in amsthm's remark
style.
\end{remark}

\end{document}
3
  • 1
    commenting only on your last question -- " is there a good reason to avoid doing the changes I'm asking here?" admittedly biased answer, no, i can think of no good reason. in fact, the typographic distinctions in amthm were made on the basis of long tradition, so to not recognize them would be breaking with tradition. unrelated comment: some people have had good results with tcolorbox; haven't used it myself, so this is second hand only. Jun 19, 2016 at 16:04
  • Thanks for the feedback, good to know. I'll take a look at tcolorbox
    – geo909
    Jun 20, 2016 at 0:18
  • @barbarabeeton tcolorbox did the job! Thanks
    – geo909
    Jun 21, 2016 at 0:19

1 Answer 1

1

Tcolorbox did the job with the following:

\usepackage[theorems]{tcolorbox}

\tcbset{
theostyle/.style={
    fonttitle=\bfseries\upshape,
    fontupper=\slshape,
    before skip=\baselineskip,
    arc=0mm, 
    boxrule=0mm, 
    left=0mm,
    right=0mm,
    coltitle=black,
    colback=pale,
    colframe=lightblue!30,
    breakable,
    description delimiters parenthesis,
    separator sign none,
    terminator sign={.}
}}

\newtcbtheorem[number within=section]{theorem}{Theorem}{theostyle}{theorem} 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .