1

How can I vertically align multiple equations with equal signs?

In the following code, the white space before and after the equal symbol in each line is not correctly aligned. Also, the right parts of the equations need to be vertically aligned. Thus, I used lots of \quad and \qquad, but it still needs to be perfectly aligned. Finally, I tried to make a table but was not successful. How can I fix it?

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}

\sisetup{inter-unit-product=\ensuremath{{}\cdot{}}}

\newenvironment{makebold}{\boldmath\sisetup{detect-all}}{\ignorespacesafterend}

\begin{document}

\begin{makebold}
\[
 {10 \log_{10} \frac{\frac{V_1^2}{R}}{\frac{V_0^2}{R}} \quad = \quad 10 \log_{10} \frac{V_1^2}{V_0^2}}
 \]
 \[
{\qquad \qquad \qquad \quad \quad= \quad 10 \log_{10} (\frac{V_1}{V_0})^2}
\]
 \[
{\qquad \qquad \quad \quad \quad= \quad 20 \log_{10} \frac{V_1}{V_0}}
\]
\end{makebold}

\end{document}
4
  • Does this help?overleaf.com/learn/latex/…
    – Slurp
    Commented Dec 31, 2022 at 23:30
  • Thank you very much for your comment!
    – prko
    Commented Dec 31, 2022 at 23:57
  • Don't overuse boldface…
    – egreg
    Commented Jan 1, 2023 at 0:01
  • There are times when $a/b$ is much better than $\frac{a}{b}$. Commented Jan 1, 2023 at 18:10

1 Answer 1

0

I would use the align* environment, e.g.:

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}

\sisetup{inter-unit-product=\ensuremath{{}\cdot{}}}

\newenvironment{makebold}{\boldmath\sisetup{detect-all}}{\ignorespacesafterend}

\begin{document}

\begin{makebold}
\begin{align*}
10 \log_{10} \frac{\frac{V_1^2}{R}}{\frac{V_0^2}{R}} &= 10 \log_{10} \frac{V_1^2}{V_0^2}
\\
                                                     &= 10 \log_{10} (\frac{V_1}{V_0})^2
\\
                                                     &= 20 \log_{10} \frac{V_1}{V_0}
\end{align*}
\end{makebold}

\end{document}

enter image description here

1
  • Thank you very much for your answer!
    – prko
    Commented Dec 31, 2022 at 23:57

You must log in to answer this question.

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