3

I am trying to figure out the syntax for generating a set of left-aligned, boxed equations with aligned equals signs for presenting some results. After trying many combinations of methods, this is the closest I've gotten:

\documentclass[12pt]{report}

\usepackage{enumitem} \usepackage{empheq}

\setlength{\parindent}{0pt} \setlength{\fboxsep}{6pt}

\begin{document}

\begin{itemize}
    \item[1a.]
        here's some text

        $some=math$

        \begin{empheq}[box=\fbox]{align*}
            R_{b1} &= 12\Omega\\
            R_{b2} &= 123\Omega\\
            R_c &= 1234\Omega\\
            R_{ee} &= 12345\Omega
        \end{empheq}

\end{itemize}

\end{document}

This results in the following (colored lines and arrow added). not left aligned box

I would like to left align the box as shown so it fits with the rest of the text on the page. I found this answer, which suggests adding fleqn to \documentclass. However, this still leaves the box floating an odd distance away from the bottom and left edges of the preceding text.

odd margin

How can I left align my box without this weird space?

1 Answers1

5

... syntax for generating a set of left-aligned, boxed equations with aligned equals signs

I would like to suggest that you load the amsmath package and employ its boxed macro and aligned environment.

enter image description here

\documentclass[12pt]{report}
\usepackage{amsmath}
\setlength{\fboxsep}{6pt} % default: 3pt

\begin{document} \begin{enumerate} \item Hello world.

          $\boxed{\begin{aligned}
            R_{b1} &= 12\Omega    \\
            R_{b2} &= 123\Omega   \\
            R_c    &= 1234\Omega  \\
            R_{ee} &= 12345\Omega
          \end{aligned}}$
\end{enumerate}   

\end{document}

Mico
  • 506,678
  • 2
    +1, perhaps it would encourage the OP to use the siunitx package for writing of quantities: R_{b1} &= \qty{12}{\ohm} ;-)` – Zarko Jan 12 '22 at 08:02
  • 1
    @Zarkoi - Thanks! :-). At one point, while I was writing this answer, I did think about adding some thoughts regarding the typesetting of scientific quantities with the help of the machinery of the siunitx package. But then I decided against it, because I judged that it would address a point that’s related only tangentially to the OP’s query. – Mico Jan 12 '22 at 08:53