# Inline math mode does not work in latest update 2.13.8

**URL:** https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119
**Category:** Support
**Created:** [6 December 2023 11:42 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119 "2023-12-06T11:42:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![antonife](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/antonife/32/18848_2.png) [@antonife](https://discourse.joplinapp.org/u/antonife)
#### Post date: [6 December 2023 11:42 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119/1 "2023-12-06T11:42:45Z")

</div>

### Operating system

macOS

### Joplin version

2.13.8

### Sync target

File system

### Editor

Rich Text Editor

### What issue do you have?

The maths equations in inline mode don't display properly in either the rich text editor or after exporting the document to pdf format. Instead of the equations, the following text reads: "Cannot read properties of undefined (reading 'map')". As far as I know, inline mode worked in the earlier versions of Joplin.

Does anyone know how to fix this? Thanks

### Screenshots

 ![Screenshot 2023-12-06 at 12.42.26.png](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/8/9/8971a3fc4da238449e44b111d067ed6ce9ca2fb3.png)

---

<div class="post-metadata">

### Author: ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)
#### Post date: [6 December 2023 12:59 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119/2 "2023-12-06T12:59:14Z")

</div>

I can reproduce this, but only when using `\begin{align}` (and not `\begin{align*}`). I suspect it's related to numbering.

Thank you for reporting this!

---

<div class="post-metadata">

### Author: ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)
#### Post date: [6 December 2023 13:00 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119/4 "2023-12-06T13:00:04Z")

</div>

Please provide the text as text so that we can copy and paste and verify

---

<div class="post-metadata">

### Author: ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)
#### Post date: [6 December 2023 13:00 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119/5 "2023-12-06T13:00:11Z")

</div>

Sample:

```tex
$$
\begin{align}
    \texttt{Numbered block math}
\end{align}
$$

$\texttt{Inline math}$

```

---

<div class="post-metadata">

### Author: ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)
#### Post date: [6 December 2023 13:29 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119/6 "2023-12-06T13:29:34Z")

</div>

From debugging, it looks like `\begin{align} ... \end{align}` is creating a macro in a format not recognized by Joplin's [`stringifyKatexOptions`](https://github.com/laurent22/joplin/blob/3c40854a8ceb40415b2e52ae60f9322871623836/packages/renderer/MdToHtml/rules/katex.ts#L50):

```auto
{
    '\@eqnsw': '1',
    '\myothermacro': { tokens: Array (7), numArgs: 0, ... }
}

```

`stringifyKatexOptions` expects all macros to have a `.tokens` property.

---

<div class="post-metadata">

### Author: ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)
#### Post date: [6 December 2023 13:33 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119/7 "2023-12-06T13:33:59Z")

</div>

Reported on GitHub:

> <https://github.com/laurent22/joplin/issues/9455>
>
> \### Operating system
> 
> Linux, Android, iOS
> 
> \### Joplin version
> 
> 2.13.8
> 
> \#…## Desktop version info
> 
> Joplin 2.13.8 (prod, linux)
> 
> Client ID: 8e9dffaf041d4d34929b525a8c87104a
> Sync Version: 3
> Profile Version: 44
> Keychain Supported: No
> 
> Revision: 604dcbc
> 
> Freehand Drawing: 2.5.0
> 
> \### Current behaviour
> 
> 
> To reproduce, create a note with the following content:
> \`\`\`md
> $$
> \\begin{align}
> \\text{Block}
> \\end{align}
> $$
> 
> $\\text{Inline}$.
> \`\`\`
> 
> \### Expected behaviour
> 
> Joplin should render the inline KaTeX.
> 
> \### Logs
> 
> Exception and stack trace:
> 
> \`\`\`
> /tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/MdToHtml/rules/katex.js:243 Katex error for: test TypeError: Cannot read properties of undefined (reading 'map')
> at stringifyKatexOptions (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/MdToHtml/rules/katex.js:45:56)
> at renderToStringWithCache (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/MdToHtml/rules/katex.js:227:49)
> at katexInline (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/MdToHtml/rules/katex.js:261:30)
> at Object.inlineRenderer \[as math\_inline\] (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/MdToHtml/rules/katex.js:269:20)
> at Renderer.renderInline (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/node\_modules/markdown-it/lib/renderer.js:275:28)
> at Renderer.render (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/node\_modules/markdown-it/lib/renderer.js:330:22)
> at MarkdownIt.render (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/node\_modules/markdown-it/lib/index.js:544:24)
> at MdToHtml.\<anonymous\> (/tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/MdToHtml.js:395:45)
> at Generator.next (\<anonymous\>)
> at /tmp/.mount\_Joplinm45GpJ/resources/app.asar/node\_modules/@joplin/lib/node\_modules/@joplin/renderer/MdToHtml.js:8:71
> \`\`\`

This also affects the new versions of the mobile apps.

I've created a [pull request](https://github.com/laurent22/joplin/pull/9456) that should fix this based on the `release-2.13` branch. Hopefully we can do a bug fix release for this!

**Edit** :  
This should be fixed in the latest version:

> **[Release v2.13.9 · laurent22/joplin](https://github.com/laurent22/joplin/releases/tag/v2.13.9)**
>
> Fixed: Fix KaTeX rendering (#9456) (#9455 by Henry Heino)

Thank you again for reporting this!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/c/1c948e33314e232a0927789508474d8624f4270b.png) [@system](https://discourse.joplinapp.org/u/system)
#### Post date: [5 January 2024 13:34 UTC](https://discourse.joplinapp.org/t/inline-math-mode-does-not-work-in-latest-update-2-13-8/34119/8 "2024-01-05T13:34:35Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
