TransWikia.com

How to include in-text references & footnotes in the Overleaf wordcount?

TeX - LaTeX Asked on December 31, 2021

As stated in the titled. I’ve google far and wide and can only seem to find ways of including the reference list (which I don’t want). And nothing on including the footnotes. Essentially I want both those things on the Overleaf default word count. Is that even possible?

Thanks in advance, legends!

One Answer

I have no experience with Overleaf, but you can change the rules for processing various macros and environments by adding comments in the document which TeXcount (which is what I believe Overleaf is running) take as instructions.

By default, TeXcount counts text in footnotes as part of "Words outside text". However, you can change that by adding this line at some point, eg in the preamble:

%TC:macro footnote [text]

What this says is that footnote is a macro that takes one argument which is to be parsed as text. Of course, if you have other macros for making footnotes (or other elements you want to count), you have to add rules for these as well.

Inline references are more difficult since TeXcount does not actually run TeX and thus does not know what text is being inserted. One alternative is to count the references in a separate counter.

%TC:newcounter refs References
%TC:macro cite [refs]

This adds a new counter called refs. This is then used to count the "words" in the argument to cite. You will have to add rules for other citation macros as well: this example only covers cite. If reference keywords are not single words, you may have to use %TC:macrocount cite [refs] instead which will count the number of times cite is called, but ignore the number of references in each call.

There is more documentation on TeXcount on the TeXcount web site.

Answered by Einar Rødland on December 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP