Math & Sciencesubcaption for floated equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am

subcaption for floated equation

Post by magical marshmallow »

Hi,

I have a number of equations in my thesis, a few of which need text in a subcaption. At the moment, I can't get this to work and really I've no idea where to start. At the moment, this is what I have....
Rather than this, would I be better using say minipage for example?

Any help appreciated

Code: Select all

\documentclass{scrreprt}
\usepackage{amsmath}
\usepackage{aliascnt}%Counter and float caption for Equations
		\newaliascnt{eqnfloat}{equation}
		\newfloat{eqnfloat}{h}{eqflts}
		\floatname{eqnfloat}{Equation}
		\newcommand*{\ORGeqnfloat}{}
		\let\ORGeqnfloat\eqnfloat
\def\eqnfloat{%
  \let\ORIGINALcaption\caption
  \def\caption{%
    \addtocounter{equation}{-1}%
    \ORIGINALcaption
  }%
  \ORGeqnfloat
}
\begin{document}
\begin{eqnfloat}
\centering
\begin{equation}
A=B+C
\end{equation}
\subcaption{some subcaption text}
\hfill
\begin{equation}
D=E+F
\end{equation}
\subcaption{some other text}
\caption{overall caption}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply