astropy/astropy — pull request #2622 by zblz (2014-06-13 09:22:37+00:00)
Title: Add ``latex_inline`` unit format representation with negative powers instead of fractions

This PR adds a new unit format representation called ``latex_inline`` which uses negative powers instead of fractions for expressions of rate. It is otherwise equivalent to the ``latex`` format. This format is the one used in the [IAU Style Manual](http://www.iau.org/static/publications/stylemanual1989.pdf) and required by some publications (e.g., [ApJ and AJ](http://aas.org/authors/manuscript-preparation-aj-apj-author-instructions#_Toc2.2)).

```python
>>> fluxunit = u.erg / (u.cm ** 2 * u.s)
>>> fluxunit.to_string('latex')
u'$\\mathrm{\\frac{erg}{s\\,cm^{2}}}$'
>>> fluxunit.to_string('latex_inline')
u'$\\mathrm{erg\\,s^{-1}\\,cm^{-2}}$'
```