<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">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 writing).<DIV><BR class="khtml-block-placeholder"></DIV><DIV>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:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>\newcommand{\fn}[1]{\footnote{#1}}</DIV><DIV>% \renewcommand{\fn}[1]{}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>So, the whole task I need to do is:</DIV><DIV>1) Uncomment the \renewcommand line</DIV><DIV>2) Re-run LaTex</DIV><DIV>3) Run ps2ascii | wc on the generated .pdf</DIV><DIV>4) Display the output of that command as a ToolTip</DIV><DIV>5) Re-comment the \renewcommand line (so the file is back in its original state)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Suggestions? I'm also open to other ideas for getting the same end result, if there's an easier way.</DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Colin Hahn</DIV><DIV><I style="font-style: italic; "><SPAN class="Apple-style-span" style="font-style: italic; "><SPAN class="Apple-style-span" style="font-style: italic; ">»Geben Sie mir Kaffee, dann mache ich Phänomenologie daraus.«</SPAN></SPAN></I></DIV><DIV>"Give me my coffee so that I can make phenomenology out of it." -- Edmund Husserl</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></DIV></BODY></HTML>