Writing a proposal with strict character limits.
Using the following in the preamble
% Compile with --enable-write18 or --shell-escape options
\immediate\write18{texcount -char -inc -tex -sum <file> > <path>/count.tex}
The following throughout the document as necessary
%TC:ignore
%TC:endignore
As well as the following at the end
% display information on document
\section{Document info}
\verbatiminput{<path>/count}
Here is an mwe:
\documentclass{article}
\usepackage{moreverb}
% Compile with --enable-write18 or --shell-escape options
\immediate\write18{texcount -char -inc -tex -sum mwe.tex > count.tex}
\begin{document}
\section*{Section A}
Content for section A
\section*{Another section with subsections}
Introduction to section
\subsection*{The first subsection}
This subsection has somewhat more voluminous content which tends to go on and on...
\subsection*{The second subsection }
Content aimed at testing whether math and symbols are counted: $\int$, $\Sigma$.
\section*{An section with externalized content}
\input{externalized.tex}
%TC:ignore
\section*{An ignored section}
\input{externalized.tex}
%TC:endignore
% display information on document
\section{Document info}
\verbatiminput{count.tex}
\end{document}
Problem is, too much time spent deciphering results.
Here is what a good solution looks like in my view:
User specifies constraint / max number of characters for each section, stored in
\def\thecharacterlimit{<limit>}
Output looks like:
<section name>: <actual chars> / <limit no. chars>
. I think that a common use case may be the equivalent measured by words instead of characters.The expression
<actual chars> / <limit no. chars>
is colored red or green conditionally based being above or below limit, respectively.Ideally the results for a given section would be displayed at the end of the corresponding section.
Could easily display the over limit delta.
That said, a quick fix or a few tricks would be hugely valuable.
** UPDATE **
I am now getting the output:
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.12)
entering extended mode
(mwe.tex
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-12-07> xparse <2020-03-03>
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\size10.clo"))
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/filecontents\filec
ontents.sty"
Package filecontents Warning: This package is obsolete. Disabling it and
(filecontents) passing control to the filecontents environment
(filecontents) defined by the LaTeX kernel.
)'texcount' is not recognized as an internal or external command,
operable program or batch file.
LaTeX Warning: File `texcountinc.tex' already exists on the system.
Not generating it from this source.
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/xstring\xstring.st
y"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/generic/xstring\xstring.
tex"))
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\ifthen.sty")
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/xcolor\xcolor.sty"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics-cfg\color
.cfg")
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics-def\pdfte
x.def"))
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/hyperref\nameref.s
ty"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/refcount\refcount.
sty"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/generic/ltxcmds\ltxcmds.
sty")
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/generic/infwarerr\infwar
err.sty"))
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/generic/gettitlestring\g
ettitlestring.sty"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/kvoptions\kvoption
s.sty"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics\keyval.st
y")
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/generic/kvsetkeys\kvsetk
eys.sty"))))
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/lipsum\lipsum.sty"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/l3kernel\expl3.sty
"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/l3backend\l3backen
d-pdftex.def"))
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/l3packages/xparse\
xparse.sty"
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/l3packages/xparse\
xparse-generic.tex"))
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/latex/lipsum\lipsum.ltd.
tex")) (mwe.aux)
("C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\tex/context/base/mkii\supp-p
df.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
) (texcountinc.tex)
\sectioncount=
Are there any hints within as two why the implementation is no longer working? Any dependent packages out of date?
Via TeXworks with MiKTeX, I configure the typsetting as follows
I uninstalled, and re-installed texcount
. I can confirm that the texcount.exe
is installed here:
C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64
and texcount.pl
is installed here:
C:\Users\Chris\AppData\Local\Programs\MiKTeX 2.9\scripts\texcount
ignore
andendignore
), is that intentional? Also, do you want the counting information only for one specified section, or for all (not-ignored) sections in the document?texcount
installed (anymore). Does it work when you runtexcount
from a terminal/command prompt? Alternatively, since it is Windows, it could also be a path issue (i.e.,texcount
is installed but the editor or command prompt that you use to compile your document does not have access to the path wheretexcount
is). Unrelated question: is it still the same proposal? Did it pass?texcount
when you select them from a menu (or press a button or keyboard shortcut etc.). However, the MWE runstexcount
from withinpdflatex
, so TeXworks does not have any control of the paths there, this is presumably handled by the operating system (i.e., Windows). So, a few things to check: first, check in Windows Explorer (on both systems) iftexcount
is actually present in the indicated folder, or in another folder (use search in Explorer if you don't see it), or