2

Inside the following align environment, I would like to explain to the reader that the equality between ExpressionB and ExpressionC follows from Fubini:

\begin{align*}
ExpressionA & =  ExpressionB \\
& = ExpressionC \\
& \text{[ by Fubini ]} \\
& = ExpressionD
\end{align*}

This does work, but I'd like the [ by Fubini ] to be aligned to the right of the page. How do I do that?

In my use cases, ExpressionA and ExpressionB are long, and together they usually span the entire width of the page (almost). So there's no room to add the [ by Fubini ] in a column of its own. I want the [ by Fubini ] in a line of its own (like in my example), but aligned to the right of the page.

It will be best if [ by Fubini ] is aligned to the right of the page itself, but it will be acceptable if it is aligned to the right of the column.

I tried \hfill, but it has no effect.

I am using amsmath.

EDIT: I have found the \tag enviroment. It is similar to what I want, but aligns to the left instead of to the right (in my document). I want to keep equation numbers on the left throught the document, but have my "[ by Fubini ]" formatted like a tag, but aligned to the right.

2
  • Welcome to TeX.SE. Using && \text{[ by Fubini ]} (note the double &&) should do what you desire. Jan 8, 2022 at 9:11
  • @PeterGrill: Thanks. This seems to make the [ by Fubini ] in a column of its own, and then it goes out of the page's margins.
    – Henry
    Jan 8, 2022 at 9:16

1 Answer 1

1

You can do that with flalign*, or keep align* and use the \tag command:

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}

\begin{document}

\lipsum[4]

\begin{flalign*}
 & & ExpressionA & = ExpressionB \\
 & & & = ExpressionC \\
 & & & & \text{\raggedleft by Fubini } \\
& & & = ExpressionD
\end{flalign*}

\begin{align*}
  ExpressionA & = ExpressionB \\
  & = ExpressionC \\
 & \tag{\raggedleft by Fubini } \\
& = ExpressionD
\end{align*}

\end{document} 

enter image description here

3
  • Thank you. The flalign method doesn't work well for me, because my ExpressionB (and ExpressionC) are long, and then [ by Fubini ] runs into the margins. The \tag method looks promising, only that in my case it is aligned to the left. I want to keep equation number aligned to the left throughout the document. Is there a way to make just one tag aligned to the right?
    – Henry
    Jan 8, 2022 at 9:43
  • (I also want an equation number in this particular align enviroment. So I'm now looking for a way to have some tags aligned to the left and some tags aligned to the right within the same \align enviroment)
    – Henry
    Jan 8, 2022 at 9:46
  • @Henry: The only way I see is to loading the linegoal package and replacing the \tag command with &\makebox[\linegoal][r}{by Fubini}. However it has one problem: the equations are left-aligned and the equation numbers go into the left margin. Maybe it's not such a problem as it is only for this group of equations?
    – Bernard
    Jan 8, 2022 at 10:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .