Output models in LaTex

Here is a small code to get the output of generators for LaTex: