The basic structure is "We can (action1action) (comparison) than (action2method1) if we (method2)", so:
We can represent the structure of sentences in more detail than is done in a diagram like figure 2 if we show the category to which each constituent belongs.
Is broken down as
- "represent the structure of sentences" - action1action
- "in more detail" - comparison
- "[creating] a diagram like figure 2" - action2method1
- "show the category to which each constituent belongs" - method2
The clause "in more detail", as a whole, qualifies the action "represent the structure of sentences", and compares two methods of achieving that.
Grammatically, the comparison could be replaced, like "using fewer colours", or even just "better".
Compare a much simpler example:
We can move ourselves faster than by walking if we run
- "move ourselves" - action
- "faster" - comparison
- "by walking" - method1
- "run" - method2