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

Respect TC:ignore for fig and table counts #8

Open
andrewfowlie opened this issue Apr 13, 2022 · 1 comment
Open

Respect TC:ignore for fig and table counts #8

andrewfowlie opened this issue Apr 13, 2022 · 1 comment

Comments

@andrewfowlie
Copy link
Contributor

I noticed that figures and tables (and possibly inline math and equations, not sure) are still counted even when they are inside

  %TC:ignore
  ...
  %TC:endignore

blocks. I put my appendices/supplemental material inside a block, and whilst the words weren't counted, the figures and tables were. It would be nice for them to be ignored.

@manu-mannattil
Copy link
Contributor

One possible solution would be to write a wrapper script to preprocess the file using sed before calling texprlcount, e.g.,

#!/bin/sh

[ "$*" ] || {
    echo >&2 "usage: ${0##*/}: file.tex"
    exit 1
}

# rm temporary files on exit.
trap 'rm -rf "_$1" >/dev/null 2>&1' EXIT
trap 'exit 2' HUP INT QUIT TERM

sed '/^[ \t]*%TC:ignore/,/^[ \t]*%TC:endignore/d' "$1" >"_$1"
exec .../path/to/texprlcount.pl "_$1"

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

2 participants