Skip to content

Latest commit

 

History

History
86 lines (59 loc) · 2.53 KB

File metadata and controls

86 lines (59 loc) · 2.53 KB

Math plugin

The Math plugin provides a way for users to insert complex formulas.

Interactive example

liveDemo::math[]

Basic setup

To set up the Math plugin user interface in the editor:

  • add math to the plugins option in the editor configuration;

For example:

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'math',
  toolbar: 'math',
});

How to Use

To work with math elements, follow these steps:

  1. Enable Math Plugin

    1. Open the {productname} editor with the Math plugin enabled.

  2. Insert or Edit Math Elements

    1. Click the Math plugin icon in the toolbar.

    2. This opens the Math dialog.

    3. Select preferred language

    4. Enter Math formula in the textarea.

    5. Choose preferred text wrap

  3. Preview and Save

    1. Check Math formula output in preview.

    2. Review the final Math equation in the preview section.

    3. Click the save button in the Math dialog.

    4. The Math equation is inserted into the editor, wrapped accordingly based on the chosen text wrap.

Formula Tag Wrapping

  1. The Math dialog wraps the inserted formula with a specific tag.

  2. The choice of tag depends on the selected text wrap option in the dialog:

    1. For block (Text above and below) text wrap, the tag used is <tiny-math-block>.

    2. For inline (Inline with text) text wrap, the tag used is <tiny-math-inline>.

Note
Visit https://katex.org/docs/supported for a comprehensive list of supported symbols and functions when inserting mathematical equations after selecting "Language (LaTeX)".

Commands

The Math plugin provides the following {productname} commands.