Tree-independence number VI. Thetas and pyramids | Synapse