#StackBounty: #math-mode #formatting Add background colour to Theorem Header only

Bounty: 50

documentclass[english,11pt]{book}
%------------------------------------------------------------------------------------ %
%
usepackage[fleqn]{amsmath} %
usepackage{amsthm,amssymb} %
usepackage[T1]{fontenc} %
usepackage{newtxtext} %
usepackage{newtxmath} %
usepackage{xcolor} %
usepackage[paperwidth=170mm,paperheight=240mm,textwidth=132mm,lmargin=12.5mm,rmargin=12.5mm,
bindingoffset=12.5mm,noheadfoot,nomarginpar,showframe,showcrop]{geometry} %
usepackage[a4,frame,cam,center]{crop} 
usepackage{refcount} %
usepackage{hyperref} %
%
setlength{unitlength}{1pt} 
setlength{parskip}{0pt}
setlengthparindent{0pt}

definecolor{DarkRed}{rgb}{0.45,0.06,0.06} % #880000

makeatletter
newtheoremstyle{plain}
{4pt}                                           % ABOVESPACE
{6pt}                                           % BELOWSPACE
{itshapecolor{blue}}                              % BODYFONT
{6pt}                                           % INDENT (empty value is the same as 0pt)
{color{DarkRed}bfseries}% HEADFONT
{:.}                                           % HEADPUNCT
{5pt plus 1pt minus 1pt}    % HEADSPACE
{}                                              % CUSTOM-HEAD-SPEC
newtheorem{theorem}{Theorem}
makeatother

counterwithin*{theorem}{section}

begin{document}

vspace*{12pt}
section{Section ONE}

begin{theorem}
Theorem 1
end{theorem}

theorem{Theorem 2}

end{document}


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.