Giter Club home page Giter Club logo

Comments (5)

drlippman avatar drlippman commented on May 9, 2024 1

Short answer - no. AsciiMath doesn't attempt to handle layout issues in general - those are better handled by the surrounding HTML.

from asciimathml.

nickbower avatar nickbower commented on May 9, 2024 1

Short answer - no. AsciiMath doesn't attempt to handle layout issues in general - those are better handled by the surrounding HTML.

No matter what we might think of where this is better handled, it is unfortunately academic for a user that must deal with long equations that will be clipped without an alternative. MathJax does not automatically reflow equations by breaking them, as you suggest they should. But it does accommodate manual breaks when issued say using Tex syntax instead of AsciiMath.

So question restated; why would AsciiMath at least not offer a similar line breaking support to help users in absence of any other solution?

Pretending such support could/should/might exist elsewhere has not shown to be that productive 4 years on...

from asciimathml.

davidfarmer avatar davidfarmer commented on May 9, 2024

from asciimathml.

drlippman avatar drlippman commented on May 9, 2024

If there was going to be a separate delimiter that invoked an equivalent of tex's display mode, that would probably need to be in Mathjax, not Asciimath. Asciimath just handles the generation of MathML.

from asciimathml.

dpvc avatar dpvc commented on May 9, 2024

If you are using MathJax to manage the input and output, then you can configure MathJax to allow two different delimiters for AsciiMath, one for in-line and one for display mode. I provided this anwser to a similar question in the MathJax User's Forum some years ago:

<!DOCTYPE html>
<html>
<head>
<title>Add Inline/Display Control to AsciiMath</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  asciimath2jax: {delimiters: [['`','`'],['``','``']]},
  AsciiMath: {displaystyle: false}
});
MathJax.Hub.Register.LoadHook("[MathJax]/extensions/asciimath2jax.js",function () {
  var AM = MathJax.Extension.asciimath2jax,
  CREATEPATTERNS = AM.createPatterns;
  AM.createPatterns = function () {
    var result = CREATEPATTERNS.call(this);
    this.match['``'].mode = ";mode=display";
    return result;
  };
});
MathJax.Hub.Register.StartupHook("AsciiMath Jax Ready",function () {
  var AM = MathJax.InputJax.AsciiMath;
  AM.postfilterHooks.Add(function (data) {
    if (data.script.type.match(/;mode=display/))
    {data.math.root.display = "block"}
    return data;
  });
});
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=AM_HTMLorMML"></script>
</head>
<body>

<p>Inline AsciiMath: `sum_{n=1}^10 n^2 = 55`</p>

<p>Display AsciiMath: ``sum_{n=1}^10 n^2 = 55``</p>

</body> 
</html>

The result is:

am-delimiters

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.