LaTeX forum ⇒ Feature Suggestionsword count

Suggestions and discussions for new TeXnicCenter features
happyblueeyes
Posts: 11
Joined: Sun Jan 14, 2007 4:53 pm

word count

Postby happyblueeyes » Mon Dec 03, 2007 1:20 pm

Why doesn't TexnicCenter have a good word count facility? I don't think it has a simple word count option presently. Does it? I hoe the developers would look into it since word count is a necessity for guys submitting papers to scientific conferences.

Thanks in advance,
happyblueeyes Very Happy

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Dec 03, 2007 8:05 pm

happyblueeyes wrote:[…] I hoe the developers would look into it since word count is a necessity for guys submitting papers to scientific conferences. […]

I participated in the publication of some papers but never experienced the necessity of word count. Note that the routine for doing that would have to exclude commands. And I wonder how mathematical expressions should be handled.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Cupric
Posts: 5
Joined: Tue Dec 04, 2007 7:56 pm

Postby Cupric » Tue Dec 04, 2007 7:59 pm

I make my document a PDF and then use a PDF word counter to get the word count.

There are a lot of PDF word counters, but most of them are not free. The one I am currently using is free and is called Translator's Abacus and is available from http://www.globalrendering.com/download.html.

gregh
Posts: 1
Joined: Thu Mar 27, 2008 10:09 am

Postby gregh » Thu Mar 27, 2008 10:45 am

Hi!

Regarding word counting in TeXnicCenter: Defining an output profile with a word counting script works absolutely smoothly for me. The best solution seems a perl script called texWordCount.pl that counts words through the logical structure of a latex document or project. That is, you get word counts for each hierarchical level (total, per chapter, per section, down to subsubsections). This is much more than what you get using approaches based on untex | wc.

In detail: Define a new TeXnicCenter output profile (e.g., "LaTeX => word count") with LaTeX, BibTeX and MakeIndex disabled, and set the Postprocessor to run Perl with argument "<path to>\texWordCount.pl %pm" and redirection to "%bm.wc". So F7 gets your project scanned. To display the results, in the Viewer tab simply put your favourite text editor (e.g., "notepad++.exe") with appropriate argument (for notepad++, it's simply "%bm.wc").

ps -- A nice alternative would be to send a DDE command ("open("%bm.wc")") to TeXnicCenter itself, but I wasn't able to get this to run, neither by commandline argument with "/ddecmd" nor by a DDE Open command. If anyone succeeds, please post ;)

Best

gregor

Stefanie
Posts: 25
Joined: Fri Apr 04, 2008 2:39 pm

Postby Stefanie » Fri Apr 04, 2008 3:10 pm

i tried your solution, but it doesn't seem to work... this is the generated output:

# LaTeX word count file format 1.0 produced by C:\Windows\texWordCount.pl
# run as "C:\Windows\texWordCount.pl "
# format: \t x level of detail, number of words \t section name
0 whole - <STDIN>

Stefanie
Posts: 25
Joined: Fri Apr 04, 2008 2:39 pm

Postby Stefanie » Fri Apr 04, 2008 3:16 pm

i think i found the problem: texwordcount.pl doesn't support spaces in path names. when your .tex file is saved in e.g. c:\documents and settings\ , you get an error saying the path name doesn't exist. I don't know how to fix it, though.

tillj
Posts: 1
Joined: Thu Jul 10, 2008 4:14 am

Postby tillj » Thu Jul 10, 2008 4:37 am

I also can't get it to work.
I followed your describtion as much as I could understand, and there is no complaining from the computer when I hit ctrl+F7, and id displays a line saying Output Profile WordCount. But nothing else. If I view the output it opens notepad, but it is all blank.

Does the script have to be in a specific folder?

Could you be more specific which redirection should be used and what entry exactly should be in which field.

Otherwise, any ideas, suggestions?

Cheers
Till

neeraj2608
Posts: 3
Joined: Mon Apr 06, 2009 4:07 pm

Postby neeraj2608 » Mon Apr 06, 2009 4:12 pm

Stefanie wrote:i think i found the problem: texwordcount.pl doesn't support spaces in path names. when your .tex file is saved in e.g. c:\documents and settings\ , you get an error saying the path name doesn't exist. I don't know how to fix it, though.


Try replacing the double quotes with a single quote. This escapes spaces in the file path on my system (Vista 64-bit).

CoMicFont
Posts: 1
Joined: Tue Feb 16, 2010 10:41 am

Postby CoMicFont » Tue Feb 16, 2010 10:44 am

tillj wrote:Does the script have to be in a specific folder?

Nope, but you would need to have a Perl interpreter installed...

magicmoose
Posts: 90
Joined: Fri Nov 06, 2009 7:29 am

Postby magicmoose » Tue Feb 16, 2010 1:46 pm

Here is an online version of the script: http://folk.uio.no/einarro/Services/texcount.html


Return to “Feature Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests