我有一个设置,例如,我需要将标题改为“方程式”而不是“方程式”。有没有办法做到这一点?我的代码如下
干杯
\documentclass{scrreprt}
\usepackage[english]{babel}
\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}
{eqnfloat}[!ht]
\begin{eqnarray}
A=B+C \label{eqn:1}\\
B=X+Y \label{eqn:2}
\end{eqnarray}
\caption{Some caption}
\labeL{eqn:1+2}
\end{eqnfloat}
\end{document}
答案1
将应该标有“方程式”标题的方程式用一对括起来,并在启动浮动环境之前\begingroup...\endgroup
使用语句。它只会针对这组特殊的方程式进行更改。\floatname{eqnfloat}{Equations}
\documentclass{scrreprt}
\usepackage{float}
\usepackage[english]{babel}
\usepackage{aliascnt}%Counter and float caption for Equations
\usepackage{caption}
\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}
\begingroup
\floatname{eqnfloat}{Equations}
\begin{eqnfloat}[!ht]
\begin{eqnarray}
A=B+C \label{eqn:1}\\
B=X+Y \label{eqn:2}
\end{eqnarray}
\caption{Some caption}
\label{eqn:1+2}
\end{eqnfloat}
\endgroup
\begin{eqnfloat}[!ht]
\begin{eqnarray}
A=B+C \label{eqn:3}\\
B=X+Y \label{eqn:4}
\end{eqnarray}
\caption{Some caption}
\label{eqn:3+4}
\end{eqnfloat}
\end{document}