<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    On 2012-03-13 18:22, <a class="moz-txt-link-abbreviated" href="mailto:heck.johannes@googlemail.com">heck.johannes@googlemail.com</a> wrote:
    <blockquote cite="mid:8547BB8E2B8F4F93A17C500D109CF534@JohannesPC"
      type="cite">
      <div dir="ltr">
        <div style="font-family: 'Calibri'; color: rgb(0, 0, 0);
          font-size: 12pt;">
          I’ve just been looking for a possibility to count characters
          in latex documents.</div>
      </div>
    </blockquote>
    <br>
    I assume we're talking about some form of "relevant" words in the
    document (i.e., not the number of characters in an arbitrary text
    file which happens to have a .tex extension).<br>
    <br>
    This has been suggested a while ago
    (<a class="moz-txt-link-freetext" href="http://code.google.com/p/texworks/issues/detail?id=157">http://code.google.com/p/texworks/issues/detail?id=157</a>). The
    problem is that (La)TeX is a very versatile (programming) language
    [1], so doing this properly (without essentially forking most of the
    TeX interpreter code itself) is most likely impossible. Consider,
    e.g., the simple case<br>
    \newcommand{\a}{Hallo Welt}<br>
    \a<br>
    How would a script know about this (or more complicated constructs),
    except when it properly parses the whole document.<br>
    <br>
    <blockquote cite="mid:8547BB8E2B8F4F93A17C500D109CF534@JohannesPC"
      type="cite">
      <div dir="ltr">
        <div style="font-family: 'Calibri'; color: rgb(0, 0, 0);
          font-size: 12pt;">I’ll need that for my next document, because
          it’s limited to 144k Chars.</div>
      </div>
    </blockquote>
    <br>
    Characters of input, or of output? What about ligatures like "ffi"
    (1 char?, 3?, something else?)?<br>
    <br>
    <blockquote cite="mid:8547BB8E2B8F4F93A17C500D109CF534@JohannesPC"
      type="cite">
      <div dir="ltr">
        <div style="font-family: 'Calibri'; color: rgb(0, 0, 0);
          font-size: 12pt;">
          <div>I’ve found “TeXcount” and saw, that there’s also a perl
            script version of it.</div>
          <div>What about integrating that into TeXworks / adapting it
            to TWScripting?</div>
        </div>
      </div>
    </blockquote>
    <br>
    Sounds good, but I still have the same concerns mentioned above.<br>
    It may be just what you personally need, though, and implementing it
    should not be too difficult (ranging from simply installing it as a
    typesetting tool as can be done for, e.g., latexmk, to writing a
    script to call TeXcount on the command line (as has been done for
    TeXShop (<a class="moz-txt-link-freetext" href="http://www2.hawaii.edu/~ramonf/TeXShop/index.html">http://www2.hawaii.edu/~ramonf/TeXShop/index.html</a>))).<br>
    <br>
    Regards,<br>
    Stefan<br>
    <br>
    <br>
    [1] <off-topic>Is TeX Turing-complete?</off-topic><br>
  </body>
</html>