
私はドキュメントクラスを使用しており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
切り離すには、を編集して新しいカウンタとして再定義する必要があります。remark
theorem
\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}