在引用環境中使用 TexCount 計算單字數

在引用環境中使用 TexCount 計算單字數

如何輸入新計數器來texcount計算\begin{quote} ... \end{quote}環境中的所有內容?

我嘗試了以下方法,但結果為零。

%TC:newcounter quote Number of quotes %TC:newcounter quotewords Words in quotes %TC:macro \begin{quote} [quote] %TC:macroword \begin{quote} [quotewords]

任何幫助將不勝感激!

答案1

使用指令指定環境規則%TC:envir(與 相同%TC:group

%TC:envir name [argument-rules] content-rule

%TC:macrocount然後在計算您需要使用的引用而不是環境名稱的命令中beginquote(不確定這部分的記錄情況如何)。

您需要插入的程式碼是這樣的:

%TC:newcounter quote Number of quotes
%TC:newcounter quotewords Words in quote
%TC:envir quote [] quotewords
%TC:macrocount beginquote [quote]

\begin{quote}
Text in a quote.
\end{quote}

這應該算是一個包含四個單字的引用。

相關內容