The lagrangian in that PDF is about three transformations away from the most compact specification of the SM, which would be “the most general renormalizable field theory with these local symmetries and with fermions transforming in these representations”. If you then wrote down the lagrangian immediately implied by that specification, then changed field variables to incorporate the effects of the Higgs, and finally chose a gauge and included “ghost” fields, then you could get that long expression.
The lagrangian in that PDF is about three transformations away from the most compact specification of the SM, which would be “the most general renormalizable field theory with these local symmetries and with fermions transforming in these representations”. If you then wrote down the lagrangian immediately implied by that specification, then changed field variables to incorporate the effects of the Higgs, and finally chose a gauge and included “ghost” fields, then you could get that long expression.