[OS X TeX] Find in texshop

Jonathan Kew jonathan_kew at sil.org
Sun Dec 18 16:33:53 CET 2005


On 18 Dec 2005, at 3:09 pm, Christopher Allen wrote:

>> Common usage for a word like figure is "see figure~\ref 
>> {fig:blah}", so just adding the spaces probably won't be enough.  
>> You can try to use regular expressions:
>>
>> \sfigure[\s~]
>>
>> (search for whitespace (space, tab, return), figure (not case- 
>> sensitive, if you want) followed by whitespace or a tilde).
>
> I still think the space before "figure" is far more important than  
> examination of things afterward. I would guess that he wants to  
> find things like your "see figure~\ref{fig:blah}" which will be  
> found by only searching for white space before "figure." I  
> particularly think that avoiding the search after "figure" would be  
> important so you can find things like "figures" and "figure," and  
> "figure." and "figure;" and "figure'" and more. There are very few  
> marks that can show up adjacent to and preceding "figure" in  
> standard English; there are more and more frequently used ones that  
> show up afterward.
>
> Could you do [\s"'(] or something like that prior to figure? I  
> don't know the limits of regular expressions.

Better to search for

	\bfigure

where "\b" indicates a "word boundary" (i.e., a boundary between  
alphabetic and non-alphabetic characters, roughly speaking). This is  
more general, and also avoids actually selecting the preceding  
character. Could even use

	\bfigures?\b

to find either "figure" or "figures", with word boundaries both sides.

JK


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list