1

Using the subequations module, I have created a set of equations labeled 1a, 1b and 1c. I now wish to refer to them collectively as (1) in subsequent text. Here's my code copied from the LyX file:

\begin_layout Standard
\begin_inset Flex Subequations
\label{eq:ReferToAll}
status open


\begin_layout Plain Layout
\begin_inset Formula 
\begin{align}
w_{1} & =1\label{eq:Ref1}\\
w_{2} & =2\label{eq:Ref2}\\
w_{3} & =3\label{eq:Ref3}
\end{align}

\end_inset

\end_layout

I can refer to these equations as (1a) - (1c) using Ref1 and Ref3. That's easy. But I want to refer to the three equations collectively as (1) and I'm having trouble doing so.

Following a suggestion I found on the web, I added the label {eq:ReferToAll} just after Subequations using a text editor (I couldn't figure out how to add it in LyX) but I don't see ReferToAll in the list of available references when I try and insert a cross-reference.

What am I doing wrong, and how can I achieve my goal in LyX?

Thanks in advance

Thomas Philips

  • The way you added the label \label{eq:ReferToAll} should work. Is the code you provided copied directly from the LaTeX source panel? – Ruixi Zhang Sep 20 '18 at 1:29
  • Use the subsequations environment in amsmath. – Alan Sep 20 '18 at 1:34
  • It is copied from the text file - oddly enough I don't see the ReferToAll reference when I view the code in the LaTeX source panel in LyX – Thomas Philips Sep 20 '18 at 1:50
  • Also, I have loaded amsmath, but don't see anything to do with subequations (I can add AMS align environments for example without any problem) – Thomas Philips Sep 20 '18 at 1:52
1

Solved it! The secret is to place the cursor inside the subequation box but before any of the subequations. I could then insert an equation label which refers to the entire equation. The TeX code looks like this

\begin_layout Standard
\begin_inset Flex Subequations
status open

\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "eq: ReferToAll"

\end_inset


\begin_inset Formula 
\begin{align}
w_{1} & =1\label{eq:Ref1}\\
w_{2} & =2\label{eq:Ref2}\\
w_{3} & =3\label{eq:Ref3}
\end{align}

\end_inset

\end_layout

So my earlier attempt was missing a few lines of needed code (\begin_inset CommandInset label etc. etc.).

Once I realized that I had to poke delicately around the subequation for just the right spot to insert the label for the overall equation, I was able to get it to work.

Thomas Philips

| improve this answer | |

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.