I was encountering a formatting issue when writing one of my articles here that I will try to reproduce and summarize here:

When I quote text and I want to embed units, I have formatting issues, trying to reference this, "How can I format math..." page.

Here is an example of what I attempt:

The result is accurate to $\pu{4.0 Joule}$

The result is accurate to $\pu{4.0 J}$

The result is $\pu{10E+3}$

I also am having trouble going to a new line within a quote like here:

This is line one. This is supposed to be line two, but it stays for some reason on line one.

I am referencing this formatting page to get help with these items. For some reason the referenced approaches are not working. I appreciate an edited copy-and-paste with the correct-instead approach or alternatively answer that is specific to the asked items.

Below is a screenshot of what I receive with my formatting attempts:

Problems with formatting encountered with MathJax

Thank you in advance.

  • 3
    $\begingroup$ The article you reference is from Chemistry Meta... my first guess would be that math.stackexchange.com, not being chemistry.stackexchange.com, does not include the mhchem package in its MathJax. Indeed, \ce{} does not appear to work on MSE either. $\endgroup$
    – postmortes
    Jun 25, 2023 at 13:38
  • $\begingroup$ It seems pretty fundamental to Mathematics to have the ability to include Units. I am not seeing why there would be a need just in Chemistry Stack Exchange and not in Math Stack Exchange for this fundamental feature. Plus, that does not explain the difficulty with quoting multiple lines. $\endgroup$ Jun 25, 2023 at 13:52
  • 8
    $\begingroup$ @StephenElliott I very much disagree that the inclusion of units is fundamental to mathematics. Units are fundamental to physics and chemistry and biology and other sciences, but mathematics is not science, and we often work without explicit units. As for quoting, you just need to include a > at the beginning of each quoted line. $\endgroup$
    – Xander Henderson Mod
    Jun 25, 2023 at 16:26
  • 3
    $\begingroup$ @XanderHenderson I'd argue against "mathematics is not science", but will agree to "mathematics is not an empirical science"... $\endgroup$ Jun 25, 2023 at 18:11
  • 1
    $\begingroup$ Regardless of whether this is a good decision, I believe that only the site owners (SO, I guess?—I'm used to MO, whose setup is a little different) can decide what macros are loaded in the MathJax setup; even if you convinced us that this package should be loaded by default, most of us reading couldn't do anything about it! (My position is that it's good to be able to refer to units, but, given the ease of just manually writing units and the potential for macros to conflict if each person's favoured package is loaded, it's probably better to err on the side of not loading.) $\endgroup$
    – LSpice
    Jun 25, 2023 at 19:34
  • 2
    $\begingroup$ What is \pu supposed to give? $\endgroup$ Jun 25, 2023 at 22:53
  • 1
    $\begingroup$ @GerryMyerson "physical unit". $\endgroup$ Jun 25, 2023 at 23:24
  • $\begingroup$ I will add that \pu is (was?) not even a LaTeX/mhchem command (at least 5 years ago), per this tex.stackexchange post. $\endgroup$ Jun 25, 2023 at 23:27
  • $\begingroup$ You linked to the Chemistry.SE page on using MathJax, so let me point you to the Math.SE brief introduction to similar formatting. You'll find there links to the more detailed post here on Meta Math.SE as quick reference and brief tutorial. You might be able to require the mhchem package here, but I'm not really motivated to check myself. $\endgroup$
    – hardmath
    Jun 26, 2023 at 2:49
  • $\begingroup$ simple test: $\require{mhchem} \ce{H2O} \pu{1 K}$ gives $\require{mhchem} \ce{H2O} \pu{1 K}$. From Arturo's post, MathJax/mhchem's \ce was frequently misused to typeset upright units.. So you could write \ce{4 J}$\ce{4 J}$? $\endgroup$ Jun 26, 2023 at 6:04
  • $\begingroup$ @ArturoMagidin You are arguing semantics---I understand it as important to the definition of science that science is empirical. If it isn't empirical, it isn't science. $\endgroup$
    – Xander Henderson Mod
    Jun 26, 2023 at 15:17
  • $\begingroup$ @XanderHenderson I'm actually arguing something else, but this isn't the place. The argument of whether mathematics is a science or not is not nearly as settled as you seem to state. $\endgroup$ Jun 26, 2023 at 15:50
  • $\begingroup$ @ArturoMagidin I have not claimed that it is settled. I have given a definition, and noted that mathematics does not fall into that definition, by way of explaining my original comment. $\endgroup$
    – Xander Henderson Mod
    Jun 26, 2023 at 15:59
  • $\begingroup$ @XanderHenderson You did categorically say "mathematics is not science". But again, this isn't really the place. $\endgroup$ Jun 26, 2023 at 16:05
  • $\begingroup$ Yes, @ArturoMagidin, I did say that. Because, as I noted above, I understand "science" to mean an empirical process. Per that definition, mathematics is not science. Nothing that I have said has been inconsistent with that point of view. What I have not done, however, is claim that my statement is a statement of settled fact, which seems to be the way you are approaching it. I also think that there are good reasons why we should want to cordon mathematics off from the sciences, but that is neither here nor there. $\endgroup$
    – Xander Henderson Mod
    Jun 26, 2023 at 16:09


You must log in to answer this question.

Browse other questions tagged .