Integrating texcount
directly into a LaTeX document to display a live word count requires a bit of setup. Here's a basic method to do this:
First, make sure that shell escape is enabled in your LaTeX compiler. This is necessary because the document will need to run external commands (texcount
in this case).
- For
pdflatex
, you can enable shell escape by compiling with the-shell-escape
option (e.g.pdflatex -shell-escape yourfile.tex
). - If you're using an editor like TeXShop or Overleaf (for Overleaf,
yourfile.tex
file must be namedoutput.tex
), check their respective settings or documentation on how to enable shell escape.