Plugin: Math Mode

Hi @Eduardo
You have a few options that I'll list here (in order of usefulness)

1

= round(7/12, 1)

2

```math
precision: 1
7/12
```

3

  1. Open the plugin settings (Tools->Options->Math Mode on Linux/Windows, and Joplin-> Preferences -> Math Mode on macOS).
  2. Change "Precision" to 1.
    I think this is least desirable because it will change the precision for all notes.
1 Like

Hi @CalebJohn
Thanks for the advise. I know there is an option to set up in a plugin but as you mentioned this set up impacting in all the notes in a same way. Thank for the help.

1 Like

v0.6.1

  • Changed the precision option to more clearly state that it refers to number of digits of the results.
  • Removed the "Upper Exponent" advanced configuration option. There is too much overlap between this option and precision and having both creates the opportunity to mess up the configuration (the default values of these two have been incompatible for the last 2 years, causing subtle issues with some results)

@tessus
Should it be updated to 0.6.1?

The version number in the manifest is wrong. Please ping @CalebJohn to update it accordingly and release 0.6.2.

Sorry about that, I thought I had set the manifest to automatically update, but it clearly didn't. v0.6.2 should be good to go

Great plugin! I have some questions. Is this thread where you primarily discuss Math Mode, or is there somewhere else you prefer?

Thinking I'd like to add some measurement units. Don't know if I should try adding them to math.js or just locally. Would like to use them with your plugin.

I prefer to do discussion here, but once it's a concrete feature request, I'll track it on github.

If it's a fairly standard unit I think adding it to mathjs would be best (then I'll update the plugin to use the newer version of mathjs). Probably this plugin should have some global configuration that allows for adding units and functions etc. but it will be best to start with mathjs if possible.

v0.7.0

  • Add Codemirror 6 support (Joplin editor beta). All credit goes to @personalizedrefriger for this update!
4 Likes

Is there a way that math mode access front matter variables?

Does round() only work with numbers or can you enter a variable name? I'm getting an error putting in a variable name.

It works with variable names, but not where there is a unit present. If there is a unit present, you need to specify which unit to round to. e.g. costPerPoster = round(perSheet, USD). This doesn't make a lot of sense in your use case, but imagine you were dealing with metres, it would make sense that you need to also specify the unit.

In any case, this made me realize that I haven't updated the underlying math engine in 4 years, so I'm pushing out an update now that will update it. Unit support wasn't added until about 6 months ago, so you'll need to update the math-mode plugin to v0.8.0 (available soon).

v0.8.0

  • Update mathjs (the math engine) to 14.4.0. There have been about 4 years worth of updates, so please be aware that some of the more advanced features might have changed. Please reach out if you notice issues and can't resolve them yourself.
  • Add support for line comments in math blocks (// or # will start a line comment)
3 Likes

Thanks! The update worked.

1 Like