Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is they a way of obtaining a word count in LyX that does not include text inside captions (Figures, tables etc.)?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

One way is to remove the insets for which you don't want the words to be counted. First backup your document. Then, to remove all of the caption insets try the following on the mini-buffer (alt+x):

command-sequence inset-forall Caption char-delete-forward; statistics; undo

What this does is the following

  1. Remove all Caption insets
  2. Word count
  3. Undo "Remove all Caption insets"
share|improve this answer
    
is there a way of extending the command above to exclude notes and appendices as well? –  Josh May 6 '13 at 15:18
    
@Josh For notes, yes. You can see an example of inset-forall for notes in Help > LFUNs and searching for LFUN_INSET_FORALL. So you would just add that new command as another element in the ';'-delimited command-sequence and then probably you need another 'undo' at the end. For appendices I don't think this would work. You could use an LFUN to find (see e.g. LFUN_WORD_FIND) a certain phrase and and then use LFUNS to delete until the end. It's all about looking for the right LFUNs. Note that if you have View > Messages, when you do something in the GUI it will often list the corresponding LFUNs. –  scottkosty May 6 '13 at 15:41

The simplest but most tiresome way (and as far as I know only way in LyX) would be to select step by step parts of the LyX document skipping the parts you do not want to count and use "Tools > Statistics" to note a word count. Finally, all word counts need to be added.

Alternatively, one can export the LyX document to a LaTeX file and apply all sorts of TeX related methods as shown in: Is there any way to do a correct word count of a LaTeX document? Especially, TeXcount offers ways to exclude captions and certain environments.

share|improve this answer
    
@Josh This way could be set up automatically by using a custom converter (see Help > Customization) or maybe plyx, which is a third-party tool to run quick python scripts (I've never tried it out though). –  scottkosty Apr 25 '13 at 15:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.