Math & Sciencecentered equation with constraints at right edge

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
jj39
Posts: 1
Joined: Sun Aug 29, 2010 5:02 am

centered equation with constraints at right edge

Post by jj39 »

I would like to display a single equation in the format

(equation -- centered) (a>1)

That is, the equation is centered as usual, but there is
a second bit of math presented so that its right edge aligns
with the right edge of text on the page.

Any suggestions?

Thanks!

jj

[Added later: thanks for the solution! Incidentally, I had to add [-baselineskip] after the second \\ to get the desired effect.]
Last edited by jj39 on Sun Aug 29, 2010 5:46 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

centered equation with constraints at right edge

Post by gmedina »

Hi,

it's a rather unusual layout, but you can try something like this:

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text
{\setlength\multlinegap{0pt}
\begin{multline*}
  \phantom{\ }\\[-\baselineskip]
  a=b+c\\
  \shoveright{+d+e+f.}\\
\end{multline*}}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

centered equation with constraints at right edge

Post by CrazyHorse »

jj39 wrote:I would like to display a single equation in the format

(equation -- centered) (a>1)

That is, the equation is centered as usual, but there is
a second bit of math presented so that its right edge aligns
with the right edge of text on the page.

Any suggestions?

Thanks!

jj

[Added later: thanks for the solution! Incidentally, I had to add [-baselineskip] after the second \\ to get the desired effect.]

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\parindent=0pt

\begin{document}
\rule{\linewidth}{1pt}

\begin{align}
(equation & centered) \tag{a>1}
\end{align}

\end{document}
Herbert
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

centered equation with constraints at right edge

Post by gmedina »

CrazyHorse wrote:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\parindent=0pt

\begin{document}
\rule{\linewidth}{1pt}

\begin{align}
(equation & centered) \tag{a>1}
\end{align}

\end{document}
Herbert
Yes: I don't know why I assumed that the OP wanted the non-centered expression to appear on a different line.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply