2

I use a proof environment in a solution environment which inside a description environment. But after compiling my tex file, in the pdf file the proof doesn't show at the beginning of a proof.

"solution" is a user-defined theoremstyle whose parameters are as follow:

\newtheoremstyle{solution}%
{}{}%
{}{-10pt}%
{\bfseries}{:}%
{\newline}%
{}

Except this, I don't make any changes.

Something relevant in my preamble:

\theoremstyle{definition}
\newtheorem*{lem}{Lemma}

What I did in my tex file is as follow:

\begin{description}
\item[1]
\begin{solution}

\begin{lem}
a lemma
\end{lem}

\begin{proof}
a proof
\end{proof}

\end{solution}
\end{description}
  • 2
    Welcome to TeX.SE! Can you please show us a compilable tex code resulting in your issue, not only a code snippet we had to guess what you are doing? – Mensch Apr 21 at 16:56
  • 2
    Could you please make a minimal working example (MWE) that allows others to replicate your issue? – leandriis Apr 21 at 16:57
  • Welcome to TeX.SE! Could you please edit your post and add a complete but minimal example which reproduces your problem (with your documentclass, the packages you're using and the definitions you created)? – CarLaTeX Apr 21 at 16:57
  • I have edited a minimal example, thanks. – Tao X Apr 21 at 17:05
  • 3
    That is not what they mean. We cannot copy and test your code which out having to guess parts of it. Please make this into something we can copy and test as is. – daleif Apr 21 at 17:22
3

You need some text after \begin{solution}.

\documentclass{article}
\usepackage{amsthm}

\newtheoremstyle{solution}
  {}
  {}
  {\normalfont}
  {-10pt}
  {\bfseries}
  {:}
{0pt}%  {\newline}
  {}

\theoremstyle{definition}
\newtheorem*{lem}{Lemma}

\theoremstyle{solution}
\newtheorem*{solution}{Solution}

\begin{document}

\begin{description}
\item[1]
\begin{solution}\mbox{}

\begin{lem}
a lemma
\end{lem}

\begin{proof}
a proof
\end{proof}

\end{solution}
\end{description}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.