From f0b7f846a903de61f6ab8e8630cfcebaf58069c4 Mon Sep 17 00:00:00 2001 From: Giacomo Bertelli <42670032+gamberoillecito@users.noreply.github.com> Date: Sun, 10 Aug 2025 10:49:51 +0200 Subject: [PATCH] Update 05-latex-commands.md Added note about preventing the default behaviour of the ESC key --- docs/mathfield/05-latex-commands.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/mathfield/05-latex-commands.md b/docs/mathfield/05-latex-commands.md index 8832af6..59841e8 100644 --- a/docs/mathfield/05-latex-commands.md +++ b/docs/mathfield/05-latex-commands.md @@ -16,8 +16,20 @@ Mathfields support over **800** LaTeX commands. **To enter a LaTeX command in mathfield** press the ESC key or \\ to enter LaTeX editing mode. Press ESC to exit LaTeX editing mode. + **To examine the LaTeX code for an expression**, select it, then press ESC. +:::info[Note] +If you want to prevent users from entering into the LaTeX mode, you can add the following event listener to the MathField: + +```ts +mf.addEventListener('mode-change', (ev)=>{ev.preventDefault();}) +``` + + +Learn more about changes on a MathField. + +::: The most common symbols can be entered using **keyboard shortcuts**. @@ -2223,4 +2235,4 @@ TeX packages or macros. | `\csname`
`\endcsname` | Turn the next tokens, until `\endcsname`, into a command | | `\ensuremath{}` | If in Math Mode, does nothing. Otherwise, switch to Math Mode. | - \ No newline at end of file +