1

I would like a way to get a word count while ignoring certain environments. The reason for this is that I have quite a bit of pseudocode enclosed within multiple verbatim blocks.

Ideally, a solution would be like this, but with the ability to select which environments to not select.

edit: I am using TexStudio

Nyx
  • 203

1 Answers1

2

As far as I know there is no solution you want.

You can try to use package ifthen. Define a boolean variable (\newboolean{WordCount}), set it to true (\setboolean{WordCount}{true}) or false (\setboolean{WordCount}{false}) and suround all environments you do not wanted to be counted with \ìfthenelse{WordCount}{}{<your environment>}. So if WordCount is false your environment is executed, if it is true your environment is not executed:

%in your praeambel:
\usepackage{ifthen}  % http://www.ctan.org/pkg/ifthen
\newboolean{WordCount}
\setboolean{WordCount}{true}
%\setboolean{WordCount}{false}
...
%in your document:
\ifthenelse{\boolean{WordCount}}{% 
   % True, no environment to be executed
}{% False, execute environment:
 <your environment here>
}

Please take a look to the related question is there any way to do a correct word count of a LaTeX document and combine one of the methods there with the code above.

Hope that helps.

Mensch
  • 65,388