Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can we count words in a Tex document?

103 views
Skip to first unread message

Charles Cariou

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to
Hello,

I have written a Latex2e document on a UNIX station, and I would like to
know the number of words in this document. Is it possible with the emacs
or xemacs editor (version 3.1416), or is there a UNIX command for it?

Thank you for responding on my personal email too.

Bye.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles...@insa-rouen.fr
Tel: 02.32.95.97.54
Fax: 02.32.95.97.10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

George R. Barrett

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to Charles Cariou
The unix command "wc" will give you number of lines, words and
characters in your document. This will also include the LaTeX commands,
so if you want a more accurate count, then use "detex" first to produce
a file with only text and no commands.

Frank Ecke

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to
On Tue, 08 Dec 1998, Charles Cariou <cca...@insa-rouen.fr> spake thuswise:

> I have written a Latex2e document on a UNIX station, and I would like to
> know the number of words in this document. Is it possible with the emacs
> or xemacs editor (version 3.1416), or is there a UNIX command for it?

Under Unix, you will want to look at ``detex'' and ``wc'' (yes, they have
man-pages) and pipe them together as in

detex document.tex | wc -w


Hope this helps,

Frank

--
Frank Ecke <fra...@minet.uni-jena.de>


In a world without walls and fences, who needs windows and gates?

David Carlisle

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to fra...@minet.uni-jena.de
fra...@minet.uni-jena.de (Frank Ecke) writes:

Are you sure that that works ?

I just tried it on the plain tex document below, but did
not get anything like the number of words that I get by counting the
words in the output.

David

====== cut here


\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP
A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP
AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfi
Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx
:76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL
RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse
B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI
I71Fo71dPA!!FRgiePBt'el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;
;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%
s$;z zLqs'.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G
LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.'oL.Rtrul;e
doTsW,Wk;Rri@stW aHAHHFndZPqpa.rtMRrgeLinZ.irLtYer.W,:jbye

Ben Gorte

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to
> \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
> PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP
> A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP
> AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfi
> Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx
> :76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL
> RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse
> B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI
> I71Fo71dPA!!FRgiePBt'el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;
> ;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%
> s$;z zLqs'.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G
> LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.'oL.Rtrul;e
> doTsW,Wk;Rri@stW aHAHHFndZPqpa.rtMRrgeLinZ.irLtYer.W,:jbye

I am astonished, full of admiration, even touched.

But really. No words.

Ben

Alan Shutko

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to
>>>>> "D" == David Carlisle <dav...@nag.co.uk> writes:

D> I just tried it on the plain tex document below, but did not get
D> anything like the number of words that I get by counting the words
D> in the output.

The original question wasn't about plain TeX, it was about LaTeX. So
there. 8^P

--
Alan Shutko <a...@acm.org> - By consent of the corrupted
IBM: U can buy better, but U can't pay more

Alan Shutko

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to
>>>>> "D" == David Carlisle <dav...@nag.co.uk> writes:

D> \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF

Wow. I just ran that through TeX. I'm scared now. (I always thought
it was pear, though....)

--
Alan Shutko <a...@acm.org> - By consent of the corrupted

Chicken Little only has to be right once.

David Carlisle

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to Alan Shutko
Alan Shutko <a...@acm.org> writes:

>
> >>>>> "D" == David Carlisle <dav...@nag.co.uk> writes:
>
> D> \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
>
> Wow. I just ran that through TeX. I'm scared now. (I always thought
> it was pear, though....)
>


Arggggggggggggggggggggg Damn, I wonder if I should have run the document
through a style checker....

update coming up:-)

David

Louis Vosloo

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to
Wonderful! Is this for the `obfuscated TeX contest'?

David Carlisle wrote:
>
> \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF

> PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP
> A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP
> AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfi
> Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx
> :76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL
> RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse
> B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI
> I71Fo71dPA!!FRgiePBt'el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;
> ;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%
> s$;z zLqs'.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G
> LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.'oL.Rtrul;e

> doTsW,Wk;Rri@stW aHAHHFndZPpqar.tridgeLinZpe.LtYer.W,:jbye

Donald Arseneau

unread,
Dec 10, 1998, 3:00:00 AM12/10/98
to
In article <m3n24vs...@hubert.wuh.wustl.edu>, Alan Shutko <a...@acm.org> writes...

>>>>>> "D" == David Carlisle <dav...@nag.co.uk> writes:
>
>D> \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
>
>Wow. I just ran that through TeX. I'm scared now. (I always thought
>it was pear, though....)

Obviously the spell chequer failed.

Donald Arseneau as...@triumf.ca

David Carlisle

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to Alan Shutko

\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF

Simon Cozens

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
Alan Shutko (comp.text.tex):

>>>>>> "D" == David Carlisle <dav...@nag.co.uk> writes:

> D> \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF

> Wow. I just ran that through TeX. I'm scared now.

Yes, and I thought Perl was bad enough. I will study this, and I will
understand it. First I will understand `how.' Then I will have a go at
`why.'


--
God is real, unless declared integer.

David Carlisle

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to Louis Vosloo
Louis Vosloo <sup...@YandY.com> writes:

> Wonderful! Is this for the `obfuscated TeX contest'?

What do you mean `obfuscated' ? All my documents look like that.
This is high level markup.

David

Keith Refson - real email address in signature

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
David Carlisle <da...@dcarlisle.demon.co.uk> writes:

> \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF

I think it's time to come clean David. This must be an "easter egg" in
TeX. How did you find out about it :)

Keith Refson


--
------------------------------------------------------------------------------
Email: Keith.Refson@ | Tel: +44 1865 272026 | Dr Keith Refson, |
earth.ox.ac.uk | Fax: +44 1865 272072 | Dept of Earth Sciences |
| Parks Road, Oxford OX1 3PR, UK|
------------------------------------------------------------------------------

David Carlisle

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
rub...@bounce.com (Keith Refson - real email address in signature) writes:

> David Carlisle <da...@dcarlisle.demon.co.uk> writes:
>
> > \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
>
> I think it's time to come clean David. This must be an "easter egg" in
> TeX. How did you find out about it :)
>
> Keith Refson

It can't be an easter egg. Wrong season.

David

Frank Ecke

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
On 10 Dec 1998, David Carlisle <dav...@nag.co.uk> spake thuswise:

> Are you sure that that works ?
>

> I just tried it on the plain tex document below, but did

> not get anything like the number of words that I get by counting the
> words in the output.

;-)

What about

tex document.tex
dvi2tty document.dvi | wc -w

Donald Arseneau

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
In article <yg4emq7...@openmath.nag.co.uk>, David Carlisle <dav...@nag.co.uk> writes...

>rub...@bounce.com (Keith Refson - real email address in signature) writes:
>> I think it's time to come clean David. This must be an "easter egg" in
>> TeX. How did you find out about it :)
>
>It can't be an easter egg. Wrong season.

What? Isn't that when the December release of LaTeX comes out? :->

Donald Arseneau as...@triumf.ca

Robin Fairbairns

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
In article <87af0vi...@dcarlisle.demon.co.uk>,

David Carlisle <da...@dcarlisle.demon.co.uk> wrote:
>
>\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
>[etc.]

am i to consider this a ctan submission?

proposed location, perhaps, macros/plain/contrib/xii.tex
--
Robin Fairbairns, Cambridge

Maurizio Loreti

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
as...@reg.triumf.ca (Donald Arseneau) writes:

No. These are "Christmas eggs". (Or were them "Christmas fools"? :-)

--
Maurizio Loreti http://wwwcdf.pd.infn.it/~loreti/mlo.html
Un. of Padova, Dept. of Physics - Padova, Italy lor...@padova.infn.it

Thierry Bouche

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
David Carlisle <dav...@nag.co.uk> writes:

> What do you mean `obfuscated' ? All my documents look like that.
> This is high level markup.

Are you _the_ davidc that had everybody whining here about poor old
blind people trying to read badly typed latex source with Aster?

--
Thierry Bouche, Grenoble.

David Carlisle

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
Thierry Bouche <Thierry...@ujf-grenoble.fr> writes:

No. A completely different person. You should not trust what it says in
newsgroup posting headers.

David

Thierry Bouche

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
David Carlisle <dav...@nag.co.uk> writes:

> No. A completely different person. You should not trust what it says in
> newsgroup posting headers.

are you rebecca & rowland?!!

David Carlisle

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to

Now I'm really hurt, even more than when Louis said that document was
obfuscated.

David

Jean-Pierre Drucbert

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
In article <yg4emq7...@openmath.nag.co.uk>, David Carlisle <dav...@nag.co.uk> writes:
|> rub...@bounce.com (Keith Refson - real email address in signature) writes:
|>
|> > David Carlisle <da...@dcarlisle.demon.co.uk> writes:
|> >
|> > > \let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF
|> >
|> > I think it's time to come clean David. This must be an "easter egg" in
|> > TeX. How did you find out about it :)
|> >
|> > Keith Refson

|>
|> It can't be an easter egg. Wrong season.
|>
|> David

It's the right season for David: he lives with Their calendar (cf.
LaTeX releases dates).

High level markup: hum... aerospatial markup, I like it!

--
Jean-Pierre Drucbert (JPFD) Email: druc...@onecert.fr
ONERA/CERT SRI Téléphone 05-62-25-25-15
Office National d'Études et de Recherches Aérospatiales
Centre d'Études et de Recherches de Toulouse
Service Réseaux et Informatique
Complexe Scientifique de Rangueil
2, Avenue Édouard Belin BP 4025 F-31055 TOULOUSE CEDEX
FRANCE

Barbarus hic ego sum, qui non intellegor ulli.
Publius Ovidius Naso

Heinz Kusznier

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
On 11 Dec 1998 14:32:24 +0100, Thierry Bouche
<Thierry...@ujf-grenoble.fr> wrote:


BINGO!

Sorry, this time I had to shout.

ROTFL,

Heinz Kusznier

Heinz Kusznier

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
On 11 Dec 1998 14:32:24 +0100, Thierry Bouche
<Thierry...@ujf-grenoble.fr> wrote:

>David Carlisle <dav...@nag.co.uk> writes:
>
>> No. A completely different person. You should not trust what it says in
>> newsgroup posting headers.
>
>are you rebecca & rowland?!!


BINGO!!!

0 new messages