キャプションの単一インスタンスの変更

キャプションの単一インスタンスの変更

たとえば、キャプションを「方程式」ではなく「方程式」にしたいという設定があります。これを行う方法はありますか。私が持っているコードは以下の通りです。

乾杯

    \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}

ここに画像の説明を入力してください

関連情報