# Highlighting bracketing in Mathematica [duplicate]

I'm working with lists of lists of lists. Each box with information has a specific format like

  information = {{a},{{b}},{{{c},{d}},{e,{f}}},{g}}


and so together they look like

  {{{a},{{b}},{{{c},{d}},{e,{f}}},{g}},{{h},{{i}},{{{j},{k}},{l,{m}}},{n}},...


and this goes over the whole screen.

I want to make the inner and outer brackets in an expression like {{ a }} look different, possibly down to all levels. Is there a way to highlight the bracketing in such a way that I can see the different levels of the list?

• Mathematica 9 highlights matching brackets when your cursor is at either of them. I would however in such a situation ask the question "why is this structure so complicated" and "Can it be made simpler". If for instance you are making implied assumptions such as "the third argument is a list of lists of number of animals and corresponding weight in a list". Then you can typically make everything much simpler by rethinking how you handle your data. In cases where you are in fact dealing with complex structures consider making a dynamic input gizmo for it. – jVincent Feb 6 '13 at 14:30
• – Szabolcs Feb 6 '13 at 14:31
• @Szabolcs: I agree on the duplicate. – Ajasja Feb 6 '13 at 14:32
• @jVincent: The information is chemical data (the version of the code in that question is not up to date). I e.g. print it in some sort of TeX-Form. Don't know how to reduce the boxes to a more pleasurable form atm. – Nikolaj-K Feb 6 '13 at 14:34
• My code highlighter generator could do this with some tweaking. Unfortunately, I did not make the bracket - matchings and highlighting routines customizable enough to incorporate coloring brackets on different levels with different colors, so some changes to the code are needed to implement this. – Leonid Shifrin Feb 6 '13 at 14:45