[TxMt] Macro/command for LaTeX wordcounts
colin.hahn at gmail.com
Fri Jan 26 00:57:09 UTC 2007
I'm trying to write a macro or command (not sure which will be
better) for doing a word count on LaTeX documents. The basic task is
simple enough: I want to run the command "ps2ascii [file.pdf] | wc"
on file.tex (where file.tex is the current file I'm working on) (I've
tested ps2ascii and it works fine for the types of documents I'll be
However, I also want to strip the footnotes from my word count. To
do so, I've defined the footnotes with a custom command that I can
redefine as empty:
So, the whole task I need to do is:
1) Uncomment the \renewcommand line
2) Re-run LaTex
3) Run ps2ascii | wc on the generated .pdf
4) Display the output of that command as a ToolTip
5) Re-comment the \renewcommand line (so the file is back in its
Unfortunately, I don't know how to string these things together, nor
how to get the argument for the ps2ascii command from the current
filename variable TM_FILENAME (i.e., how to substitute .pdf
for .tex). I can add unique comments to the end of the \renewcommand
line so it can be picked out by a regex search, if that helps.
Suggestions? I'm also open to other ideas for getting the same end
result, if there's an easier way.
»Geben Sie mir Kaffee, dann mache ich Phänomenologie daraus.«
"Give me my coffee so that I can make phenomenology out of it." --
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the textmate