Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble calculating figure word-length #8

Open
joseraulgonzalez opened this issue Jul 24, 2019 · 17 comments
Open

Trouble calculating figure word-length #8

joseraulgonzalez opened this issue Jul 24, 2019 · 17 comments

Comments

@joseraulgonzalez
Copy link

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.

@jameskermode
Copy link
Owner

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}.

@joseraulgonzalez
Copy link
Author

Thanks for your reply! I have already tried this and I still get zero for word count of the figures.

@jameskermode
Copy link
Owner

Are you using Ghostscript or ImageMagick figure option? Could you try the other one?

@joseraulgonzalez
Copy link
Author

I have tried both with the same results.

@jameskermode
Copy link
Owner

What format are your figure files?

@joseraulgonzalez
Copy link
Author

EPS

@jameskermode
Copy link
Owner

Can you try moving them into the same directory as the tex file, to exclude the possibility they can’t be found?

@jameskermode
Copy link
Owner

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.

@joseraulgonzalez
Copy link
Author

Thanks for the suggestion. I tired it and am still getting zero.

@joseraulgonzalez
Copy link
Author

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.

@jameskermode
Copy link
Owner

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.

@jameskermode
Copy link
Owner

Maybe detex is not finding the figures, you could run that manually and look for ‘<Picture’ as the code does

@joseraulgonzalez
Copy link
Author

This might be the case. If I run
detex manuscript.tex | egrep "<Picture"
the output is empty.

@jameskermode
Copy link
Owner

You could try the wordcount mode instead with aps-length -m wordcount (although I think this is actually the default)

@joseraulgonzalez
Copy link
Author

Still no luck.

@jameskermode
Copy link
Owner

Strange, it's been working fairly reliably for me but I have to admit I haven't tried it for quite a while

@anshu957
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants