Git Product home page Git Product logo

Comments (2)

Tronic avatar Tronic commented on June 6, 2024

Suggesting something even simpler, e.g.

g = 9.81.m/s^2

Noting that dot directly following a number has no useful meaning (prints currently simply as a dot). Using some character other than dot could be safer, if it needs to be a strictly nonbreaking change. Either way, quotes at both ends of the unit are still quite ugly.

Units formatting also should add a narrow non-breaking space between the number and its unit where I believe \, is normally used in LaTeX for this.

Sometimes units need to be printed without a number so that is also a concern. Technically the dot prefix could also work for this:

[a] = .m/s^2

One concern is when to break out of unit mode, and in that regard the surrounding quotes are simpler. Otherwise spaces, parenthesis and division could either be part of the unit expression or a continuation of the equation (after which letters should appear as variables again).

from asciimathml.

aslakr avatar aslakr commented on June 6, 2024

There is an old note from 2003 on how to use units in MathML https://www.w3.org/TR/mathml-units/ with a short segment on presentation MathML.

<math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle>
<mn>42</mn>
<mo rspace="thickmathspace">&InvisibleTimes;</mo>
<mi mathvariant="normal" class="MathML-Unit">N</mi>
<mo>=</mo>
<mn>42</mn>
<mo rspace="thickmathspace">&InvisibleTimes;</mo>
<mi mathvariant="normal" class="MathML-Unit">kg</mi>
<mo>&middot;</mo>
<mfrac>
<mi mathvariant="normal" class="MathML-Unit">m</mi>
<msup>
<mi mathvariant="normal" class="MathML-Unit">s</mi>
<mn>2</mn>
</msup>
</mfrac>
</mstyle>
</math>

One could maybe write the si units in full

42*newton = 42*kilogram*metre/second^2

a bit similar to https://ctan.org/pkg/siunitx?

from asciimathml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.