Списки маркировки и уравнения противоречат друг другу

Списки маркировки и уравнения противоречат друг другу

У меня есть раздел, в котором я описываю списки с помощью:

\renewcommand{\labelenumi}{\arabic*{enumi}.}

и уравнения с:

\renewcommand{\theequation}{\labelenumi-\arabic{equation}}

Итак, конечно, нумерация моих уравнений в конечном итоге выглядит так:

1.-1

Но я бы предпочел обозначить свои списки как 1., 2. и 3., а уравнения как 1-1, 1-2 и 1-3. Есть ли способ сделать это?

мвд:

\documentclass[fleqn]{book}
\usepackage{enumitem}

\begin{document}

\textbf{PROBLEMS}
\renewcommand{\labelenumi}{\arabic*{enumi}.}
\renewcommand{\theequation}{\labelenumi-\arabic{equation}}

\begin{enumerate}[label=\arabic*.]
\setcounter{equation}{0}
%%1%%
\item Consider:

\begin{equation}\label{eq: 5.1.1}
a \times b = c
\end{equation}

\begin{equation}\label{eq: 5.1.2}
a = \sqrt{bc}
\end{equation}

\setcounter{equation}{0}
%%2%%
\item  Another problem.
\end{enumerate}
\end{document}

решение1

Вместо

\renewcommand{\theequation}{\labelenumi-\arabic{equation}}

вы можете использовать

\renewcommand{\theequation}{\arabic{enumi}-\arabic{equation}}

Код:

\documentclass[fleqn]{book}
\usepackage{enumitem}

\begin{document}

\textbf{PROBLEMS}
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\theequation}{\arabic{enumi}-\arabic{equation}}

\begin{enumerate}[label=\arabic*.]
\setcounter{equation}{0}
%%1%%
\item Consider:

\begin{equation}\label{eq: 5.1.1}
a \times b = c
\end{equation}

\begin{equation}\label{eq: 5.1.2}
a = \sqrt{bc}
\end{equation}

\setcounter{equation}{0}
%%2%%
\item  Another problem.
\end{enumerate}
\end{document}

введите описание изображения здесь

решение2

amsmathСначала вам следует использовать . Затем вы можете использовать enumitemвозможности :

\documentclass[fleqn]{book}
\usepackage{amsmath}
\usepackage{enumitem}

\newenvironment{enumeq}
 {\renewcommand{\theequation}{\arabic{enumi}-\arabic{equation}}%
  \begin{enumerate}[label=\arabic*.,before=\changeitem]}
 {\end{enumerate}}

\newcommand{\changeitem}{%
  \let\ORIitem\item
  \renewcommand\item{%
    \setcounter{equation}{0}%
    \ORIitem
  }%
}


\begin{document}

\textbf{PROBLEMS}

\begin{enumeq}
\item Consider:
\begin{gather}
a \times b = c
\label{eq: 5.1.1}
\\
a = \sqrt{bc}
\label{eq: 5.1.2}
\end{gather}

\item  Another problem
\begin{equation}
 a=b
\end{equation}
\end{enumeq}

Here are the references: \eqref{eq: 5.1.1} and \eqref{eq: 5.1.2}

\end{document}

введите описание изображения здесь

Связанный контент