goessner / mdmath

LaTeX Math for Markdown inside of Visual Studio Code.
MIT License
750 stars 57 forks source link

copy and pasting the test table into a .md file fails #24

Closed johndpope closed 7 years ago

johndpope commented 7 years ago

Summary

copy and pasting the test table into a .md file fails ...

Expected behavior

tests should pass. ...

Actual behavior

Markdown+Math Tests

i valid src render comment 0 😊 1+1=21+1=2 1+1=21+1=2

simple equation starting and ending with numbers. 1 😊 1+1<31+1<3 1+1<31+1<3

simple equation including special html character. 2 😊 xx xx

inline equation with single character 3 😊 \varphiΟ† \varphiΟ†

inline equation with single greek character 4 😊 You get 3$ if you solve 1+21+2 You get 3$ if you solve 1+21+2

use of currency symbol 5 😊 If you solve 1+21+2 you get $3 If you solve 1+21+2 you get $3

use of currency symbol 6 😊 \frac{1}{2} ​2 ​ ​1 ​​ \frac{1}{2} ​2 ​ ​1 ​​

inline fraction 7 😊 \begin{pmatrix}x\y\end{pmatrix}( ​x ​y ​​ ) \begin{pmatrix}x\y\end{pmatrix}( ​x ​y ​​ )

inline column vector 8 😊 {\tilde\bold e}\alpha ​e ​~ ​​ ​α ​​ {\tilde\bold e}\alpha ​e ​~ ​​ ​α ​​

inline bold vector notation 9 😊 a^{b}a ​b ​​ a^{b}a ​b ​​

exponentiation 10 😊 a^ba β€‹βˆ— ​​ b with a^a β€‹βˆ— ​​ a^ba β€‹βˆ— ​​ b with a^a β€‹βˆ— ​​

conjugate complex 11 😊 {e}_xe ​x ​​

e_\alphae ​α ​​ {e}_xe ​x ​​

e_\alphae ​α ​​

greek index 12 😊 ParseError: KaTeX parse error: Expected 'EOF', got '$' at position 1: $Μ²c{\bold e}_x = …$ c{\bold e}x = a{\bold e}\alpha - b\tilde{\bold e}_\alphace ​x ​​ =ae ​α ​​ βˆ’b ​e ​~ ​​ ​α ​​

underline tests 13 😊 a1+1=21+1=2 1+1=21+1=2b cxxd a1+1=21+1=2 1+1=21+1=2b cxxd

non-numeric character before opening $ or after closing $ or both is allowed. 14 😊 xx $ xx $

following dollar character '$' is allowed. 15 😊 xx yy xx yy

consecutive inline equations. 16 😊 ParseError: KaTeX parse error: Expected 'EOF', got '$' at position 1: $̲1+1=2$ 1+1=21+1=2

display equation on its own single line. 17 😊 $$ 1+1=2 $$ 1+1=2 1+1=2

display equation with line breaks. 18 😊 $$\begin{matrix} f & = & 2 + x + 3 \ & = & 5 + x \end{matrix}$$ \begin{matrix} f & = & 2 + x + 3 \ & = & 5 + x \end{matrix} ​f ​ ​​ ​= ​= ​​ ​2+x+3 ​5+x ​​

multiline equation. 19 😊 $$\begin{pmatrix}x_2 \ y_2 \end{pmatrix} = \begin{pmatrix} A & B \ C & D \end{pmatrix}\cdot \begin{pmatrix} x_1 \ y_1 \end{pmatrix}$$ \begin{pmatrix}x_2 \ y_2 \end{pmatrix} = \begin{pmatrix} A & B \ C & D \end{pmatrix}\cdot \begin{pmatrix} x_1 \ y_1 \end{pmatrix}( ​x ​2 ​​ ​y ​2 ​​ ​​ )=( ​A ​C ​​ ​B ​D ​​ )β‹…( ​x ​1 ​​ ​y ​1 ​​ ​​ )

vector equation. 20 😊 ParseError: KaTeX parse error: Expected 'EOF', got '$' at position 1: $Μ²f(x) = x^2 - 1$ (1) f(x) = x^2 - 1f(x)=x ​2 ​​ βˆ’1 (1)

display equation with equation number. 21 😊 codea-baβˆ’b codea-baβˆ’b

inline equation following code section. 22 😊 ``` code

a+ba+b

code

a+ba+b

equation following code block. 23 😊 ``` code a+ba+b (1) code

a+ba+b (1)

numbered equation following code block. 24 😊 1. 1+21+2 2. 2+32+3 1. 3+43+4

1+21+2

2+32+3

3+43+4

Equations in list. 25 😊 \sum{i=1}^nβˆ‘ ​i=1 ​n ​​ \sum{i=1}^nβˆ‘ ​i=1 ​n ​​

Inline sum. 26 😊 ParseError: KaTeX parse error: Expected 'EOF', got '$' at position 1: $Μ²\sum{i=1}^n$ \sum{i=1}^n ​i=1 β€‹βˆ‘ ​n ​​

Sum without equation number. 27 😊 ParseError: KaTeX parse error: Expected 'EOF', got '$' at position 1: $Μ²\sum{i=1}^n$ (2) \sum{i=1}^n ​i=1 β€‹βˆ‘ ​n ​​ (2)

Sum with equation number. 28 😊 $${\bold e}(\varphi) = \begin{pmatrix} \cos\varphi\sin\varphi \end{pmatrix}$$ (3) {\bold e}(\varphi) = \begin{pmatrix} \cos\varphi\\sin\varphi \end{pmatrix}e(Ο†)=( ​cosΟ† ​sinΟ† ​​ ) (3)

equation number always vertically aligned. 29 😊 > see a = b + ca=b+c

c^2=a^2+b^2c ​2 ​​ =a ​2 ​​ +b ​2 ​​ (2) c^2=a^2+b^2c ​2 ​​ =a ​2 ​​ +b ​2 ​​ see a = b + ca=b+c

c^2=a^2+b^2c ​2 ​​ =a ​2 ​​ +b ​2 ​​ (2)

c^2=a^2+b^2c ​2 ​​ =a ​2 ​​ +b ​2 ​​

equations in blockquote. 30 😑 3$1+1=2$ $1+1=2$4 5$x$6 3$1+1=2$ $1+1=2$4 5$x$6

numeric character before opening $ or after closing $ is not allowed. 31 😑 $ $ $ x$ $x $ $ $ $ x$ $x $

whitespace character after opening $ or before closing $ is not allowed. 32 😑 $1+1=2$ $1+1=2$ 1+1=21+1=2 1+1=21+1=2

escaped dollars '$' are interpreted as dollar '$' characters.+ 33 😑 1+1=21+1=2$1+1=2$ 1+1=21+1=2$1+1=2$

at least one character (whitespace) is required between two inline formulas. 34 😑 $1+1= 2$ $1+1= 2$

line break in inline equation is not allowed. ...

Steps to reproduce

  1. First step
  2. Second step
  3. Third step

Code example

Some markdown code ...

... with issues.

Related links

Environment

     Operating system: ___
       VSCode version: ___
Markdown+Math version: ___
goessner commented 7 years ago

Hi John,

nice idea .. I never tried this. I will have a look into it, but would like to postpone that until after the next major update.

Thanks for your effort

Stefan

johndpope commented 7 years ago

hi @goessner - fyi - I found these projects = im2latext https://github.com/search?utf8=%E2%9C%93&q=im2latex&type=

They have an training extensive which includes a list 12mb - of latex formulas -see here im2latex_formulas.lst https://zenodo.org/record/56198#.WVVXzBIrKgx

johndpope commented 7 years ago

also -fyi - there's a treasure trove of machine learning latex functions here https://github.com/soulmachine/machine-learning-cheat-sheet

johndpope commented 7 years ago

closing this