[OS X TeX] finding missing braces

Alan Munn amunn at msu.edu
Sun Mar 4 11:07:06 EST 2007


At 2:09 PM +0100 3/4/07, Rolf Schmolling wrote:
>Hi there,
>
>anybody having an idea how to search for missing braces on TexShop?

At least as hard as searching for messages with no subjects.  I don't 
know of a foolproof way to do this, but one way that approximates 
finding unmatched braces is to find and highlight all instances of an 
opening brace followed by arbitrary text and then another opening 
brace.  If you have an unmatched brace, chances are this will show up 
as a larger chunk of text than you expect.  (Of course, this isn't 
foolproof, since it also highlights any cases of nested braces.)  So 
it depends a lot on the kind of text you write.

The following regexp will work:

\{[^{}]*\{

Choose Find, click on the Regular Expression option and then choose 
highlight.  This will highlight all instances as described above. 
You can then go through these to see if they're the source of the 
problem.

Maybe others have a better solution.

Alan
-- 
Alan Munn 
amunn at msu.edu
Department of Linguistics                             
and Germanic, Slavic, Asian and African Languages   Fax.  +1-517-432-2736
Michigan State University, East Lansing MI 48824       Tel.  +1-517-355-7491

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list