Closed DeepakIngole closed 6 years ago
It'd be nice if this could be added to the README
Why does it need the pdf to be there at all? I see no reference to \jobname.pdf
anywhere.
Thanks for pointing out the issue @DeepakIngole, I will look into it and keep you posted.
@DeepakIngole you probably have some other issue since there is no need for a pdf file to get the word count. You can perhaps uncomment \TotalWords
, compile, remove pdf, comment \TotalWords
, compile again to figure out if its up to pdf (but you will probably have a count file by that time so you should not see any error).
I don't know exactly what the cause of the problem is, but I'm seeing the same thing. I see no reference to the pdf anywhere, but then I don't see a reference to an external file being required either except count.txt, which is generated just before it is read -- still, I see the same behavior: I need to uncomment \TotalWords
, then compile, then I can comment \TotalWords
. Any time I do a compile from scratch, I have to do this.
For me it seem related to whether the bbl
file exists. If it exists, the compilation will proceed. Just touch
ing the file (creating an empty file) will do it.
https://github.com/chiehrosswang/TRB_LaTeX_tex/blob/master/trbunofficial.cls#L166 is the problem. The solution would be to use -incbib
if the bbl file is present and omit it when not. This would generate the bbl file during compile so the compile can proceed. The second and later compiles would then have the correct count.
Replacing that line with
\IfFileExists{./\jobname.bbl}{\immediate\write18{texcount -sum -1 -incbib \jobname.tex > count.txt}}{\immediate\write18{texcount -sum -1 \jobname.tex > count.txt}}%
does the job for me
Work for me as well, format that line and make a PR :smile:
Merged PR#10 into master, closing this issue. Thanks everyone!
Hi,
I am using your TRB template. Thanks for making it public. Unfortunate, it is throwing "Missing number, treated as zero. \maketitle" error. I followed the steps as you said. I am using TL 2018 on macOS High Sierra (10.13.5), I have texcount & ActivePerl, and it is working at the terminal. The issue is arising when there is no corresponding pdf file. I just tried uncommenting line 37 of .tex file (\TotalWords{200}) for the first time compilation (it shows 200 words) and then uncommenting the same line and compile again to get the actual count. This is a manual way, can we make it automatic.
Thanks.