Jackey's 感悟

Do Research

Add a word count script for TeXWorks

We can add a new script to count the words of one tex file like this

Here is the script “wordcouter.js”

// TeXworksScript
// Title: Count the words in tex file
// Description: counter 
// Author: Jackey Lu
// Version: 0.1
// Date: 2011-09-21
// Script-Type: standalone
// Context: TeXDocument


var cmd = "e:\\local\\texlive\\2010\\bin\\win32\\texcount.exe " + TW.target.fileName;
var result = TW.system(cmd);
result.output;

Put the script in the TeXworks profile directory “scripts”, in windows 7, it is like this, C:\Users\[your username]\TeXworks\scripts.

PS: you must change the path of  texcount.exe with your real path.

To enable it, You should change the preference.

image

then you can count the words of your tex file now, use the menu Script –> Count the words in tex file.

image

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s

%d 博主赞过: