0

I'm trying to rebuild the proof environment using a tcolorbox. The design of the box is pretty simple. My problem is adding a square (or something else notating QED) at the end of the box. Obviously it can be done manually at the end of every box, but I don't like that solution. Is there a way to add such a symbol automatically at the end of the tcolorobox? E.g. Flushed left at the last line or creating a new line with just the symbol flushed left?

Here is a small code snippet (not by resulting box design):

\documentclass[a4paper, 11pt]{book}
\usepackage{tcolorbox}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{ragged2e}
\newtcolorbox{beweis}[1]{
        title = #1,
}
\begin{document}
\begin{beweis}{Titel}
    \lipsum[1]
    \begin{FlushRight} $\square$ \end{FlushRight} % Automatically do this
\end{beweis}
\end{document}
Titanlord
  • 541

1 Answers1

0

You could define a beweis environment which begins a tcolorbox and adds your QED symbol before it closes.

\documentclass[a4paper, 11pt]{book}
\usepackage{tcolorbox}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{ragged2e}
\newenvironment{beweis}[1]
    {%
        \tcolorbox[title=#1]%
    }%
    {
        \begin{FlushRight} $\square$ \end{FlushRight}%
        \endtcolorbox%
    }

\begin{document} \begin{beweis}{Without lower part} \lipsum[1] \end{beweis}

\begin{beweis}{With lower part} Upper \tcblower Lower \end{beweis} \end{document}

example

Vertho
  • 303