- Sharing float (fig) and thm counter can be done with
\newtheorem{theorem}[figure]{Theorem}
. - Correctly ordering float (fig) counter based on actual location in the PDF (as opposed to location in source code) can be done with
\MakeSorted{figure}
fromperpage.sty
. - Sharing float (fig) and eqn counter can be done with
\makeatletter\let\c@equation\c@figure\makeatother
.
I can do 1 and 2 together (see mwe-b). I can do 1 and 3 together (see mwe-c). But I can't do all three together (see mwe-d).
Partial/fake solution. I can skirt the issue by making a myeqn
environment (see mwe-a).
Question. Is there an actual solution that allows you to keep the equation
environment? Maybe one can resolve the clash in mwe-d by swapping \c@figure
out for something (based on the precise implementation of perpage.sty
)? Any help would be greatly appreciated!
%% MWE-A
\documentlass{article}
\usepackage{blindtext}
\newtheorem{theorem}[figure]{Theorem} %1
\usepackage{perpage}\MakeSorted{figure} %2
\newenvironment{myeqn}
{\stepcounter{figure}\hfill\begin{math}}
{\end{math}\hfill(\arabic{figure})}
\begin{document}
\begin{theorem}\blindtext\end{theorem}
\begin{figure}\blindtext\caption{Caption}\end{figure}
\begin{myeqn}a^2+b^2=c^2\end{myeqn}
\end{document}
%% MWE-B
\documentclass{article}
\usepackage{blindtext}
\newtheorem{theorem}[figure]{Theorem} %1
\usepackage{perpage}\MakeSorted{figure} %2
\begin{document}
\begin{theorem}\blindtext\end{theorem}
\begin{figure}\blindtext\caption{Caption}\end{figure}
\begin{equation}a^2+b^2=c^2\end{equation}
\end{document}
%% MWE-C
\documentclass{article}
\usepackage{blindtext}
\newtheorem{theorem}[figure]{Theorem} %1
\makeatletter\let\c@equation\c@figure\makeatother %3
\begin{document}
\begin{theorem}\blindtext\end{theorem}
\begin{figure}\blindtext\caption{Caption}\end{figure}
\begin{equation}a^2+b^2=c^2\end{equation}
\end{document}
%% MWE-D
\documentclass{article}
\usepackage{blindtext}
\newtheorem{theorem}[figure]{Theorem} %1
\usepackage{perpage}\MakeSorted{figure} %2
\makeatletter\let\c@equation\c@figure\makeatother %3
\begin{document}
\begin{theorem}\blindtext\end{theorem}
\begin{figure}\blindtext\caption{Caption}\end{figure}
\begin{equation}a^2+b^2=c^2\end{equation}
\end{document}