Skip to content

Could you enhance your documentation by including more details about how the compute engine integrates with MathLive #117

@OleksiyPetroKovalenko

Description

@OleksiyPetroKovalenko

Is your feature request related to a problem? Please describe.

I am very confused. Does each MathLive, use its own ComputeEngine. Does every instance of MathLive utilize its own ComputeEngine? I'm uncertain about when and where both the instances and the static compute engine come into play.. When working with an application that integrates both MathLive and the ComputeEngine I have tried to modify the Latex dictionary and I have not been able to do that as I am told it's a static function.

Describe the solution you'd like

I would like to understand when the instance of the compute engine and when the compute engine object are used. As I am having difficult accessing the latex dictionary of the compute engine class, could I access this as a non-static function.

Describe alternatives you've considered

I have tried to modify my copy of the compute engine code like this:

    // static getLatexDictionary(domain = "all") {
    getLatexDictionary(domain = "all") {
      return LatexSyntax.getDictionary(domain);
    }

and then

           window.ce = MathfieldElement.computeEngine;
           window.ce.latexDictionary = [
               // Remove the `PlusMinus` entry from the default dictionary...
               //...window.ce.getLatexDictionary().filter((x) => x.name !== 'PlusMinus'),
               ...window.ce.getLatexDictionary().filter((x) => x.name == 'PlusMinus'),
               // ... and add one for the `\smoll` command
               {
                   trigger: ['\\smoll'],
                   parse: (parser) => {
                       return [
                           'Divide',
                           parser.matchRequiredLatexArgument() ?? ['Error', "'missing'"],
                           parser.matchRequiredLatexArgument() ?? ['Error', "'missing'"],
                       ];
                   },
               },
           ];

This modified the instance version of the latex dictionary, but I didn't see any change when entering data into my MathField. Maybe may solution works, maybe not. But as I cannot understand the different ways the compute engine is used then I cannot proceed any further.

Additional context

I believe some simple explanations would help everyone and make this library easier to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA request for information or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions