Skip to content

Trouble calculating figure word-length #8

Description

@joseraulgonzalez

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.

Activity

  1. jameskermode commented on Jul 24, 2019

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

  2. joseraulgonzalez commented on Jul 24, 2019

    @joseraulgonzalez
    Author

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

  3. jameskermode commented on Jul 24, 2019

    @jameskermode
    Owner

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

  4. joseraulgonzalez commented on Jul 24, 2019

    @joseraulgonzalez
    Author

    I have tried both with the same results.

  5. jameskermode commented on Jul 24, 2019

    @jameskermode
    Owner

    What format are your figure files?

  6. joseraulgonzalez commented on Jul 24, 2019

    @joseraulgonzalez
    Author

    EPS

  7. jameskermode commented on Jul 24, 2019

    @jameskermode
    Owner

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

  8. jameskermode commented on Jul 24, 2019

    @jameskermode
    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.

  9. joseraulgonzalez commented on Jul 24, 2019

    @joseraulgonzalez
    Author

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

  10. joseraulgonzalez commented on Jul 24, 2019

    @joseraulgonzalez
    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.

  11. jameskermode commented on Jul 24, 2019

    @jameskermode
    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.

  12. jameskermode commented on Jul 24, 2019

    @jameskermode
    Owner

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

  13. joseraulgonzalez commented on Jul 24, 2019

    @joseraulgonzalez
    Author

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

  14. jameskermode commented on Jul 24, 2019

    @jameskermode
    Owner

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

  15. joseraulgonzalez commented on Jul 24, 2019

    @joseraulgonzalez
    Author

    Still no luck.

  16. jameskermode commented on Jul 24, 2019

    @jameskermode
    Owner

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

  17. anshu957 commented on Nov 25, 2019

    @anshu957

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions