1

I would like to align all equations at the equal sign and center the whole set. I did the following, but it did not work.

\begin{align*}
    D_A& =D_C\\
{D_A}_0 + \Delta D_A &= {D_C}_0 + \Delta D_C\\
{D_A}_0 + {D_A}_0\alpha_A\Delta T &= {D_C}_0 + {D_C}_0\alpha_C\Delta T\\
\Delta T &= \frac{{D_C}_0 - {D_A}_0}{{D_A}_0\alpha_A - {D_C}_0\alpha_C}\\
    T &= \frac{{D_C}_0 - {D_A}_0}{{D_A}_0\alpha_A - {D_C}_0\alpha_C} + 20\\
    &= \frac{5,998-6}{6\times11\times10^{-6} - 5,998\times17\times10^{-6}} + 20\\
    &\approx 75,61\si{\degree}C
\end{align*}

What is the correct way to do it? Thanks in advance.

7
  • 2
    What does ‘it did not work’ mean exactly?
    – Bernard
    Nov 21, 2020 at 23:09
  • It did not center the equations. Nov 21, 2020 at 23:09
  • You can use alignat.
    – Sebastiano
    Nov 21, 2020 at 23:23
  • 1
    The display is centered as a whole, not with the alignment point is at the center of the page, which would anyway be impossible in this case. A tip: use \num{...} for numbers with a decimal part, doing \sisetup{output-decimal-marker={,}} in the preamble; also the last line should have \approx\SI{75,61}{\celsius}. Are you sure about {D_A}_0?
    – egreg
    Nov 21, 2020 at 23:27
  • @egreg Kind of. I tried to do a double subscript, but I wish the zero character looked a bit smaller. Nov 21, 2020 at 23:46

2 Answers 2

1

It is centred w.r.t. the margins. So if it doesn't look centred, there's something else in your code that you didn't show.

enter image description here

0

The display is centered as a whole and no attempt is made to place the alignment point at the center of the page.

It looks quite unbalanced, in my opinion. You can reduce the effect by avoiding to align equals signs that are not really related to one another, see the second display below.

A few tips: numbers with a decimal part and the comma as separator should be input with \num, which takes care of the correct spacing. Also 75,61\si{\degree}C should be

\SI{75,61}{\celsius}

For “double subscripts” the syntax is D_{A_0}.

In the following code kantlipsum is just to produce mock text for showing the text block margins.

\documentclass{article}
\usepackage{amsmath,siunitx}
\usepackage{kantlipsum}

\sisetup{output-decimal-marker={,}}

\begin{document}

\kant*[1][1-3]
\begin{align*}
D_A &= D_C\\
D_{A_0} + \Delta D_A
    &= D_{C_0} + \Delta D_C\\
D_{A_0} + D_{A_0}\alpha_A\Delta T
    &= D_{C_0} + D_{C_0}\alpha_C\Delta T\\
\Delta T
    &= \frac{D_{C_0} - D_{A_0}}{D_{A_0}\alpha_A - D_{C_0}\alpha_C}\\
T   &= \frac{D_{C_0} - D_{A_0}}{D_{A_0}\alpha_A - D_{C_0}\alpha_C} + 20\\
    &= \frac{\num{5,998}-6}{6\times11\times10^{-6} - \num{5,998}\times17\times10^{-6}} + 20\\
    &\approx \SI{75,61}{\celsius}
\end{align*}
\kant*[2][1-3]
\begin{align*}
&D_A = D_C \\
&D_{A_0} + \Delta D_A = D_{C_0} + \Delta D_C \\
&D_{A_0} + D_{A_0}\alpha_A\Delta T = D_{C_0} + D_{C_0}\alpha_C\Delta T \\[1ex]
&\Delta T = \frac{D_{C_0} - D_{A_0}}{D_{A_0}\alpha_A - D_{C_0}\alpha_C} \\[1ex]
&\begin{aligned}
T   &= \frac{D_{C_0} - D_{A_0}}{D_{A_0}\alpha_A - D_{C_0}\alpha_C} + 20\\
    &= \frac{\num{5,998}-6}{6\times11\times10^{-6} - \num{5,998}\times17\times10^{-6}} + 20\\
    &\approx \SI{75,61}{\celsius} \smash[b]{\vphantom{\frac{1}{1}}}
\end{aligned}
\end{align*}
\kant[3][1-3]

\end{document}

enter image description here

The final \smash[b]{\vphantom{\frac{1}{1}}} is meant to vertically space the \approx sign so as to approximately match the spacing between the two equals signs above it (it could be made exact, but it doesn't seem really necessary).

Some vertical space has been added between the main blocks.

You must log in to answer this question.

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