2

Whenever I finish a proof I tend to put the little square just after the last word, but by using the /begin{proof} /end{proof} environment it appears always at the end of the line. It seems like its definition would include the /hfill command but I don't know how to leave it out. How can I fix it?

  • 2
    the end-of-line position was chosen as the ams style because it's easy to spot on a page. the "open box" tends to blend in with the text when it's in the middle of a line, and a black box was felt to be to prominent. this also affects the placement of equation numbers: for ams style, they are on the left so that they do not conflict with the qed marker. (of course, different authors may have different preferences.) – barbara beeton Apr 24 '15 at 14:05
3

You have to patch the \qed command.

\documentclass{article}

\usepackage{amsthm}

%% using xpatch 
\usepackage{xpatch}
\xpatchcmd{\qed}{\hfill}{}{}{}

%% Or without any package
%\DeclareRobustCommand{\qed}{%
%  \ifmmode % if math mode, assume display: omit penalty etc.
%  \else \leavevmode\unskip\penalty9999 \hbox{}\nobreak%\hfill
%  \fi
%  \quad\hbox{\qedsymbol}}

\begin{document}

\begin{proof}
 This is some proof.
\end{proof}

\end{document}

enter image description here

The separation is \quad. You can change that also similarly, i.e.,

\xpatchcmd{\qed}{\quad}{\space}{}{}  %% \space may be \hspace{<length>}
  • 1
    if the last line of a proof ends so far to the right that there is not room for the qed, the box will go to the start of the next line, where it's not so easy to spot. what tactic should be used there to make it more visible? – barbara beeton Apr 24 '15 at 14:07
1

Proof environment is defined in the amsthm package with the qedsymbol being put at the right end of the page. You can redefine the qedsymbol not to produce anything and define your own qed symbol and use that inside proof environment like this:

\usepackage{amssymb}
\renewcommand\qedsymbol{}
\newcommand\myqed{$\blacksquare$}

\myqed can be used wherever required.
  • I just tried this solution. Actually instead of defining a new command I'm trying to do it by a definition of a a new environment. The problem is when trying it with the \begin{equation} \end{equation} environment or for example when using /[ /] the \blacksquare symbol appears always just at the beginning of the next line. How can I eliminate the new line produced by the equation environment? – Daniela Diaz Apr 24 '15 at 4:33
  • 2
    \qedhere command provided by amsthm package does that exactly. – Ambika Vanchinathan Apr 24 '15 at 4:39
1

No need to use xpatch or any package, nor do you have to use \DeclareRobustCommand. All you have to do is renew the /qed command. Your document should look something like this:

\documentclass{article}

\usepackage{amsthm}

\renewcommand{\qed}{\quad\qedsymbol}

\begin{document}

\begin{proof}
Insert proof here.
\end{proof}

\end{document}

I used \quad for my space but you can use whichever size space you would prefer.

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.