I'm using thmtools for fancy-looking math environments. But I don't know how to redefine proof environment. I cannot find such topics in its documentation.
This is my LaTeX code snippet.
\documentclass{article}
\usepackage{color}
\definecolor{section_color}{rgb}{0.35,0.0,0}
\definecolor{MyGray}{rgb}{0.96,0.97,0.98}
\usepackage{amsthm,thmtools}
% defining common style
\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
headfont=\color{section_color}\sffamily\bfseries,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
qed=,
]{mystyle}
% defining theorem environment
\declaretheorem[
style=mystyle,
shaded={bgcolor=MyGray,padding=2mm,textwidth=0.98\textwidth}
]{theorem}
% defining claim environment
\declaretheorem[
sibling=theorem,
style=mystyle,
shaded={bgcolor=MyGray,padding=2mm,textwidth=0.98\textwidth}
]{claim}
\begin{document}
%title{Thmtools Example}
\begin{theorem}[Euler's identity]
$e^{i\pi} + 1 = 0$
\end{theorem}
\begin{proof}
Use Euler's formula $e^{ix} = \cos x + i\sin x$.
\end{proof}
\begin{proof}[Proof of Fermat's Last Theorem]
Ask Andrew Wiles.
\end{proof}
\end{document}
What I want for the proof environment is:
- It has the same style as other environments: same font, same boldface, and same text color
- But it has no shaded background.
- It can handle an argument so that the title 'Proof' can be changed, as shown in the second proof example.
How can I redefine proof environment using thmtools?
Best Answer
The best way I've found is to redefine the
proof
environment, that is, add the following lines in your preamble:MWE
Output:
If the additional extra spacing in the margins used for theorems and claims should also be used for proofs, you can change the above redefinition to (thanks to Gonzalo Medina for suggesting it)
and you will obtain