TeX 文字数カウント

アブストとか書くと文字数を数えておいたほうがよくて、さらにいうと文書中に埋め込めれている方が嬉しい。ということでメモ。

文字数を数えるLaTeXマクロ | Sukarabe's Easy Livingを参考にした。

\makeatletter
\def\WordCount#1{%
  \@tempcnta\z@
  \@tfor \@tempa:=#1\do{\advance\@tempcnta\@ne}%
  \begin{quote}#1\end{quote}
  \the\@tempcnta 文字
}
\makeatother