Drops the arguments of commands that aren't prose: \cite, \ref, \label, \usepackage, \includegraphics, \bibliography, \input, \include, \url, and similar.
Keeps the text argument of formatting commands such as \textbf{...} and \emph{...}, and of \href{url}{text} (the URL itself is dropped).
Counts heading text (\section{...}, etc.) by default; toggle with texWordCount.countHeadings.
Settings
Setting
Default
Description
texWordCount.countMath
false
Count words inside math.
texWordCount.countCaptions
true
Count words inside \caption{...}.
texWordCount.countFootnotes
true
Count words inside \footnote{...}.
texWordCount.countHeadings
true
Count words inside heading commands.
texWordCount.sectionIncludesSubsections
true
Include subsection word counts in the section count shown in the status bar.
texWordCount.showSection
true
Show the current section's word count.
texWordCount.showSelection
true
Show the current selection's word count.
texWordCount.extraSectionCommands
[]
Extra command names (no backslash) to treat as \section-level headings, e.g. ["mysection"].
Known limitations
Counts the current file only — \input and \include targets aren't followed.
Regex-based counting won't exactly match TeXcount on unusual or heavily customized macros.
Custom section commands aren't recognized unless added via texWordCount.extraSectionCommands.
Files over 1 MB skip live updates while typing; the count still refreshes on save or when you switch back to the editor.
Development
npm install
npm test # unit tests for counter.ts and sections.ts
npm run build # bundle to dist/extension.js
Press F5 in VS Code to launch an Extension Development Host with the extension loaded.