convexengineering / gplibrary

Useful subsystem models
MIT License
10 stars 11 forks source link

Latex() writes class name in each variable #41

Closed mjburton11 closed 8 years ago

mjburton11 commented 8 years ago

@whoburg when I call print M.latex() where M is a model, it prints out the name of the class as well, like this:

In [3]: print M.latex()
\begin{array}{ll}
\text{}
\text{minimize}
    & {W}_{GasPoweredHALE}\mathrm{~\left[ lbf \right]} \\
\text{subject to}
    & {P_{shaft}}_{GasPoweredHALE} = \frac{{C_D}_{GasPoweredHALE} {V}_{GasPoweredHALE} {W}_{GasPoweredHALE}}{{C_L}_{GasPoweredHALE} {\eta_{prop}}_{GasPoweredHALE}} \\

How can I get it to just print out the variables without the class name attached?

whoburg commented 8 years ago

Have you tried adding

import gpkit
gpkit.settings['latex_modelname'] = False

to the top of the file defining M?

Also, minor note: future issues like this should probably be raised at gpkit not gpkit-models.

mjburton11 commented 8 years ago

Yep that would fix it. And yes I will be this in a gpkit next time. Thanks!