# What's the best way to do formatting for units?

I'm new to LaTeX, but I had a look at the docs and \sfrac looks like it would be nice for units, like $\frac{m}{s}$ (would look better with \sfrac instead of \frac). However it doesn't appear to be supported, and it might not be consistent with plain old $mm$ and other non-fraction-like units.

Can \sfrac be supported?

Is there a way to make it do nice-looking units that are easily distinguished from the other text, and should we encourage a standard way to format units (and make edits to fix, etc.)?

...after some further research I found this post which discusses a package for SI Units - but I tested and it doesn't seem to be supported... is it easy to add this? We should definitely use SI units wherever possible.

• You mean besides the \text{} function? But yes, \sfrac would be nice. – HDE 226868 Jan 23 '15 at 0:54
• So how do we go about getting \sfrac? Is this something we can add or is it part of the SE platform that would need changes? Even if that's the case is there a way to request it? – jhabbott Jan 25 '15 at 20:01
• I guess we'll have to directly ask a community mod, most likely Robert Cartaino. – HDE 226868 Jan 25 '15 at 20:03

While not directly answering your question, this is one of the best summaries I've seen on how to use MathJax within SE-land.

MathJax basic tutorial and quick reference
Hat tip to the folk over at Math.SE for putting it together. And yes, there's really too much information there to copy over to here.

If there are particular MathJax packages that we want enabled and that other SE sites are already using, all we need to do is ping Robert Cartaino to put the request in. They use a set of flags to control package support per site. Completely new packages take more time as the developers have to import the packages and test them out before unleashing upon the unsuspecting citizens of SE.

Regarding SI vs. Imperial units - "meh." We don't need to worry about that at this point. From my experience, most engineering work (including lessons at US and UK universities) is already done in SI units, so questions will naturally use those. That said, there are certain industries (I'm looking at you Energy & Utility Sector) where the use of non-SI units is so deeply ingrained that it's laughably expensive to try and convert the industry.

I would rather worry about drawing in high quality questions than worry about what units are used within the question.

• Yeah, some really good points - other sectors like aviation also use non SI units as their international standard. If we can get it I think it (and \sfrac) would be useful anyway - not suggesting we make any blanket policies, in fact it's probably best to answer people's questions in the units they asked them or whatever makes the most sense for the best answer. – jhabbott Jan 25 '15 at 20:09

While I would probably use things like SIunits and sfrac if they where there I don't think they are really necessary.

From what I recall SE uses MathJax to get latex/math support. I'm not an expert in using it but I had a quick look at the manual and couldn't see an obvious way to add additional latex packages. So I suspect it wouldn't be that easy to add.

Generally, the standard way to write units is as non-italicized text to distiguish them from variables. This can be achieved in the latex environment by using \text{}. For fraction units you can generally do $\text{ms}^{-1}$ or $\text{m}/\text{s}$ using $\text{ms}^{-1}$ or $\text{m}/\text{s}$.

From my experience using SIunits the main advantages are speed when writing lots of units and not having to remember the names of Greek letters and which symbols they are. However, I don't think people use enough latex/units to warrant the additional overheads.

Personally, I don't really care how people format their units as long as it is vaguely clear. $1$mm, $1\text{mm}$ or $1mm$ are all fine by me (although $m=1mm$ is probably bad). Some people will go around 'fixing' these types of things which is fine if they want to.

Personally I only edit if people write long incompressable equations with no formatting like:

x^2+y^2=xe^y