Pocet znaku.

David Necas (Yeti) yeti at physics.muni.cz
Sat Apr 2 12:51:41 CEST 2005


On Sat, Apr 02, 2005 at 11:32:46AM +0200, Petr Ruzicka wrote:
> Chtel bych se zeptat jak se v TeXu/LaTeXu zjistuje pocet napsanych znaku
> a jine statiskiky o dokumentu. Ted samozrejme nemam na mysli zjistovani
> udaju z pdf/ps/dvi, ale ze zdrojaku (*.tex). Dalsimi statistikami myslim
> napriklad pocet stranek, obrazku tabulek atd. Tim samozrejme nemyslim,
> ze dokument prelozim a spocitam v nejakem prohlizeci.

Bez prekladu to nejde. Jak zjistite bez prekladu, kolik
stran ma nasledujici dokumment v plainu?

\newcount\level\level=5
\def\a{\noexpand\a\noexpand\a\noexpand\b\noexpand\b\noexpand\c}
\def\b{\noexpand\b\noexpand\c\noexpand\a}
\def\c{\noexpand\b\noexpand\a\noexpand\a\noexpand\b}
\def\next{\ifnum\level>0\edef\x{\x}\advance\level-1
  \else\xdef\x{\x}\let\next\relax\fi\next}
\def\x{\a}\next\def\a{Pika }\def\b{Chu }\let\c=\par\parindent=0pt\x
\bye

A ted neco trochu konstruktivnejsiho... Pocet stran zjistite
z logu, kam tex napise neco jako

    Output written on dokument.dvi (59 pages, 352860 bytes).

U *latexoveho* dokumentu zjistite pocet obrazku

    grep -c '^\\@writefile{lof}' dokument.aux

analogicky s lot pro tabulky. U plainu obecne nijak, zalezi
na tom, jaka makra si autor napsal.

Yeti


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?



More information about the csTeX mailing list