3

I am using the answer to the question bracket in subequations but my equation is too long and the equation numbering is failing as shown in the MWE (modified from the MWE given in the question).

I am looking for a work around: usually when an equation is too long the number is put on the line just below, but equation by equation, not for the whole set as it does here. enter image description here

\documentclass{article}
\usepackage{empheq}

\begin{document}

\begin{subequations}
  \begin{empheq}[left=\empheqlbrace]{align}
    x &  = y + z\\
    a^{2} &  =  b^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} 
  \end{empheq}
\end{subequations}

\end{document}
2
  • 1
    As the empheq documentation says empheq is not designed to look good with wide data. Rewrite your equation
    – daleif
    Apr 8, 2020 at 16:46
  • Yes, I don't know why they are here, I think they come from inserting the picture. They are not part of the initial code (which result is the attached pictue). I will edit it.
    – c05772
    Apr 8, 2020 at 16:49

3 Answers 3

6

It seems to me that this is a case where the long line could usefully be broken.

\documentclass{article}
\usepackage{empheq}

\begin{document}

\begin{subequations}
  \begin{empheq}[left=\empheqlbrace]{align}
    x &  = y + z\\
    a^{2} &  = \begin{aligned}[t]
             &  b^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} \\
             &  + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2}    
            \end{aligned}
  \end{empheq}
\end{subequations}

\end{document}

output of example code

EDIT
Here is a version with the second equation number on the last line. It's more artificial, and doesn't keep the logical structure together (so it would not be a good model for a screen reader if that is working from the code), but looks okay printed out.

\documentclass[tbtags]{article}
\usepackage{empheq}

\begin{document}

\begin{subequations}
  \begin{empheq}[left=\empheqlbrace]{align}
    x &  = y + z\\
    a^{2} &  =  b^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} \notag \\
          & \phantom{{}={}} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2}
  \end{empheq}
\end{subequations}

\end{document}

output of example code

2
  • I think this is the best solution, though I would prefer the label on the third line instead of the second one.
    – c05772
    Apr 8, 2020 at 21:30
  • Yes, I agree about the placement of the second label. It's not obvious how to do that (it's not automatic, obviously); I'll think about it. Apr 8, 2020 at 21:35
2

As usual I hope to have understood your request. I have deleted double \ \ from by initial code. I have used \usepackage[margin=2cm]{geometry} to decrease the margins of the papersize. Look the screenshot and if it is fine.

\documentclass[12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath}
\usepackage{empheq}

\begin{document}

\begin{subequations}
  \begin{empheq}[left=\empheqlbrace]{align}
    x &  = y + z\\
    a^{2} &  =  b^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} 
  \end{empheq}
\end{subequations}

\end{document}

enter image description here

4
  • It's not usually a good idea to increase the text width by changing the margins. If an author is preparing a manuscript for publication in a journal, this will only result in either the manuscript being returned to the author by the journal editorial staff for shortening too-wide lines, or modification of the too-wide lines by the journal staff with a result that may not be acceptable to the author. The author should be the authority for making such decisions. Apr 8, 2020 at 19:28
  • @barbarabeeton The user has not given others data hence...I have increased the margins. As usual there is not problem to delete my answer. When you read my comment, please write it down so I can delete it.
    – Sebastiano
    Apr 8, 2020 at 19:33
  • No, don't delete the answer. If the author is simply preparing a document for their own use, it probably doesn't matter, and the OP wasn't specific. (I worked for many years as a member of a publisher's production staff, and tend to interpret questions from that bias.) Apr 8, 2020 at 19:38
  • @barbarabeeton No, we're not in court :-) for your details :-) I'm just a modest user and I approve what is objectively correct.
    – Sebastiano
    Apr 8, 2020 at 19:42
2

With witharrows, you may have the following result, but it's not enthousiastic:

\documentclass{article}
\usepackage{witharrows}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}

\lipsum[1]
%
\begin{DispWithArrows}<>[subequations]
x &  = y + z\\
a^{2} &  =  b^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} + c^{2} +
c^{2} + c^{2}
\tagnextline 
\end{DispWithArrows}

\end{document}

Result of the above code

4
  • Very kind, but is there an image? I see only a blank space. I have compiled your code and there is any anomaly. Best regards.
    – Sebastiano
    Apr 8, 2020 at 17:09
  • You mean an image on my post on TeX StackExchange? On my computer, I see the picture of the result. Apr 8, 2020 at 17:20
  • Now I see also. Before I see a blank space.
    – Sebastiano
    Apr 8, 2020 at 17:32
  • I agree, it works but now the bracket is too long. Now, I did not know this package so it is a useful answer.
    – c05772
    Apr 8, 2020 at 21:31

You must log in to answer this question.

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