3
\documentclass[CEJB,PDF]{cej} \usepackage{layout} \usepackage{lipsum} \usepackage{enumerate} \usepackage{amssymb} \begin{document} \begin{proof} In \begin{proof} \end{proof} the end of proof small appearing in same while the proof was ending with text. But the proof is ending with enumerate or align or math mode the small box appearing in next line. \end{proof} \begin{proof} \[{f}(x)=\left\{ \begin{array}{ll} \frac{{f(x)+f(y)}}{2}, & \hbox{if $f(x)+f(y)$ is odd} \\ \frac{{f(x)+f(y)+ 1}}{2}, & \hbox{if $f(x)+f(y)$ is even} \end{array} \right. \] \end{proof} \begin{proof} \begin{enumerate} \item item a \item item b \item item c \end{enumerate} \end{} 

In \begin{proof} \end{proof} the end of proof small appearing in same while the proof was ending with text. But the proof is ending with enumerate or align or math mode the small box appearing in next line. Is it possible to same line ending theorem proof while using enumerate or align or math mode?

2
  • 1
    A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). Commented Aug 14, 2017 at 14:44
  • The cej class is not on CTAN. Can you provide a link to it? Commented Aug 14, 2017 at 15:49

1 Answer 1

3

You have two options.

Option 1: use \qedhere to manually place the box in the position you prefer, for example in the last item of an enumerate. This will suppress the automatic box and place it there instead.

Option 2: use \unskip just after the end of your content, before \end{proof}. This will "undo" vertical space before the box, when applicable.

The solutions work only if supported by the class/packages you are using.

Here is a corrected version of your MWE. Things to note:

  1. it is preferred to use the cases environment for case splits
  2. when using arrays or cases it is a known problem that \qedhere is placed vertically centered. Here we correct the issue as suggested here

Code:

\documentclass[CEJB,PDF]{cej} \usepackage{layout} \usepackage{lipsum} \usepackage{enumerate} \usepackage{amssymb} \begin{document} \begin{proof} In \verb|\begin{proof} \end{proof}| the end of proof small appearing in same while the proof was ending with text. But the proof is ending with enumerate or align or math mode the small box appearing in next line. \end{proof} \begin{proof} This does not align well \[ {f}(x)= \begin{cases} \frac{{f(x)+f(y)}}{2}, & \text{if $f(x)+f(y)$ is odd} \\ \frac{{f(x)+f(y)+ 1}}{2}, & \text{if $f(x)+f(y)$ is even} \end{cases} \qedhere \] \end{proof} \begin{proof} \[ {f}(x)= \begin{cases} \frac{{f(x)+f(y)}}{2}, & \text{if $f(x)+f(y)$ is odd} \\ \frac{{f(x)+f(y)+ 1}}{2}, & \text{if $f(x)+f(y)$ is even} \end{cases} \] \par \vspace{-\baselineskip} \qedhere \end{proof} \begin{proof} \begin{enumerate} \item item a \item item b \item item c\qedhere \end{enumerate} \end{proof} \end{document} 
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.