aps-length
aps-length copied to clipboard
Trouble calculating figure word-length
Dear James,
Thank you very much for your useful script. I am having trouble getting the script to recognize any figures and to count their word length equivalents. I have all of my figures in their own folder and I use graphicspath in my document to point LaTeX to their location. However, when running aps-length I get that the figures have a length of 0. Do you have any recommendations? Could you please help me count the length of my figures?
Best regards.
The script needs to be able to find the figure files to compute their word count, and it doesn’t understand the graphicspath command. I suggest giving the relative path to the file for each figure, e.g. includegraphics{figures/figure1.eps}
.
Thanks for your reply! I have already tried this and I still get zero for word count of the figures.
Are you using Ghostscript or ImageMagick figure option? Could you try the other one?
I have tried both with the same results.
What format are your figure files?
EPS
Can you try moving them into the same directory as the tex file, to exclude the possibility they can’t be found?
Just had a quick look at the code. There’s a commented out print statement on line 430 you could put back in to check filenames that are being detected.
Thanks for the suggestion. I tired it and am still getting zero.
Hmmm. Odd. I did uncomment this line "print filename, tex_lines[inc_fig_line_no], tex_lines[fig_line_no]" but did not get any printout. Seems to me the program is not even entering the loop where figure are counted.
Ok, I’m out of suggestions for now. If you want to debug further I’d suggest running the gs or identify commands invoked by the script yourself and checking the output matches the expected form.
Maybe detex is not finding the figures, you could run that manually and look for ‘<Picture’ as the code does
This might be the case. If I run
detex manuscript.tex | egrep "<Picture"
the output is empty.
You could try the wordcount
mode instead with aps-length -m wordcount
(although I think this is actually the default)
Still no luck.
Strange, it's been working fairly reliably for me but I have to admit I haven't tried it for quite a while
I think I had the same problem but then I looked into the tmp log file generated by the script and at least for me it was a revtex article class that was causing the problem. I guess I was using revtex4-2 which was not present in my texlive or something. When I switched back to revtex4-1, it worked flawlessly. Hope it helps.
P.S. Just wanted to confirm, the word count does not include references, right ?