5

I am attempting to set a box around multiline equations is LaTeX using the following code:

\documentclass{article}

\usepackage{empheq}
\newcommand*\widefbox[1]{\fbox{\hspace{2em}#1\hspace{2em}}}

\begin{document}

\begin{subequations}
\begin{empheq}[box=\widefbox]{align}
z &= a + b + c + d + e + f + g + h + i + j + k \\
&\qquad\qquad + l + m + n + o + p + q + r + s \\
&\qquad\qquad + t + u + v + w + x + y
\end{empheq}
\end{subequations}

\end{document}

The problem is that the equations are automatically labelled (1a), (1b), and (1c). Since this is only one equation, how can I label the whole box simply as (1)?

5
  • align is defined by amsmath, which you don't mention. you can use split instead of align to get only one equation number. also, i'm not sure why you need subequations since there's only one. – barbara beeton Oct 10 '13 at 16:39
  • Thanks barbara. Could you state what exact lines of code would allow this? I am not sure how to generate an equation box that spans multiple lines without subequations (see tex.stackexchange.com/questions/109900/…). – Doubt Oct 10 '13 at 18:03
  • @barbarabeeton - the empheq package loads the amsmath package (and its subequations and align environments). – Mico Oct 10 '13 at 18:21
  • @Mico -- just proving that i don't use empheq enough to know that. thanks. – barbara beeton Oct 10 '13 at 19:14
  • @barbarabeeton -- I don't use it much either... – Mico Oct 10 '13 at 19:16
5

You could omit the subequations environment specifiers, change align to equation (in the supplemental argument to empheq), and use a split environment inside empheq to achieve the alignment objectives.

enter image description here

\documentclass{article}
\usepackage{empheq}
\newcommand*\widefbox[1]{\fbox{\hspace{2em}#1\hspace{2em}}}
\begin{document}

\begin{empheq}[box=\widefbox]{equation}
\begin{split}
z &= a + b + c + d + e + f + g + h + i + j + k \\
&\qquad\qquad + l + m + n + o + p + q + r + s \\
&\qquad\qquad + t + u + v + w + x + y
\end{split}
\end{empheq}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.