typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 56 forks source link

Option to choose Math (LaTeX / MathJax) delimiters #63

Open elizhenning opened 8 years ago

elizhenning commented 8 years ago

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.

badralbanna commented 8 years ago

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!

masonlr commented 7 years ago

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.

inline

But the following breaks the Typora preview:

Test here.

$$
a+b=c
$$ {#eq:name}

More text here.

display

gandalfsaxe commented 6 years ago

Would love to see an option to choose LaTeX syntax \(...\) for inline math, and \[...\] for display math as well, instead of TeX syntax $...$ and $$...$$.

gandalfsaxe commented 6 years ago

It's made into LaTeX syntax anyway when exported to LaTeX / converted via pandoc.

gandalfsaxe commented 6 years ago

@masonlr I had the same problem, luckily there is a solution now.

gandalfsaxe commented 6 years ago

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.

gandalfsaxe commented 6 years ago

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.

N0rbert commented 5 years ago

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

retext

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.

cssaus commented 5 years ago

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 😜

abnerlee commented 4 years ago

relates #2448

peverati commented 4 years ago

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.

raphaelhuleux commented 4 years ago

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...

N0rbert commented 3 years ago

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.

N0rbert commented 2 years ago

Still a problem with 0.11.6.

N0rbert commented 2 years ago

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.

N0rbert commented 2 years ago

Still a problem with 1.0.4.

zdaiot commented 1 week ago

Any progress?