typora-issues
typora-issues copied to clipboard
Option to choose Math (LaTeX / MathJax) delimiters
Sometimes it's more convenient to use the ( ) math environment delimiters than dollar signs. Being able to choose would also make import/export easier with other MathJax-enabled apps.
Just wanted to second this - using $ $ and $$\n \n$$ for equations does not play nice with standard tools like marked 2. While you can modify marked 2 to use the dollar sign delimiters it would prefer to see $$MATH HERE$$ rather than
$$ MATH HERE $$
as typora produces. Since marked is my main tool for turning markdown into production PDFs I was also hoping typora could be modified to allow for ( ) and [ ] delimiters.
Thanks!
Would it be possible to modify the Typora app so that additional text can be included after the closing inline delimiter? i.e. I think the current closing inline delimiter must be $$\n.
After editing in Typora, I would like to process markdown files through pandoc-crossref (https://github.com/lierdakil/pandoc-crossref). For example:
pandoc input.md --filter=pandoc-crossref -o input.tex
At the moment, the following renders okay in the Typora preview:
Test here.
$$a+b=c$$ {#eq:name}
More text here.

But the following breaks the Typora preview:
Test here.
$$
a+b=c
$$ {#eq:name}
More text here.

Would love to see an option to choose LaTeX syntax \(...\) for inline math, and \[...\] for display math as well, instead of TeX syntax $...$ and $$...$$.
It's made into LaTeX syntax anyway when exported to LaTeX / converted via pandoc.
@masonlr I had the same problem, luckily there is a solution now.
Writing this here just for reference, since this issue seems to relate to being able to choose any MathJax delimiters.
Currently, typora supports align by doing:
$$
\begin{align}
...
\end{align}
$$
However this will not render when not exporting using File -> Export, but instead converting to .tex or .pdf using pandoc.
Therefore I suggest that having:
\begin{align}
...
\end{align}
by itself should also trigger a live preview, just like $$ does.
Here is further motivation to get working align environment implemented:
There is a school of thought that adheres to the rule that all equations should be numbered. Why this is was best expressed by physicist David Mermin in his column What's Wrong with These Equations (Physics Today, 1989):
[...]Fisher's rule is for the benefit not of the author, but the reader.
For although you, dear author, may have no need to refer in your text to the equations you therefore left unnumbered, it is presumptuous to assume the same disposition in your readers. And though you may well have acquired the solipsistic habit of writing under the assumption that you will have no readers at all, you are wrong. There is always the referee. The referee may desire to make reference to equations that you did not. Beyond that, should fortune smile upon you and others actually have occasion to mention your analysis in papers of their own, they will not think the better of you for forcing them into such locutions as "the second equation after (3.21)" or "the third unnumbered equation from the top in the left-hand column on p.2485." Even should you solipsistically choose to publish in a journal both unrefereed and unread, you might subsequently desire (just for the record) to publish an erratum, the graceful flow of which could only be ensured if you had adhered to Fisher's rule in your original manuscript. Full text here.
But this cannot be done in an equation environment, that is meant for one displayed/numbered equation, which is all Typora supports for live preview!
Originally found in this SE discussion. While there is not unanimous agreement on Ficher's rule (number all equations, see SE discussion), it sure would be nice to at least have the option to adhere to it.
I'll cite my vision from 2685 here. It was named as
feature request: Add more supported LaTeX equation formats
and contained the following:
Many scientific texts contain equations. Currently texts are sometimes written in RMarkdown.
Some texts are books and articles written in bookdown, some of texts are presentations written with xaringan.
Below is the feature request to support more LaTeX equation notations such as:
Environment `\begin{equation}...\end{equation}` with auto-numbering: \begin{equation} h(z) = \sinh(z) \end{equation} --- Environment `\begin{equation}...(\#eq:label)\end{equation}` with auto-numbering and label (for bookdown): \begin{equation} f\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k} (\#eq:binom) \end{equation} --- Environment `\begin{equation}...\label{label}\end{equation}` with auto-numbering label for xaringan \begin{equation} g\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k} \label{binom2} \end{equation}This functionality is currently exists in other editors
But it is missed in Typora editor.
In this feature request I ask only for rendering of equations. Auto-numbering is not needed for me. I'll do it in RStudio after knitting of the document.
I too would love to be able to do this:
\\[
\begin{blah}
\ldots
\end{blah}
\\]
The main reason I would love this is for compatibility with other editors/previewers. Though, if there was a Typora iOS app, it wouldn't mean so much to me 😜
relates #2448
I second this feature request! Especially the \begin{equation} \end{equation} tags will make Typora a full-feature alternative to Rstudio for Rmd files and bookdown. These are becoming the new open source standard in scientific publishing.
Just wanted to second this. iA Writer, for example, does not recognize
$$
\math
$$
but do recognize
\\[
\math
\\]
Would be nice to be able to change the math delimiters so that my notes created on my computer could be read on iA Writer, on my phone too. Obviously, an iOS Typora app would also help...
Still needed. The below code is not rendered
Environment `\begin{equation}...\end{equation}`
with auto-numbering:
\begin{equation}
h(z) = \sinh(z)
\end{equation}
---
Environment `\begin{equation}...(\#eq:label)\end{equation}`
with auto-numbering and label (for bookdown):
\begin{equation}
f\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k}
(\#eq:binom)
\end{equation}
---
Environment `\begin{equation}...\label{label}\end{equation}`
with auto-numbering label for xaringan
\begin{equation}
g\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k}
\label{binom2}
\end{equation}
in Typora 0.9.98.
Still a problem with 0.11.6.
Still a problem with 1.0. I will not buy your great software until this bug get fixed. Downgraded to free 0.11.18-1.
Still a problem with 1.0.4.
Any progress?
There are several reasons to support (...) delimiters. Mainly because they are reversible (if I change ( and ) to $, I cannot go back easily). Moreover, ChatGPT uses Markdown with MathJax delimiters for LaTeX, which cannot be rendered directly by Typora. I asked ChatGPT for Markdown readers supporting MathJax syntax. Amazingly, I got that Typora supports it (I transcribe the conversation for fun!)
Markdown readers that can interpret the \( and \) LaTeX math delimiters typically rely on MathJax or KaTeX for rendering, as opposed to the $ syntax commonly used in inline LaTeX math. Here are a few options for Linux Markdown readers that support this syntax:
1. Typora
- Overview: Typora is a popular Markdown editor with built-in support for LaTeX equations using the
\(and\)syntax. - Installation:
- Download the
.debor.rpmpackage from the Typora website. - Install via your package manager:
sudo dpkg -i typora*.deb # For Debian-based systems sudo rpm -i typora*.rpm # For Red Hat-based systems
- Download the
- Usage:
- Typora renders
\(and\)inline math syntax automatically as you type. - For display math, use
\[ ... \].
- Typora renders
2. Zettlr
- Overview: Zettlr is a Markdown editor that supports LaTeX syntax rendered via MathJax, including the
\(and\)delimiters. - Installation:
- Download the
.AppImageor other packages from the Zettlr website. - Make the AppImage executable:
chmod +x Zettlr*.AppImage ./Zettlr*.AppImage
- Download the
- Usage:
- Enable MathJax rendering in the preferences.
- Supports both inline (
\(and\)) and block (\[ ... \]) math.
3. Obsidian
- Overview: Obsidian is a powerful Markdown editor that supports LaTeX via MathJax with
\(and\)delimiters. - Installation:
- Download the Linux package from the Obsidian website.
- Install the
.AppImageor extract and run the binary.
- Usage:
- Open Obsidian settings and enable LaTeX rendering.
- Math will render automatically using
\(and\)syntax.
4. MarkText
- Overview: MarkText is an open-source Markdown editor that supports LaTeX rendering with
\(and\)delimiters. - Installation:
- Install using AppImage, Snap, or AUR (for Arch Linux users):
snap install marktext
- Install using AppImage, Snap, or AUR (for Arch Linux users):
- Usage:
- Use
\(for inline math and\[ ... \]for block math. - MathJax rendering is built-in.
- Use
5. VS Code with Markdown Extensions
- Overview: Visual Studio Code with the right extensions can render LaTeX math using
\(and\)syntax. - Installation:
- Install VS Code:
sudo apt install code # On Debian/Ubuntu systems - Install the "Markdown+Math" extension or similar.
- Install VS Code:
- Usage:
- Open a
.mdfile and ensure MathJax is enabled in the extension settings.
- Open a
Recommendation
If you're looking for simplicity and a user-friendly interface, Typora is the best choice. If you're already using VS Code, the Markdown+Math extension will integrate seamlessly into your workflow.
By default, Typora uses $...$ for inline math and $$...$$ for block math. If you want to use \(...\) and \[...\] delimiters, you’ll need to adjust its Math Rendering settings.
Steps to Enable \(...\) in Typora
-
Open Preferences:
- In Typora, go to
File>Preferences(orCtrl + ,).
- In Typora, go to
-
Enable MathJax Rendering:
- In the Preferences window, navigate to
Markdown>Math Rendering. - Ensure MathJax is selected as the rendering engine.
- In the Preferences window, navigate to
-
Modify Math Delimiters:
- Click on the Edit Config button next to MathJax.
- This will open the MathJax configuration file, which allows you to customize the delimiters.
-
Update MathJax Delimiters:
- Look for the
texsection in the MathJax configuration. Add support for\(...\)and\[...\]by modifying theinlineMathanddisplayMatharrays. Update them as follows:tex: { inlineMath: [["$", "$"], ["\\(", "\\)"]], displayMath: [["$$", "$$"], ["\\[", "\\]"]] } - This ensures that both
$...$and\(...\)are recognized for inline math, and both$$...$$and\[...\]are recognized for block math.
- Look for the
-
Save and Restart Typora:
- Save the configuration file.
- Restart Typora for the changes to take effect.
Test the Configuration
Create a Markdown file with the following content to test:
Inline math: \( a^2 + b^2 = c^2 \) or $a^2 + b^2 = c^2$.
Block math:
\[
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\]
or
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$
If Typora is configured correctly, both types of delimiters (\(...\) and $...$) should render properly.
If you don’t see the Math Rendering option in Typora, it might be due to one of the following reasons:
-
Older Version of Typora:
- The MathJax configuration might not be exposed directly in the UI for older versions of Typora.
-
Typora Stable Release:
- In some distributions, the Math Rendering configuration might not be available in the stable release. Recent versions may have improved configurability.
Solution: Manually Edit the Typora Configuration
You can manually edit Typora's configuration files to add support for \(...\) delimiters. Here’s how:
Locate Typora's Configuration File
The configuration file typically resides in one of these locations depending on your operating system:
-
Linux:
~/.config/Typora/conf/conf.user.json -
Windows:
%APPDATA%\Typora\conf\conf.user.json -
MacOS:
~/Library/Application Support/abnerworks.Typora/conf/conf.user.json
Modify the Math Rendering Delimiters
-
Open the
conf.user.jsonfile with a text editor:nano ~/.config/Typora/conf/conf.user.json -
Look for the
mathsection. If it doesn’t exist, add it like this:"math": { "inlineMath": [["$", "$"], ["\\(", "\\)"]], "displayMath": [["$$", "$$"], ["\\[", "\\]"]] } -
Save the file and restart Typora.
I could not manage to make it work!
There are several reasons to support (...) delimiters. Mainly because they are reversible (if I change ( and ) to $, I cannot go back easily). Moreover, ChatGPT uses Markdown with MathJax delimiters for LaTeX, which cannot be rendered directly by Typora. I asked ChatGPT for Markdown readers supporting MathJax syntax. Amazingly, I got that Typora supports it (I transcribe the conversation for fun!)
Markdown readers that can interpret the
\(and\)LaTeX math delimiters typically rely on MathJax or KaTeX for rendering, as opposed to the$syntax commonly used in inline LaTeX math. Here are a few options for Linux Markdown readers that support this syntax:1. Typora
Overview: Typora is a popular Markdown editor with built-in support for LaTeX equations using the
\(and\)syntax.Installation:
- Download the
.debor.rpmpackage from the Typora website.- Install via your package manager: sudo dpkg -i typora*.deb # For Debian-based systems sudo rpm -i typora*.rpm # For Red Hat-based systems
Usage:
- Typora renders
\(and\)inline math syntax automatically as you type.- For display math, use
\[ ... \].2. Zettlr
Overview: Zettlr is a Markdown editor that supports LaTeX syntax rendered via MathJax, including the
\(and\)delimiters.Installation:
- Download the
.AppImageor other packages from the Zettlr website.- Make the AppImage executable: chmod +x Zettlr*.AppImage ./Zettlr*.AppImage
Usage:
- Enable MathJax rendering in the preferences.
- Supports both inline (
\(and\)) and block (\[ ... \]) math.3. Obsidian
Overview: Obsidian is a powerful Markdown editor that supports LaTeX via MathJax with
\(and\)delimiters.Installation:
- Download the Linux package from the Obsidian website.
- Install the
.AppImageor extract and run the binary.Usage:
- Open Obsidian settings and enable LaTeX rendering.
- Math will render automatically using
\(and\)syntax.4. MarkText
Overview: MarkText is an open-source Markdown editor that supports LaTeX rendering with
\(and\)delimiters.Installation:
- Install using AppImage, Snap, or AUR (for Arch Linux users): snap install marktext
Usage:
- Use
\(for inline math and\[ ... \]for block math.- MathJax rendering is built-in.
5. VS Code with Markdown Extensions
Overview: Visual Studio Code with the right extensions can render LaTeX math using
\(and\)syntax.Installation:
- Install VS Code: sudo apt install code # On Debian/Ubuntu systems
- Install the "Markdown+Math" extension or similar.
Usage:
- Open a
.mdfile and ensure MathJax is enabled in the extension settings.Recommendation
If you're looking for simplicity and a user-friendly interface, Typora is the best choice. If you're already using VS Code, the Markdown+Math extension will integrate seamlessly into your workflow.
By default, Typora uses
$...$for inline math and$$...$$for block math. If you want to use\(...\)and\[...\]delimiters, you’ll need to adjust its Math Rendering settings.Steps to Enable
\(...\)in Typora
Open Preferences:
- In Typora, go to
File>Preferences(orCtrl + ,).Enable MathJax Rendering:
- In the Preferences window, navigate to
Markdown>Math Rendering.- Ensure MathJax is selected as the rendering engine.
Modify Math Delimiters:
- Click on the Edit Config button next to MathJax.
- This will open the MathJax configuration file, which allows you to customize the delimiters.
Update MathJax Delimiters:
- Look for the
texsection in the MathJax configuration. Add support for\(...\)and\[...\]by modifying theinlineMathanddisplayMatharrays. Update them as follows: tex: { inlineMath: [["$", "$"], ["\(", "\)"]], displayMath: [["$$", "$$"], ["\[", "\]"]] }- This ensures that both
$...$and\(...\)are recognized for inline math, and both$$...$$and\[...\]are recognized for block math.Save and Restart Typora:
- Save the configuration file.
- Restart Typora for the changes to take effect.
Test the Configuration
Create a Markdown file with the following content to test:
Inline math: ( a^2 + b^2 = c^2 ) or $a^2 + b^2 = c^2$.
Block math: [ \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} ]
or
$$ \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} $$ If Typora is configured correctly, both types of delimiters (
\(...\)and$...$) should render properly.If you don’t see the Math Rendering option in Typora, it might be due to one of the following reasons:
Older Version of Typora:
- The MathJax configuration might not be exposed directly in the UI for older versions of Typora.
Typora Stable Release:
- In some distributions, the Math Rendering configuration might not be available in the stable release. Recent versions may have improved configurability.
Solution: Manually Edit the Typora Configuration
You can manually edit Typora's configuration files to add support for
\(...\)delimiters. Here’s how:Locate Typora's Configuration File
The configuration file typically resides in one of these locations depending on your operating system:
- Linux:
~/.config/Typora/conf/conf.user.json- Windows:
%APPDATA%\Typora\conf\conf.user.json- MacOS:
~/Library/Application Support/abnerworks.Typora/conf/conf.user.jsonModify the Math Rendering Delimiters
- Open the
conf.user.jsonfile with a text editor: nano ~/.config/Typora/conf/conf.user.json- Look for the
mathsection. If it doesn’t exist, add it like this: "math": { "inlineMath": [["$", "$"], ["\(", "\)"]], "displayMath": [["$$", "$$"], ["\[", "\]"]] }- Save the file and restart Typora.
I could not manage to make it work!
This is not true. Obsidian doesn't use "(" and neither does Typora, or Marktext. Where did you get all this info from? OHH, it's GPT's hallucination!!!
supported in v1.11
