
共有できるテンプレートをお持ちの方はtexcount
いらっしゃいますか?
texcount
ドキュメントにオプションが参照されていることに気付きました-template="template"
。これは、texcount 出力の周囲にカスタム テキストを追加できるようにするためだと思います。Google で調べても、そのようなテンプレートがどのようなものかの例は見つかりませんでした。
私は、これを、fp
自分の文書のより物語的なスタイルの概要を報告するテンプレートを作成し、出版規則に従って単語数の計算 (例: テキスト、ヘッダー、参考文献 + 図/表/フロートごとに 100 語) を含めることなどと組み合わせてみたいと考えていました。
答え1
簡単な例を挙げると
texcount.pl example.tex -template="Words: {hword} in headers,
{word} in text, {oword} other places."
すべて 1 行に記述する必要があります。
このテンプレートを指定する別の方法は、TeX ドキュメント自体の%TC
指示を使用することです。次に、より詳細な例を示します。
%%% Template using new format (version 3 and on)
%TC:newtemplate
%TC:template Word count (text+headers+other):
%TC:template {text}+{headerword}+{otherword} = {sum}\n
%TC:template Element count (head+float+inline+dsmath):
%TC:template {header}+{float}+{inline}+{displaymath}\n
%TC:template Subcounts{SUB?: {sum}?SUB}
\n
は明示的に指定する必要がある行シフトを示すことに注意してください。
テンプレートとその他のオプションを別のオプションファイルで指定することもできます。これは大きなテンプレートの場合に便利な場合があります。たとえば、次のような内容のファイルを作成するとします。
# Use as sum count: text words + header words + other words
-sum=1,1,1
# Output template
-template=
\<ul class=count>\n
\<li class=header>{title}</li>\n
\<li>Word count: {sum}</li>\n
\<li>Equations: {inline} inline, {ds} displayed</li>\n
\{float?<li>Floats: {float}</li>\n?float}
\{SUB?<li>Subcounts:</li><span class=subcount>\n
\| <li>{sum} words in {title}</li>\n
\|</span>\n?SUB}
\{file?<li>Number of files in all: {file}</li>?file}\n
\</ul>\n
オプションを使用して含めることができます-opt=
。これにより、HTML タグを使用してカウントが出力されます。SUB
セクションではサブカウントが提供されます。
これらの例が実験の出発点となることを願っています。