Math & Science ⇒ Subequations within Align/Gather environment
-
- Posts: 2
- Joined: Wed Jan 19, 2011 3:24 pm
Subequations within Align/Gather environment
I'm trying to have the situation as below:
my first equation ... (1)
my second equation .. (2)
my third equation ... (3a)
my fourth equation .. (3b)
my fifth equation ... (4)
and would like these all in the same align environment so as to not require the need to manually remove whitespace.
Obviously one 'solution' is
\begin{align}
first equation\\
second equation
\end{align}
\begin{subequations}
\begin{align}
third equation\\
fourth equation
\end{align}
\end{subequations}
\begin{align}
fifth equation
\end{align}
but as mentioned, this is not desirable as the whitespace would need to be played around with. Is there a known way to include subequations inside align tags?
Many thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Subequations within Align/Gather environment
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\newcounter{subeq}
\renewcommand{\thesubeq}{\theequation\alph{subeq}}
\newcommand{\newsubeqblock}{\setcounter{subeq}{0}\refstepcounter{equation}}
\newcommand{\mysubeq}{\refstepcounter{subeq}\tag{\thesubeq}}
\begin{document}
\begin{align}
1+1&=2\\
2+2&=4\\
\newsubeqblock
\mysubeq 3+3&=6 \\
\mysubeq 3+3&=4+2 \\
4+4&= 8
\end{align}
\end{document}
-
- Posts: 2
- Joined: Wed Jan 19, 2011 3:24 pm
Re: Subequations within Align/Gather environment
-
- Posts: 1
- Joined: Wed Feb 26, 2014 4:54 am
Re: Subequations within Align/Gather environment
How can you label a complete subeqblock? Something like the following (that doesn't work):
\begin{document}
\begin{align}
1+1&=2\\
2+2&=4\\
\newsubeqblock\label{eq:block}
\mysubeq 3+3&=6 \\
\mysubeq 3+3&=4+2 \\
4+4&= 8
\end{align}
\end{document}
This is reference to a complete subeqblock \eqref{eq:block}