1

This is a a follow-up question to this answer.

Here there is a minor modification of the MWE provided by the user (where I put \bigg instead of \bigl/\bigr):

\documentclass{article}
\usepackage{amsmath,amsthm}

\theoremstyle{definition}
\newtheorem{examplex}{Example}
\newenvironment{example}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{$\triangle$}\examplex}
  {\popQED\endexamplex}

\begin{document}

\begin{example}
This has only text.
\end{example}

\begin{example}
This has also a display at the end:
\begin{align*}
f(x) &= \bigg( g(x) \bigg) \\
h(x) &= \bigg( r(x) \bigg).\qedhere
\end{align*}
\end{example}

\end{document}

As it can be noticed, the symbol at the end of the example is in line with the dot at the end of the align (i.e. it is in line with the center of the bracket). However, I would like to have it in line with the bottom of the bracket.

Notice that the very same issue arises with the standard environment of proof.

Is it possible to achieve what I am looking for?

(Of course, \bigg) is just a reference point. The solution should work for any kind of symbol that does not take the standard spacing in a formula.)

Kolmin
  • 559

1 Answers1

1

I am not sure I recommend this style, but here are two variants of \qedhere for use in align and gather contexts. They work by adding an extra line to the construction and then backing up vertically an appropriate amount.

Sample output

\documentclass{article}

\usepackage{amsmath,amsthm}

\theoremstyle{definition}
\newtheorem{examplex}{Example}
\newenvironment{example}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{$\triangle$}\examplex}
  {\popQED\endexamplex}

\newcommand{\alignqedhere}{\\[\dimexpr-\baselineskip+\dp\strutbox]
&\qedhere}
\newcommand{\gatherqedhere}{\\[\dimexpr-\baselineskip+\dp\strutbox]
\qedhere}

\begin{document}

\begin{example}
This has only text.
\end{example}

\begin{example}
This has also a display at the end:
\begin{align*}
  f(x) &= \bigg( \frac 1{g(x)} \bigg), \\
  h(x) &= \bigg( \frac{p(x)}{q(x)} \bigg). \alignqedhere
\end{align*}
\end{example}

\begin{example}
  This ends with an ordinary equation but set as \verb+gather+
  \begin{gather*}
    x = \frac12. \gatherqedhere
  \end{gather*}
\end{example}

\begin{example}
  Here is another example
  \begin{gather*}
    f(x) =
    \begin{cases}
      1&\text{for \( x>0 \),}\\
      0&\text{otherwise.}
    \end{cases}
    \gatherqedhere
  \end{gather*}
\end{example}

\begin{example}
  \begin{gather*}
    \begin{split}
      y &= z\\
      &= \frac 1\pi.
    \end{split}
    \gatherqedhere
  \end{gather*}
\end{example}

\end{document}
Andrew Swann
  • 95,762