\chapter{\TeX} % 第八章
■ このスレッドは過去ログ倉庫に格納されています
0240名無しさん@お腹いっぱい。
2012/02/24(金) 21:59:10.97でもマルチポストなので肝心なところは秘密です。
あー、みんなにお披露目したかったのに、残念。
クラスオプションに draft を指定したときだけカウントして、
単語ごとに小さく通し番号を印字するようにしてみた。
%\documentclass{article}
\documentclass[draft]{article}
\newenvironment{countwords}{
#### ここは秘密 ####
}{\par
There are \thewords\ words.
}
\def\shownumbers{%
\stepcounter{words}%
\vbox to 0pt {\kern1pt
\hbox to 0pt{\hss\tiny\thewords}
\vss}}
\newcounter{words}
\begin{document}
\begin{countwords}
The quick brown fox jumps over the lazy dog. The quick brown fox
jumps over the lazy dog, The quick brown fox jumps over the lazy dog.
\end{countwords}
% 結果は There are 27 words. と出た。
\end{document}
■ このスレッドは過去ログ倉庫に格納されています