1

How can I get the Definition and Theorem environment like these in LaTeX package SVMono ?enter image description here

3
  • Hope all Springer macros are still maintaining by the Springer Team, better you can approach them...
    – MadyYuvi
    Dec 20, 2019 at 6:48
  • Thanks. @ MadyYuvi
    – ljjpfx
    Dec 20, 2019 at 7:23
  • You can use the beaulivre package to get the theorem and definition environments as such. The fonts seem to be Kp-Fonts. Nov 9, 2022 at 11:50

1 Answer 1

6

I used TikZ and declared a newtheoremstyle as detailed on page 9 of the amsthm documentation. The TikZ creates the background and colors and the newtheoremstyle defines title, color of title, spacing after and before theorem text, etc.

enter image description here

\documentclass{article}

\usepackage{xcolor}
\definecolor{amber}{rgb}{1.0, 0.49, 0.0}
\definecolor{cadmiumgreen}{rgb}{0.0, 0.42, 0.24}

\usepackage{amsthm}
\usepackage{tikz}

\newtheoremstyle{styleth}%
{3pt}% Space above
{3pt}% Space below 
{}% Body font
{}% Indent amount
{\bfseries\color{amber}}% Theorem head font
{}% Punctuation after theorem head
{.5em}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning ‘normal’)
\theoremstyle{styleth}
\newtheorem{thm}{Theorem}

\newtheoremstyle{styledef}%
{3pt}% Space above
{3pt}% Space below 
{}% Body font
{}% Indent amount
{\bfseries\color{cadmiumgreen}}% Theorem head font
{}% Punctuation after theorem head
{.5em}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning ‘normal’)
\theoremstyle{styledef}
\newtheorem{definition}{Definition}

\newcommand{\statedefsolid}[2][\textwidth]{
  \par\noindent\tikzstyle{mybox} = [fill=yellow!20,
   thick,rectangle,inner sep=6pt,path picture={\fill [green!50!black] ([xshift=-6.15cm]path picture bounding box.north) rectangle (path picture bounding box.south west);}]
  \begin{tikzpicture}
   \node [mybox] (box){%
    \begin{minipage}{#1}{#2}\end{minipage}
   };
  \end{tikzpicture}
}

\newcommand{\statetheoremsolid}[2][\textwidth]{
  \par\noindent\tikzstyle{mybox} = [draw=amber,fill=gray!17,
   thick,rectangle,rounded corners,inner sep=6pt]
  \begin{tikzpicture}
    \node [mybox] (box){%
    \begin{minipage}{#1}{#2}\end{minipage}
   };
  \end{tikzpicture}
}

\begin{document}

\statedefsolid{
\begin{definition}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec est venenatis, maximus purus eu, ultrices justo. Integer ac mattis lectus. Praesent luctus lectus orci, vitae congue elit tempus vitae. Maecenas accumsan aliquet gravida. Maecenas vitae quam et lectus imperdiet feugiat. Sed sodales ipsum a dolor lobortis pretium. Sed at ipsum ac ante sollicitudin vehicula tempus a arcu. Integer volutpat malesuada nibh, at laoreet leo maximus non. Nulla vitae pulvinar erat.
\end{definition} 
}

\statetheoremsolid{
\begin{thm}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec est venenatis, maximus purus eu, ultrices justo. Integer ac mattis lectus. Praesent luctus lectus orci, vitae congue elit tempus vitae. Maecenas accumsan aliquet gravida. Maecenas vitae quam et lectus imperdiet feugiat. Sed sodales ipsum a dolor lobortis pretium. Sed at ipsum ac ante sollicitudin vehicula tempus a arcu. Integer volutpat malesuada nibh, at laoreet leo maximus non. Nulla vitae pulvinar erat.
\end{thm}
}

\end{document}

Edit: To have more control about width of minipage, change both newcommands:

\newcommand{\statedefsolid}[2]{
  \par\noindent\tikzstyle{mybox} = [fill=yellow!20,
   thick,rectangle,inner sep=6pt,path picture={\fill [green!50!black] ([xshift=-6.15cm]path picture bounding box.north) rectangle (path picture bounding box.south west);}]
  \begin{tikzpicture}
   \node [mybox] (box){%
    \begin{minipage}{#1}{#2}\end{minipage}
   };
  \end{tikzpicture}
}

\newcommand{\statetheoremsolid}[2]{
  \par\noindent\tikzstyle{mybox} = [draw=amber,fill=gray!17,
   thick,rectangle,rounded corners,inner sep=6pt]
  \begin{tikzpicture}
    \node [mybox] (box){%
    \begin{minipage}{#1}{#2}\end{minipage}
   };
  \end{tikzpicture}
}

And now, the command in def/theorem text will need more one parameter which control de width of minipage:

\statetheoremsolid{0.95\textwidth}{
 \begin{thm}
   ...
 \end{thm}
}
2
  • Many Thanks @Jean Pimenta
    – ljjpfx
    Dec 20, 2019 at 7:07
  • Hi, Dear Pimenta, I used your codes and it looks nice, but the boxes overflow a little on the right side. How can I adjust them? Thanks.
    – ljjpfx
    Dec 22, 2019 at 2:50

You must log in to answer this question.

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