texprlcount
texprlcount copied to clipboard
Respect TC:ignore for fig and table counts
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.
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"