5

How do I add a \square (or anything else) at the end of a paragraph and align it to the right as if it is the end of proof (without \begin{proof} at the beginning). I don't want to see the "proof" at the beginning.

And at the same time, I only need a local/temporary change. I don't want to change the "proof" environment at the beginning. I still want to use \begin{proof} normally in other places

No One
  • 269

2 Answers2

7

You just declare \qed at the end of the paragraph, which is essentially what \end{proof} does automatically (with some more bells and whistles you don't need for your situation).

\documentclass{article}
\usepackage{amsthm}

\begin{document}

A paragraph with a QED symbol at the far end. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines.\qed

\end{document}

enter image description here

You can locally change the QED symbol. I suggest a special command for the task you want (a triangle instead of the square).

\documentclass{article}
\usepackage{amsthm}

\newcommand{\triangleqed}{% \begingroup \renewcommand{\qedsymbol}{\ensuremath{\triangle}}% \qed \endgroup }

\begin{document}

A paragraph with a QED symbol at the far end. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines.\qed

A paragraph with a QED symbol at the far end. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines.\triangleqed

A paragraph with a QED symbol at the far end. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines. Let's go on with nonsense words just to get a few lines.\qed

\end{document}

enter image description here

egreg
  • 1,121,712
2

Do you mean like this:

\documentclass{article}

\usepackage{lipsum} \usepackage{amssymb}

\begin{document}

\lipsum[2] \unskip\nobreak\hfill $\square$

\end{document}

Output: enter image description here

This shows how output has been produced: enter image description here

wipet
  • 74,238
  • 2
    You perhaps meant not to have a blank line before \hfill$\square$. However, this doesn't guarantee that the square falls at the end of the line. And the symbol used by amsthm is not $\square$. – egreg Sep 09 '22 at 21:23
  • 1
    Yes, e.g. with \lipsum[8] the square would go to the start of the next line. – dexteritas Sep 09 '22 at 21:28