Git Product home page Git Product logo

Comments (4)

opoudjis avatar opoudjis commented on July 26, 2024

This is what we hoped to have the Ascii-based units formatting language address, but I guess we're not going to wait for that.

Your requirement is backwards: it is the upright, not the italics, which is the exception. I doubt this can be done directly at all, and what will be necessary is some ad hoc postprocessing, where formatting is passed through in the AsciiMath parse, and then processed before moving on to MathML; something like stem:[5 !m^{-2}], where we agree that ! makes the following character upright.

Proccessing Asciidoctor markup is a non-starter. Treating units as text in AsciiMath is also a non-starter. That is not how you're going to get the markup you want.

Will need to experiment with this.

from bipm-si-brochure.

opoudjis avatar opoudjis commented on July 26, 2024

Recall: by default in MathML, two-character variables are upright, single-character variables are italic.

Asciimath gem decomposes two-character variables into single-character variables. So everything turns into italics. The real solution to that is going to have to be true units markup. But before we get there:

Asciimath applies font shifts to its arguments: so

stem:[v bb(ms)^{-2}]

renders as:

<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>v</mi>
<msup><mrow>
<mstyle mathvariant="bold"><mrow><mi>m</mi><mi>s</mi></mrow></mstyle>
</mrow><mrow><mrow><mo>−</mo><mn>2</mn></mrow></mrow></msup>
</math>

That won't be the desired <mi mathvariant="bold">m</mi>, but if we want proper semantic markup, we should be using a real units markup scheme anyway.

So we could address this for now, at least for rendering, by changing the markup to stem:[v rm(ms)^{-2}]. The problem with that is, rm is not supported by most Asciimath implementations. Am requesting it to be implemented in Asciimath gem.

from bipm-si-brochure.

anermina avatar anermina commented on July 26, 2024

So we could address this for now, at least for rendering, by changing the markup to stem:[v rm(ms)^{-2}]. The problem with that is, rm is not supported by most Asciimath implementations. Am requesting it to be implemented in Asciimath gem.

I applied rm(...) syntax to all units in stem expressions of BIPM SI Brochure EN/FR (#56 ).

from bipm-si-brochure.

opoudjis avatar opoudjis commented on July 26, 2024

@Intelligent2013, unassigning you, there is nothing for you to do.

There is a task to do units in UnitsML properly: metanorma/metanorma-bipm#3 . This interim solution is working, so closing ticket.

from bipm-si-brochure.

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.