Math & ScienceWhy "& {} \times" in "align" environment?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
JustA_LaTeXusr
Posts: 42
Joined: Tue Jul 23, 2013 6:48 pm

Why "& {} \times" in "align" environment?

Post by JustA_LaTeXusr »

In a previous post (http://latex-community.org/forum/viewto ... 46&t=23594), a kind Samaritan provided the code below template for me to coerce my equation array into respectable form. The ={} was explained as causing = to be interpretted as binary so that sufficient space is left on both sides. However, I also "& {} \times" (without quotes). I compared the result with and without the {} and saw no difference. Can anyone please explain the reason for the {} ? Thanks.

Code: Select all

\documentclass[fleqn]{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{align*}
      i_\textrm{New} ={}&
      \left( 1+ \frac{ 2.27\%}{100\%} \right)
      \left( 1+ \frac{ 2.68\%}{100\%} \right)
   \\
      & {} \times
      \left( 1+ \frac{ 2.85\%}{100\%} \right)
      \left( 1+ \frac{ 3.85\%}{100\%} \right)
   \\
      &
      \phantom{\left( 1+ \frac{ 2.85\%}{100\%} \right)}
      \times \left( 1+ \frac{ 3.16\%}{100\%} \right)
      \times 100\% - 100\%
   \\[0.5cm]
         {}={}& \textrm{\large 173\%}
\end{align*}
\end{document}

Recommended reading 2024:

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

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

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Why "& {} \times" in "align" environment?

Post by kaiserkarl13 »

The preferred order is &= in AMSLaTeX, not =&; it's hard to tell with the large parentheses, so try the example below. By the way, the align-at operator counts as an operator, so the binary/unary thing gets confused (i.e., it's always binary). This is why you don't see a difference. It is, however, a good habit to get into to put the {} in places you want to guarantee a binary operator spacing.

Example:

Code: Select all

    \documentclass[fleqn]{article}
    \usepackage[fleqn]{amsmath}
    \begin{document}
    \begin{align*}
          i_\textrm{New} &=
          C \times A + B + +D
       \\
          C &\times A + B + +D
       \\
          C &\times A + B + \times D
       \\
          C &{} + A + B + +D
       \\
          C &+ A + B + +D
    \end{align*}
    \begin{align*}
          i_\textrm{New} =&
          C \times A + B + +D
    \end{align*}
    \end{document}
JustA_LaTeXusr
Posts: 42
Joined: Tue Jul 23, 2013 6:48 pm

Why "& {} \times" in "align" environment?

Post by JustA_LaTeXusr »

Hi, kaiserkarl13,

Could we be referring to different pairs of curly braces? I'm referring to:

& {} \times

Here is a slimmed down MWE. I confirmed that the curly braces don't yield any difference in the output spacing.

Code: Select all

\documentclass[fleqn]{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{align*}
   i_\textrm{New} ={}&
   \left( 1+ \frac{ 2.27\%}{100\%} \right)
   \left( 1+ \frac{ 2.68\%}{100\%} \right)
   \\
   & {} \times %%%% THIS IS THE STRANGE {}
   \left( 1+ \frac{ 2.85\%}{100\%} \right)
   \left( 1+ \frac{ 3.85\%}{100\%} \right)
\end{align*}
\begin{align*}
   i_\textrm{New} ={}&
   \left( 1+ \frac{ 2.27\%}{100\%} \right)
   \left( 1+ \frac{ 2.68\%}{100\%} \right)
   \\
   & \times %%%% STRANGE {} REMOVED
   \left( 1+ \frac{ 2.85\%}{100\%} \right)
   \left( 1+ \frac{ 3.85\%}{100\%} \right)
\end{align*}
\end{document}
Post Reply