Math & Science ⇒ How to make Theorems with colored boxes?
How to make Theorems with colored boxes?
How to make theorems show inside a box filled with a certain color ?
I need it also to split over two pages if the theorem was at the end of a page.
Regards,
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
How to make Theorems with colored boxes?
you could try the shaded environment from the framed package. A little example:
Code: Select all
\documentclass{article}
\usepackage{xcolor}
\usepackage{amsthm}
\usepackage{framed}
\colorlet{shadecolor}{orange!15}
\newtheorem{theorem}{Theorem}
\newenvironment{theo}
{\begin{shaded}\begin{theorem}}
{\end{theorem}\end{shaded}}
\begin{document}
\begin{theo}
Some important theorem.
\end{theo}
\end{document}
How to make Theorems with colored boxes?
Code: Select all
\documentclass{article}
\usepackage{xcolor}
\usepackage{amsthm}
\usepackage{shadethm}
\newshadetheorem{thm}{Theorem}
\definecolor{shadethmcolor}{HTML}{EDF8FF}
\definecolor{shaderulecolor}{HTML}{45CFFF}
\setlength{\shadeboxrule}{.4pt}
\begin{document}
\begin{thm}
Some important theorem.
\end{thm}
\end{document}
Re: How to make Theorems with colored boxes?
It worked with me.
but how to make shading with two colors (the shading changes gradually from the first color to the second color vertically or horizontally)?
How to make Theorems with colored boxes?
Code: Select all
\documentclass{article}
\usepackage{xcolor}
\usepackage{amsthm}
\usepackage{tikz}
\newtheorem{thm}{Theorem}
\newcommand{\statetheoremhoriz}[2][\textwidth]{
\par\noindent\tikzstyle{mybox} = [draw=blue,left color=cyan!50,
right color=cyan!5,thick,rectangle,inner sep=6pt]
\begin{tikzpicture}
\node [mybox] (box){%
\begin{minipage}{#1}{#2}\end{minipage}
};
\end{tikzpicture}
}
\newcommand{\statetheoremvert}[2][\textwidth]{
\par\noindent\tikzstyle{mybox} = [draw=blue,top color=cyan!50,
bottom color=cyan!5,thick,rectangle,inner sep=6pt]
\begin{tikzpicture}
\node [mybox] (box){%
\begin{minipage}{#1}{#2}\end{minipage}
};
\end{tikzpicture}
}
\newcommand{\statetheoremsolid}[2][\textwidth]{
\par\noindent\tikzstyle{mybox} = [draw=blue,fill=cyan!50,
thick,rectangle,inner sep=6pt]
\begin{tikzpicture}
\node [mybox] (box){%
\begin{minipage}{#1}{#2}\end{minipage}
};
\end{tikzpicture}
}
\begin{document}
\statetheoremhoriz{
\begin{thm}
Some important theorem. It is very important. So important that
it is in a shaded box with a horizontal gradient.
\end{thm}
}
\statetheoremvert{
\begin{thm}
Another important theorem. It is very important. So important
that it is in a shaded box with a vertical gradient.
\end{thm}
}
\statetheoremsolid{
\begin{thm}
Not such an important theorem. That is why it is in a box with
solid shading.
\end{thm}
}
\end{document}
Re: How to make Theorems with colored boxes?
Regards,