On Dec 6, 2025, at 7:24 AM, Gerhard Gsänger via lyx-users 
<[email protected]> wrote:
> Hello,
> Using LyX 2.4.4 and Macbook M2 and Tahoe.
> 
> I recently split a very large LyX document into multiple child documents, and 
> the system works really well. However, I noticed that the word and character 
> count now only applies to individual child documents. I can’t see the total 
> count for the entire master document.
> 
> Is there a way to display the combined word or character count for the master 
> document including all child documents?
> 

I’m quite sure the word count is performed on the loaded document in memory, 
and the whole point of having child documents is to avoid having to load all 
the parts of a large document into LyX at once. So I don’t think a solution to 
your problem currently exists and it seems like it would be a lot of work to 
implement one.

However, If you are comfortable with the MacOS command line (via Terminal.app 
or, better, the third-party iTerm.app), there is a nice solution: you can 
simply to export your LyX master document to a PDF file and do a word count on 
the resulting PDF with the simple command:

$ pdftotext YOURFILE.pdf - |wc -w

The parameters -c and -l will give you character and line counts, respectively. 
“wc” with no parameters will give you all three.

Unfortunately, pdftotext is not among the default command line tools for MacOS 
nor is it included in the XCode command line tools, so you have to install it 
via homebrew. If you have homebrew installed, pdftotext is included in the 
poppler utilities and can be installed simply with the command:

$ brew install poppler

If you haven’t installed homebrew (like LyX, a top-quality, well-organized, and 
extraordinarily useful open source software project), simple instructions 
(along with extensive documentation and community discussion) can be found at 
https://brew.sh/.

Chris Menzel

-- 
lyx-users mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-users

Reply via email to