I am trying to get the words cumber per section using the following lines:
\newcommand\wordcount{
\immediate\write18{texcount -sub=section \jobname.tex | grep "Section" | sed -e 's/+.*//' | sed -n \thesection p > 'count.txt'}
(\input{count.txt}words)}
as in: Dynamically count words in chapter and insert word count at start of chapter or wordcount by section when sections were formally known as chapter
however, the words are not counted. But no error pops up.
In the pdf output it appears:
Many thanks in advance for your suggestions
count.txt
file produced? What's your OS and TeXcount version? Have you set theshell-escape
option required for running commands from TeX?count.txt
is not produced. I think that is actually the main issue (besides my lack of computational skills) Additional information: OS:64-bit version ; TeXcount_3_2. Theshell-escape
option was set as in: tex.stackexchange.com/questions/99475/…texcount -o count.txt \jobname.tex
and see if this still fails. You can also tryecho "test" > count.txt
just to see if it actually runs. I also have some vague memory of some version of TeX that took a different option thanshell-escape
.