1

A similar question has been asked before but, I believe, I am trying something slightly different as I am trying to make adjustments using renewenvironment.

I am trying to obtain a solid square at the end of a proof. If I don't try to use the renewenvironment, I get a solid square. However, if I use the renewenvironment, the "Proof" title is bold (as required) but the box is not filled in.

I'm sure the solution will help me understand how things are being "over-written" at some points.

\documentclass{article}

\usepackage{amsmath}
\usepackage[most]{tcolorbox}
\usepackage{amsthm}
\usepackage{amssymb}

\renewcommand{\qedsymbol}{$\blacksquare$} % Requires amssymb
     
\newtcbtheorem[auto counter,number within=section]{theo}%
  {Theorem}{fonttitle=\bfseries\upshape, fontupper=\slshape,
     arc=0mm, colback=blue!5!white,colframe=blue!60!white,
       every box/.style={
         highlight math style={
           colback=green!10!white,
           colframe=blue
         }
       }
     }{theorem}

% % If I uncomment this, the square is not filled in!
% \renewenvironment{proof}[1][Proof]{\par\noindent\textbf{#1} }
% {\hfill$\square$\par}

\begin{document}

Why doesn't it show a solid square?

\begin{theo}{Goldbach Conjecture}{difficult}
Every even natural number greater than 2 is the sum of two prime numbers.
    \begin{proof}
        It's obvious :)
    \end{proof}
\end{theo}

\end{document}
3
  • 1
    To close voters, LateX is programming and is explicitly on-topic here. Commented Jun 19, 2025 at 13:54
  • @TylerH We have a whole site dedicated to it, this question should go there instead; though it would have been better if the close voters had (unanimously) voted to migrate. Commented Jun 19, 2025 at 15:44
  • 2
    @MarkRotteveel Questions can be on-topic on multiple sites. Commented Jun 19, 2025 at 19:57

1 Answer 1

1

With your renewenvironment, you replace the proof environment with an environment which does not do much other than setting the title in bold and adding an open \square at the end. If you want to have a filled square, use \blacksquare.

Or modify the original definition of the proof environment:

\documentclass{article}

\usepackage{amsmath}
\usepackage[most]{tcolorbox}
\usepackage{amsthm}
\usepackage{amssymb}

\renewcommand{\qedsymbol}{$\blacksquare$} % Requires amssymb
     
\newtcbtheorem[auto counter,number within=section]{theo}%
  {Theorem}{fonttitle=\bfseries\upshape, fontupper=\slshape,
     arc=0mm, colback=blue!5!white,colframe=blue!60!white,
       every box/.style={
         highlight math style={
           colback=green!10!white,
           colframe=blue
         }
       }
     }{theorem}
     
\usepackage{xpatch}
\xpatchcmd{\proof}{\itshape}{\itshape\bfseries}{}{}

\begin{document}

Why doesn't it show a solid square?

\begin{theo}{Goldbach Conjecture}{difficult}
Every even natural number greater than 2 is the sum of two prime numbers.
    \begin{proof}
        It's obvious :)
    \end{proof}
\end{theo}

\end{document}

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. Your reply "If you want to have a filled square, use \blacksquare" immediately showed me that replacing \square with \blacksquare in the renewenvironment of my original posting code solved the problem.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.