ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
Subject: Re: counting the words in a TeX document
Date: Mon, 7 Aug 2006 20:54:04 +0200	[thread overview]
Message-ID: <6faad9f00608071154v561ff28aq32c5446415e98657@mail.gmail.com> (raw)
In-Reply-To: <44D7065E.2010808@wxs.nl>

On 8/7/06, Hans Hagen wrote:
> Mojca Miklavec wrote:
> >> ftp://tug.ctan.org/pub/tex-archive/macros/plain/contrib/misc/xii.tex
> >>
> >>
> yeah, a famous tex master piece!
> >> But of course, you will not write anything like this in an abstract
> >> :-)
> >>
> hm, let me provide a word counter for that one before you get the idea to ask for it -)

Whom did you have in mind? I would never have thought about asking
such a question. ;)

> \starttext
>
> \setbox0\vbox\bgroup  % \tracingall -)
> \forgetall \nohyphens \hsize1mm
> \let\bye\egroup \bgroup
> \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
> \egroup
>
> \newcounter\NOfLines
> \beginshapebox \unvcopy0 \endshapebox
> \reshapebox{\doglobal\increment\NOfLines}
>
> \getnoflines{\ht0}
>
> lines: \the\noflines
> words: \NOfLines\par
>
> % \unvbox0
>
> \stoptext

(I'll spare you the fun with sections for some other time,) but since
you reminded me that I might have some questions left, here you have
another one: how do I replace hyphens, en-dashes and em-dashes with
"spaces/line breaks"?
	 \catcode`~=13\let~=\space
does what I want, but none of the following works:
	 \def\-{\space}
	 \def-{\space}
	 \let\-=\space

Thanks to the magicians,
    Mojca

  reply	other threads:[~2006-08-07 18:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-05 16:45 Mojca Miklavec
2006-08-05 17:02 ` Aditya Mahajan
2006-08-05 17:52 ` gnwiii
2006-08-05 20:07 ` Hans Hagen
2006-08-06  0:31   ` Mojca Miklavec
2006-08-06 15:00     ` Hans Hagen
2006-08-06 17:27     ` Aditya Mahajan
2006-08-07  8:24       ` Mojca Miklavec
2006-08-07  9:22         ` Hans Hagen
2006-08-07 18:54           ` Mojca Miklavec [this message]
2006-08-07 20:55             ` Hans Hagen
2006-08-07 21:31               ` Mojca Miklavec
2006-08-08  0:49                 ` Aditya Mahajan
2006-08-08  7:54                 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6faad9f00608071154v561ff28aq32c5446415e98657@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).