I know we can count the words for a whole document using sharelatex. However when I select a bit of text in the code editor and go to word counting it still display the total number of words of the document instead of the selected text. Is there any way to display the word count for selected text in sharelatex?

Many thanks

1 Answer 1


The word count feature referred to in your link uses TeXcount, which is meant to be run on complete documents, not text segments. A text segment might have unbalanced curly braces or unmatched \begin-\end macros, which TeXcount would not handle well.

TeXcount is a command line tool which reads TeX files, and so I assume ShareLaTeX just runs TeXcount on the file, not on selected text.

Maybe someone knows if it is possible for ShareLaTeX to pipe selected text to TeXcount on STDIN? If so, that might work, assuming the selected text does not contain unmatched curly braces or incomplete environments.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .