[OS X TeX] duplicate words
Richard Seguin
riseguin at earthlink.net
Fri Jul 30 00:11:17 EDT 2010
Thanks very much Claus! I just searched the text corresponding to a 170 page LaTeX document, and was shocked to discover 11 duplicate words. I expected maybe one to three duplicates. Unfortunately my brain seems to be very adept at unconsciously filtering out duplicate words. Very useful!
Richard Séguin
On Jul 27, 2010, at 9:34 AM, Claus Gerhardt wrote:
> I wonder why nobody read the correction to my (actually) first message, which unfortunately had been published first, which works as advertised:
>
> "In BBEdit do a grep search
>
> (\w+)\s+\1
>
> and check "Entire word" in addition."
>
> Claus
>
>
>
> On Jul 27, 2010, at 14:42, Alan Munn wrote:
>
>> On Jul 27, 2010, at 5:17 AM, Luis Sequeira wrote:
>>
>>> Actually, the kind of regexp search that has been mentioned works also in TeXShop:
>>>
>>> Try
>>>
>>> (\w+)\s+\1\s+
>>>
>>> (with regular expressions on)
>>> and click Find All.
>>
>>
>> Let's put this to rest. As I pointed out in my reply to Vic, this regexp doesn't actually work, and Claus's original works better. However, his also has some flaws (it will find the 'y's in the phrase "my yarn" (thanks to Vic for noticing this). A regexp that does work and fixes both problems is the following (building on Manuel's suggestion (which doesn't work either, since \< and \> aren't recognised delimiters in either BBEdit or TeXShop. (Unless in the latter it depends on which style of regexp you have set)
>>
>> Anyway, the following regexp really does work:
>>
>> \b(\w+)\b\s+\1
>>
>> Try it (and the others if you're so inclined) on the following test sentence to see:
>>
>> Alan
>>
>>
>>
>>
>> --
>> Alan Munn
>> amunn at gmx.com
>>
>>
>>
>>
>> ----------- Please Consult the Following Before Posting -----------
>> TeX FAQ: http://www.tex.ac.uk/faq
>> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
>> List Archive: http://tug.org/pipermail/macostex-archives/
>> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
>> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>>
>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>
More information about the MacOSX-TeX
mailing list