0

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:

no words example

Many thanks in advance for your suggestions

3
  • You need to provide more details. Can you run the instruction from the command line? Is the count.txt file produced? What's your OS and TeXcount version? Have you set the shell-escape option required for running commands from TeX? Commented Aug 11, 2020 at 18:27
  • @EinarRødland the file 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. The shell-escape option was set as in: tex.stackexchange.com/questions/99475/…
    – Rui
    Commented Aug 12, 2020 at 6:53
  • Try reducing the example, and try to see what's the simplest case that still fails. Eg try running just texcount -o count.txt \jobname.tex and see if this still fails. You can also try echo "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 than shell-escape. Commented Aug 12, 2020 at 18:43

0

You must log in to answer this question.

Browse other questions tagged .