lncs - 特定の環境のカウンターを変更する

lncs - 特定の環境のカウンターを変更する

私はドキュメントクラスを使用しておりllncs、環境「コメント」のカウンターを設定する必要があります\begin{remark} ... \end{remark}備考1ドキュメント内のどこにいても。

どうすればいいでしょうか? 新しいカウンターを定義して、remarkそれを強制的に使用することは可能ですか?

追伸 Iいけない新しい環境を定義する

編集

申し訳ないですが、うまく説明できなかったかもしれません。私は修理コメントのカウンターは常に1になるようにしたい。始める1から始まり、その後は普通に増加します。最初のコメントは備考12番目は備考2などです。現状では、コメント環境が定理や系などとカウンターを共有しているようですが、これは望ましくありません。

MWE は次のとおりです。

\documentclass[11pt,envcountsame,a4paper]{llncs}

\usepackage[english]{babel}
\usepackage{url}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{hyperref}

\numberwithin{theorem}{section}
\numberwithin{lemma}{section}
\numberwithin{definition}{section}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{corollary}{section}


\linespread{1.2}

\begin{document}

\section{My first section}

\begin{theorem}
Here I state a very interesting theorem
\end{theorem}

\begin{lemma}
Here I state a very interesting lemma
\end{lemma}

\begin{definition}
Here I state a very interesting definition
\end{definition}

\begin{remark}
And here I would like to state a very interesting remark, numbered as Remark 1
\end{remark}


\end{document}

答え1

アップデート

envcountsameドキュメント クラス オプションが指定されている場合、llncs定義されたすべての定理はtheoremカウンターを共有カウンターとして使用します。

ここで、envcountsameは を有効にして\newaliascntエイリアス カウンタを定義し、次に (この質問に関連) がすでに存在するかどうかを確認します。から\c@remark切り離すには、を編集して新しいカウンタとして再定義する必要があります。remarktheorem\c@remark\relax

\documentclass[envcountsame]{llncs}


\makeatletter
\if@envcntsame
\let\c@remark\relax
\newcounter{remark}
\fi
\makeatother

\begin{document}

\begin{remark}
A remark
\end{remark}

\begin{theorem}
Foo
\end{theorem}

\begin{theorem}
Another Foo
\end{theorem}
\begin{remark}
  Another remark
\end{remark}

\begin{remark}
Yet another remark
\end{remark}



\begin{remark}
And now another counter value for remark after resuming
\end{remark}


\end{document}

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

古いもの...

カウンターを1に設定するのが便利かどうか疑問ですremarkが、ここに方法があります\AtBeginEnvironment

\documentclass{llncs}

\usepackage{xpatch}

\AtBeginEnvironment{remark}{\setcounter{remark}{0}}

\begin{document}

\begin{remark}
A remark
\end{remark}

\section{Foo}

\begin{remark}
  Another remark
\end{remark}

\begin{remark}
Yet  Another remark
\end{remark}


\end{document}

もう一つの可能​​性使用方法xassoccntとそのSuspend特徴

\documentclass{llncs}

\usepackage{xassoccnt}

\setcounter{remark}{1} % Set it to 1 
\SuspendCounters{remark} % suspend it 

\begin{document}

\begin{remark}
A remark
\end{remark}

\section{Foo}

\begin{remark}
  Another remark
\end{remark}

\begin{remark}
Yet another remark
\end{remark}

\ResumeSuspendedCounters{remark}


\begin{remark}
And now another counter value for remark after resuming
\end{remark}


\end{document}

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

答え2

これはまったく意味のない要件のように思えます。では、なぜ数字を使用するのでしょうか? ただし、次のことが必要な場合:

\documentclass{llncs}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}

\renewcommand\theremark{1}
\begin{document}
\begin{remark}
abc
\end{remark}

\begin{remark}
abc
\end{remark}

\end{document}

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

関連情報