I'm using \begin{proof}... \end{proof} of amsthm package for demonstrations environment. How I can change only the color of word "Proof"? Thank you.
R.S.
I suggest an indirect method. For some time I've endorsed replacing the hardwired \itshape with a generic command that can be modified by the user. Alas, it has never been done.
But we can patch \proof and do it ourselves.
\documentclass[twocolumn]{article}
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{xpatch}% to patch \proof
\newcommand{\proofnameformat}{\itshape}% the default for amsthm
\xpatchcmd{\proof}{\itshape}{\proofnameformat}{}{}
\colorlet{proofcolor}{red!75!blue}
\renewcommand{\proofnameformat}{\itshape\color{proofcolor}}
\begin{document}
\begin{proof}
It's obvious, isn't it?
\end{proof}
\end{document}
The twocolumn option is just to make a smaller picture.
I suggest keeping the default value of \proofnameformat for the record, so you start from the same setup as the standard amsthm.
A more flexible version might be
\documentclass[twocolumn]{article}
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{xpatch}% to patch \proof
\makeatletter
\newcommand{\proofnameformat}[1]{\itshape#1@addpunct{.}}% the default \xpatchcmd{\proof}
{\itshape#1@addpunct{.}}
{\proofnameformat{#1}}
{}{}
\makeatother
for amsthm
\colorlet{proofcolor}{red!75!blue}
\renewcommand{\proofnameformat}[1]{\fbox{\itshape\color{proofcolor}#1/}}
\begin{document}
\begin{proof}
It's obvious, isn't it?
\end{proof}
\end{document}
Here #1 in the definition of \proofnameformat will be replaced by \proofname. The result with the given value for \proofnameformat would be
For your application you'd do
\makeatletter
\renewcommand{\proofnameformat}{\itshape\color{proofcolor}#1\@addpunct{#1}}
\makeatother
The default "proof name" is defined as \proofname in amsthm.
So you can just \renewcommand* it.
Example below gives you the word "Proof" in red.
\documentclass[10pt]{article}
\usepackage{amsthm}
\usepackage{xcolor}
\renewcommand*{\proofname}{\color{red}Proof}
\begin{document}
\begin{proof}
Test
\end{proof}
\end{document}
Another alternative.....redefing with \newenvironment{prof}.
\documentclass[12pt]{article}
\usepackage{amsthm}
\usepackage{xcolor}
\newenvironment{prof}
{\begin{proof}[\itshape\textcolor{red}{Proof.}]}
{\end{proof}}
\begin{document}
\begin{prof}
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.
\end{prof}
\end{document}
\color{red}Proofwith either{\color{red}Proof}or\textcolor{red}{Proof}if one doesn't want the period (aka "full stop") after the string "Proof" to be colored red as well. – Mico Feb 17 '22 at 20:37