4

How can I center the text between the inequalities? ATM it seems that they are right-aligned.

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\[
  \begin{aligned}
    15               &\leq &C                    &\leq 25 \\
    (\frac{9}{5}) 15 &\leq &(\frac{9}{5}) C      &\leq (\frac{9}{5}) 25 \\
    27               &\leq &(\frac{9}{5}) C      &\leq 45 \\
    27 + 32          &\leq &(\frac{9}{5}) C + 32 &\leq 45 + 32 \\
    59               &\leq &F                    &\leq 77
  \end{aligned}
\]
\end{document}

enter image description here

2
  • The thing is, aren't you telling LaTeX to align things? But what is it aligning? Either one end or the other, whereas you want it to align something in the middle, but isn't that a different kind of thing to want it to do? Maybe another environment would work better here?
    – cfr
    Jan 8, 2016 at 3:52
  • Hmm, I suppose I could use a table.
    – JamesNZ
    Jan 8, 2016 at 4:37

1 Answer 1

4

Using an array environment may be the way to go.

enter image description here

\documentclass{article}

\usepackage{array}
\newcolumntype{L}{>{\displaystyle}l}
\newcolumntype{R}{>{\displaystyle}r}

\newcommand\ninefive{\Bigl(\frac{9}{5}\Bigr)} % shortcut macro

\begin{document}
\[
\setlength\arraycolsep{0pt}
\renewcommand\arraystretch{2}
\begin{array}{R @{{}\le{}} LL @{{}\le{}} L}
    15           &           & C & 25 \\
    \ninefive 15 & \ninefive & C & \ninefive 25 \\
    27           & \ninefive & C & 45 \\
    27 + 32      & \ninefive & C + 32 & 45 + 32 \\
    59           &           & F & 77
\end{array}
\]
\end{document}

You must log in to answer this question.

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