I'm using \markdownInput
(via the markdown package) to include Markdown files in a paper on Overleaf. Overleaf uses the TeXcount utility to count the words. But TeXcount doesn't recognize \markdownInput
(or \verbatiminput
for that matter).
A minimal working example would be:
\documentclass{article}
\usepackage{markdown}
\usepackage{verbatim}
\begin{document}
% Both inputs won't get counted by TeXcount
\markdownInput{example.txt}
\verbatiminput{example.txt}
\end{document}
With example.txt containing some markdown to test. The word count shown by Overleaf will be 2 in this case. While it would be 2 + the wordcount of the .txt-file if you would add \input{example.txt}
.
I've tried using a comment environment \begin{comment}
around or something like \phantom
and just add the .txt files in addition via \input
but I couldn't come up with a good solution.
I'm aware that TeXcount offers a file include option in the form of %TC:fileinclude \input input
(manual page 20) but couldn't get that to work either. My current (subpar and temporary) solution was to switch to \input
count the words and then switch back to \markdownInput
, but a real solution would be great. Especially because I would like to use %TC:ignore
inside the markdown files to exclude text that shouldn't be counted.
Any help and suggestions on how to go it in a smart way that doesn't produce warnings and maybe can stay in the document would be highly appreciated!