[Tex/LaTex] Proof-like environment

theorems

I have a theorem environment called question, and I would like to use a proof-like environment that prints "Solution" instead of "Proof"

\documentclass[a4paper,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}

\newtheorem{question}{Question}

\begin{document}

\begin{question}
Some question here
\end{question}

\begin{solution}
Here goes the solution to the question
\end{solution}

\begin{theorem}
Some theorem or formula to derive here
\end{theorem}

\begin{proof}
Here goes the proof to the question
\end{proof}

\end{document}

I have used the command $\renewcommand{\proofname}{Solution}$ as a temporary fix, but that replaces the name for all instances, and sometimes I will actually need to use the regular proof environment, with "Proof" as its name.

Best Answer

Package amsthm has three styles: plain (title is in \bfseries and body is in \itshape), definition (title is in \bfseries and body is in \rmfamily) and remark (title is in \itshape and body is in \rmfamily). All of them come with starred versions, which do not use a counter.

\documentclass[a4paper,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}
\newtheorem{question}{Question}
\theoremstyle{remark}
\newtheorem*{solution}{Solution}


\begin{document}

\begin{question}
Some question here
\end{question}

\begin{solution}
Here goes the solution to the question
\end{solution}

\begin{theorem}
Some theorem or formula to derive here
\end{theorem}

\begin{proof}
Here goes the proof to the question
\end{proof}

\end{document}

Here is another way if you like to see the QED symbol at the end of the solution.

\documentclass[a4paper,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{amsthm}

\newtheorem{theorem}{Theorem}
\newtheorem{question}{Question}

\newenvironment{solution}{\renewcommand{\proofname}{Solution}\begin{proof}}{\end{proof}}


\begin{document}

\begin{question}
Some question here
\end{question}

\begin{solution}
Here goes the solution to the question
\end{solution}

\begin{theorem}
Some theorem or formula to derive here
\end{theorem}

\begin{proof}
Here goes the proof to the question
\end{proof}

\end{document}

enter image description here

Related Question