[Tex/LaTex] How to make set of equations appear side by side using empheq package

alignempheq

\documentclass[11pt]{article}
\usepackage[margin=.2in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{empheq}
\begin{document}

\begin{empheq}[box=\fbox]{align*}
\sin(A+B)&=\sin A\cos B+\cos A\sin B\\
\sin(A-B)&=\sin A\cos B-\cos A\sin B\\
\cos(A+B)&=\cos A\cos B-\sin A\sin B\\
\cos(A-B)&=\cos A\cos B+\sin A\sin B
\end{empheq}
\begin{empheq}[box=\fbox]{align*}
\sin(A+B)+\sin(A-B)&=2\sin A\cos B\\
\sin(A+B)-\sin(A-B)&=2\cos A\sin B\\
\cos(A-B)+\cos(A+B)&=2\cos A\cos B\\
\cos(A-B)-\cos(A+B)&=2\sin A\sin B
\end{empheq}

\end{document}

This displays the following sets of formulas:enter image description here

Here the boxes are placed in vertical order. How would I make them appear side by side?

Best Answer

Honestly I find empheq quite the overkill here.

\documentclass{article}

\usepackage[margin=.2in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage{amsmath}% or empheq, which loads mathtools, which loads amsmath

\begin{document}
Lorem ipsum dolor sit et amet.
\[
\boxed{
\begin{aligned}
\sin(A+B)&=\sin A\cos B+\cos A\sin B\\
\sin(A-B)&=\sin A\cos B-\cos A\sin B\\
\cos(A+B)&=\cos A\cos B-\sin A\sin B\\
\cos(A-B)&=\cos A\cos B+\sin A\sin B
\end{aligned}}
\quad
\boxed{
\begin{aligned}
\sin(A+B)+\sin(A-B)&=2\sin A\cos B\\
\sin(A+B)-\sin(A-B)&=2\cos A\sin B\\
\cos(A-B)+\cos(A+B)&=2\cos A\cos B\\
\cos(A-B)-\cos(A+B)&=2\sin A\sin B
\end{aligned}}
\]
Lorem ipsum dolor sit et amet.
\end{document}

enter image description here

You need an awfully small margin to fit that though...

Related Question