Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What is the best way for me to get "QED"--as the three letters, not the square generated by \qed--flush with the right side of a page on the same line as a display equation?

Note - I am intentionally not using the proof environment.

share|improve this question
    
\text{QED} after the equation should work. To do it often, try \renewcommand{\qed}{\text{QED}}`, then use \qed. –  Ethan Bolker Apr 21 at 0:53
    
@EthanBolker Doesn't that produce the text immediately to the right of the equation, as opposed to flush right (see my edit to the question)? –  user1577636 Apr 21 at 1:06
    
does \tag{QED} work as you would like? –  cmhughes Apr 21 at 1:26
    
Is this for an displayed expression produced by equation* or for other environments as well? –  Gonzalo Medina Apr 21 at 1:28
    
@cmhughes No, I do not want the parentheses around the "QED" –  user1577636 Apr 21 at 1:30
show 1 more comment

3 Answers 3

up vote 6 down vote accepted

Since this is only for the equation* environment, one can use \displaymath@qed (defined by amsthm); in the following example I \let the command \QED to be \displaymath@qed and used the etoolbox package to redefine \qedsymbol inside equation* to produce the text "Q.E.D." in small caps and using \footnotesize:

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

\makeatletter
\let\QED\displaymath@qed
\makeatother
\AtBeginEnvironment{equation*}{\renewcommand\qedsymbol{{\footnotesize\textsc{q.\,e.\,d.}}}}

\begin{document}

some test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here  test text goes here
\begin{equation*}
a=b + c.\QED
\end{equation*}
some test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here  test text goes here

\end{document}

enter image description here

share|improve this answer
add comment

A very simple solution, using the \tag* command from the mathtools package. It also works for groups of equations:

    \documentclass[12pt,a4paper,bothsides]{article}

    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc} 
    \usepackage{fourier} 
    \usepackage{mathtools}

    \newcommand*\QED{\tag*{\scshape q.\:e.\:d.}}

    \begin{document}

    \[ a²  = b²  + c²  \QED \]%

    \begin{align}
      a²  & = b²  + c² \\
      a³    & \neq b³  + c³ \QED
    \end{align}

    \end{document} 

enter image description here

share|improve this answer
add comment

Since you mention the square generated by \qed, I'll assume that you are using the amsthm package or something that loads it automatically. Now, the square is not the \qed itself, it is the \qedsymbol. What \qed does is to print the \qedsymbol with some space to the left and other bells and whistles so that it does not overprint a rather full line. So you can redefine \qedsymbol like \renewcommand{\qedsymbol}{\mbox{\textsc{q.\,e.\,d.}}} or something similar (that's Q.E.D. in small capitals, letterspaced, as was used in the old high school geometry books). Or you can use instead \renewcommand{\qedsymbol}{\mathrm{QED}} if that is what you want. Then, invoking \qed inside an unnumbered display will produce the desired result, flush right. If your proof ends with a displayed equation, use \qedhere inside the display, so that \end{proof} does not generate another end-proof marker sitting alone on an extra line.

share|improve this answer
    
Did you try your proposed solution? In its present form, i.e., just using \qed with no extra work, the symbol won't be flushed to the right. –  Gonzalo Medina Apr 21 at 1:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.