Math & Science ⇒ Symbol at the end of a displayed equation
Symbol at the end of a displayed equation
I checked the earlier posts for the solution to my question, but it doesn't seem to be there; so here it is:
Suppose I have an equation and I want a $\Diamond$ (or any other for that matter,) symbol at the end of the displayed equation flushed right. My numbering scheme has equation numbers at the left, so the standard trick of using \tag*{$\Diamond$} at the end of the equation does not work. There must be a way to do this, but it's just not working with \hfill, etc. Fine-tuning with \vspace both to the left and right of the displayed equation is also not a good way to go.
Could anyone please help?
Best regards,
- D.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Symbol at the end of a displayed equation
in the following example I defined two new environments qedequation and its *-ed version qedequation* which behave like equation and equation* but also produce the QED symbol, as defined in amsthm, flushed right. Of course, the use of the numbered version only makes sense if the leqno package option for amsmath is active.
Code: Select all
\documentclass{article}\usepackage[leqno]{amsmath}\usepackage{amsthm}\makeatletter% queequation only makes sense with the leqno option for amsmath\newenvironment{qedequation}{%\pushQED{\qed}%\incr@eqnum\mathdisplay@push\st@rredfalse \global\@eqnswtrue\mathdisplay{equation}%}{%\endmathdisplay{equation}%\mathdisplay@pop\ignorespacesafterend\popQED\@endpefalse}\newenvironment{qedequation*}{%\pushQED{\qed}%\mathdisplay@push\st@rredtrue \global\@eqnswfalse\mathdisplay{equation*}%}{%\endmathdisplay{equation*}%\mathdisplay@pop\ignorespacesafterend\popQED\@endpefalse}\makeatother\begin{document}\begin{qedequation}E = m c^2\qedhere\end{qedequation}\begin{qedequation*}E = m c^2\qedhere\end{qedequation*}
Re: Symbol at the end of a displayed equation
-
- Posts: 351
- Joined: Sat Aug 02, 2008 8:47 am
Symbol at the end of a displayed equation
dnemoc wrote: Suppose I have an equation and I want a $\Diamond$ (or any other for that matter,) symbol at the end of the displayed equation flushed right. My numbering scheme has equation numbers at the left, so the standard trick of using \tag*{$\Diamond$} at the end of the equation does not work. There must be a way to do this, but it's just not working with \hfill, etc. Fine-tuning with \vspace both to the left and right of the displayed equation is also not a good way to go.
Code: Select all
\documentclass{article}\usepackage[leqno]{amsmath}\usepackage{amsthm}\begin{document}\noindent\rule{\linewidth}{1pt}\begin{flalign}&& E = m c^2 &&\qed\end{flalign}\begin{flalign*}&& E = m c^2 &&\qed\end{flalign*}\end{document}
Re: Symbol at the end of a displayed equation
Best regards to you both!
- D.