mathpix-markdown-it 1.2.11 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/workspace.xml +744 -371
- package/README.md +39 -13
- package/doc/images/latex-footnotes/latex-footnotes_02.png +0 -0
- package/doc/images/latex-footnotes/latex-footnotes_03.png +0 -0
- package/doc/images/latex-footnotes/latex-footnotes_04.png +0 -0
- package/doc/images/latex-underline/latex-underline_01.png +0 -0
- package/doc/images/latex-underline/latex-underline_02.png +0 -0
- package/doc/images/latex-underline/latex-underline_03.png +0 -0
- package/doc/images/latex-underline/latex-underline_04.png +0 -0
- package/doc/images/latex-underline/latex-underline_05.png +0 -0
- package/doc/images/latex-underline/latex-underline_06.png +0 -0
- package/doc/images/latex-underline/latex-underline_07.png +0 -0
- package/doc/latex-footnotes.md +15 -0
- package/doc/latex-underline.md +83 -0
- package/es5/bundle.js +1 -1
- package/es5/index.js +1 -1
- package/lib/components/mathpix-markdown/index.js +3 -2
- package/lib/components/mathpix-markdown/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js.map +1 -1
- package/lib/markdown/common/consts.js +2 -2
- package/lib/markdown/common/consts.js.map +1 -1
- package/lib/markdown/index.js +3 -2
- package/lib/markdown/index.js.map +1 -1
- package/lib/markdown/mathpix-markdown-plugins.js +3 -2
- package/lib/markdown/mathpix-markdown-plugins.js.map +1 -1
- package/lib/markdown/md-core-rules/set-positions.js +8 -3
- package/lib/markdown/md-core-rules/set-positions.js.map +1 -1
- package/lib/markdown/md-inline-rule/core-inline.js +12 -2
- package/lib/markdown/md-inline-rule/core-inline.js.map +1 -1
- package/lib/markdown/md-inline-rule/underline.d.ts +3 -0
- package/lib/markdown/md-inline-rule/underline.js +200 -0
- package/lib/markdown/md-inline-rule/underline.js.map +1 -0
- package/lib/markdown/md-latex-footnotes/block-rule.js +80 -21
- package/lib/markdown/md-latex-footnotes/block-rule.js.map +1 -1
- package/lib/markdown/md-latex-footnotes/core-rule.js +58 -12
- package/lib/markdown/md-latex-footnotes/core-rule.js.map +1 -1
- package/lib/markdown/md-latex-footnotes/index.js +8 -2
- package/lib/markdown/md-latex-footnotes/index.js.map +1 -1
- package/lib/markdown/md-latex-footnotes/inline-rule.js +12 -3
- package/lib/markdown/md-latex-footnotes/inline-rule.js.map +1 -1
- package/lib/markdown/md-latex-footnotes/inline-ruler2.js +14 -0
- package/lib/markdown/md-latex-footnotes/inline-ruler2.js.map +1 -1
- package/lib/markdown/md-latex-footnotes/interfaces.d.ts +2 -0
- package/lib/markdown/md-latex-footnotes/render-rule.d.ts +2 -0
- package/lib/markdown/md-latex-footnotes/render-rule.js +45 -10
- package/lib/markdown/md-latex-footnotes/render-rule.js.map +1 -1
- package/lib/markdown/md-latex-footnotes/utils.d.ts +1 -0
- package/lib/markdown/md-latex-footnotes/utils.js +72 -21
- package/lib/markdown/md-latex-footnotes/utils.js.map +1 -1
- package/lib/markdown/md-renderer-rules/underline.d.ts +5 -0
- package/lib/markdown/md-renderer-rules/underline.js +141 -0
- package/lib/markdown/md-renderer-rules/underline.js.map +1 -0
- package/lib/markdown/mdPluginText.js +46 -1
- package/lib/markdown/mdPluginText.js.map +1 -1
- package/lib/markdown/rules.js +1 -1
- package/lib/markdown/rules.js.map +1 -1
- package/lib/mathpix-markdown-model/index.d.ts +5 -0
- package/lib/mathpix-markdown-model/index.js +3 -2
- package/lib/mathpix-markdown-model/index.js.map +1 -1
- package/lib/styles/index.js +1 -1
- package/lib/styles/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ OC(=O)c1cc(Cl)cs1
|
|
|
60
60
|
|
|
61
61
|
- [theorems and proofs](doc/theorems.md)
|
|
62
62
|
|
|
63
|
-
```
|
|
63
|
+
```tex
|
|
64
64
|
\newtheorem{theorem}{Theorem}
|
|
65
65
|
\newtheorem{lemma}[theorem]{Lemma}
|
|
66
66
|
|
|
@@ -84,7 +84,7 @@ proceed from there and at some point you will arrive to a contradiction.
|
|
|
84
84
|
|
|
85
85
|
- [Latex footnotes](doc/latex-footnotes.md)
|
|
86
86
|
|
|
87
|
-
```
|
|
87
|
+
```tex
|
|
88
88
|
Footnote marker without text. Auto increment counter to 1 \footnotemark{} should be 1.
|
|
89
89
|
|
|
90
90
|
Footnote marker with text. Auto increment counter to 2 \footnotemark{} be 2. \footnotetext{text should be 2}
|
|
@@ -104,6 +104,26 @@ Auto increment counter to 8 \footnote{text should be 8}
|
|
|
104
104
|
|
|
105
105
|

|
|
106
106
|
|
|
107
|
+
- [Latex underline](doc/latex-underline.md)
|
|
108
|
+
|
|
109
|
+
```tex
|
|
110
|
+
Underline text: \underline{Underlined text!}
|
|
111
|
+
Underline text: \uline{Underlined text!}
|
|
112
|
+
|
|
113
|
+
Double underline text: \underline{\underline{Double underlined text!}}
|
|
114
|
+
Double underline text: \uuline{Double underlined text!}
|
|
115
|
+
|
|
116
|
+
Wavy underlined text: \uwave{This text is underlined with a wavy line!}
|
|
117
|
+
|
|
118
|
+
Dashed underline text: \dashuline{Dashed Underline}
|
|
119
|
+
Dotted underline text: \dotuline{Dotted Underline}
|
|
120
|
+
|
|
121
|
+
Strikethrough text: \sout{Text with a horizontal line through its center!}
|
|
122
|
+
Struck with Hatching text: \xout{Text with hatching pattern!}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+

|
|
126
|
+
|
|
107
127
|
# What is mathpix-markdown-it?
|
|
108
128
|
|
|
109
129
|
**mathpix-markdown-it** is an open source implementation of the mathpix-markdown spec written in Typescript.
|
|
@@ -690,6 +710,7 @@ The `MathpixMarkdown` React element accepts the following props:
|
|
|
690
710
|
| `smiles` | [ISmilesOptions](https://github.com/Mathpix/mathpix-markdown-it#ismilesoptions);*`{}`* | Sets options to output chemistry equation |
|
|
691
711
|
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
|
|
692
712
|
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
|
|
713
|
+
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
|
|
693
714
|
|
|
694
715
|
|
|
695
716
|
## MathpixMarkdownModel methods
|
|
@@ -739,6 +760,7 @@ The `MathpixMarkdown` React element accepts the following props:
|
|
|
739
760
|
| `enableCodeBlockRuleForLatexCommands`| boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
|
|
740
761
|
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
|
|
741
762
|
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
|
|
763
|
+
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
|
|
742
764
|
|
|
743
765
|
### optionsMathpixMarkdown
|
|
744
766
|
|
|
@@ -769,6 +791,7 @@ The `MathpixMarkdown` React element accepts the following props:
|
|
|
769
791
|
| `enableCodeBlockRuleForLatexCommands`| boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
|
|
770
792
|
| `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
|
|
771
793
|
| `codeHighlight` | [CodeHighlight](https://github.com/Mathpix/mathpix-markdown-it#codehighlight);*`{}`* | Sets options to highlight code block |
|
|
794
|
+
| `footnotes` | [Footnotes](https://github.com/Mathpix/mathpix-markdown-it#footnotes);*`{}`* | Sets options to footnotes |
|
|
772
795
|
|
|
773
796
|
### TOutputMath
|
|
774
797
|
|
|
@@ -829,16 +852,6 @@ The `MathpixMarkdown` React element accepts the following props:
|
|
|
829
852
|
| `includeStyles` | boolean *`false`* | Includes mathpix-markdown styles |
|
|
830
853
|
| `includeFonts` | boolean *`false`* | Includes mathpix-markdown fonts |
|
|
831
854
|
|
|
832
|
-
|
|
833
|
-
### TAccessibility
|
|
834
|
-
|
|
835
|
-
| | type *`default`* | description
|
|
836
|
-
|-----------------------------|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
|
|
837
|
-
| `assistiveMml` | boolean *`false`* | Should Assistive MathML be enabled to math (mjx-container). |
|
|
838
|
-
| `sre` | object *`null`* | spe object from library [speech-rule-engine](https://www.npmjs.com/package/speech-rule-engine) for semantic interpretation. |
|
|
839
|
-
| | | If this value is not set then the aria-label for accessibility will not be added to the math at render time. |
|
|
840
|
-
|
|
841
|
-
|
|
842
855
|
### ParserErrors enum
|
|
843
856
|
|
|
844
857
|
| | |
|
|
@@ -854,8 +867,21 @@ The `MathpixMarkdown` React element accepts the following props:
|
|
|
854
867
|
| `auto` | boolean *`false`* | Highlighting with language detection |
|
|
855
868
|
| `code` | boolean *`true`* | Add code highlighting for a code block which created by indenting. To auto-detect the language, set auto=true |
|
|
856
869
|
|
|
857
|
-
|
|
870
|
+
### Footnotes
|
|
871
|
+
|
|
872
|
+
| | type *`default`* | |
|
|
873
|
+
|----------------|-----------------------------|-------------------------------------------|
|
|
874
|
+
| `fontSize` | string *`unset`* | Ability to change font size for footnotes |
|
|
875
|
+
|
|
876
|
+
### TAccessibility
|
|
858
877
|
|
|
878
|
+
| | type *`default`* | description
|
|
879
|
+
|-----------------------------|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
|
|
880
|
+
| `assistiveMml` | boolean *`false`* | Should Assistive MathML be enabled to math (mjx-container). |
|
|
881
|
+
| `sre` | object *`null`* | spe object from library [speech-rule-engine](https://www.npmjs.com/package/speech-rule-engine) for semantic interpretation. |
|
|
882
|
+
| | | If this value is not set then the aria-label for accessibility will not be added to the math at render time. |
|
|
883
|
+
|
|
884
|
+
`sre` Has different loaders for node and browser.
|
|
859
885
|
1. For **Browser libraries**, synchronous loading is used.
|
|
860
886
|
```js
|
|
861
887
|
import { loadSre } from "mathpix-markdown-it/lib/sre/sre-browser";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/doc/latex-footnotes.md
CHANGED
|
@@ -58,3 +58,18 @@ footnote\footnotetext{Specifically, I'd write comments in this one.}.
|
|
|
58
58
|
This example produces the following output:
|
|
59
59
|
|
|
60
60
|

|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## Example: using `\blfootnotetext`
|
|
64
|
+
|
|
65
|
+
The `\blfootnotemark` command allows to add footnotes without a marker
|
|
66
|
+
|
|
67
|
+
```tex
|
|
68
|
+
The footnote \footnote{Footnote with marker}
|
|
69
|
+
|
|
70
|
+
\blfootnotetext{Footnote without marker}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This example produces the following output:
|
|
74
|
+
|
|
75
|
+

|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
## Underline, bold and italize text
|
|
2
|
+
|
|
3
|
+
We can print bold, italicized, and underlined text using the commands `\textbf`, `\textit`, and `\underline`, respectively.
|
|
4
|
+
|
|
5
|
+
For example:
|
|
6
|
+
```
|
|
7
|
+
\textbf{Bold text}
|
|
8
|
+
\textit{Italic text}
|
|
9
|
+
\underline{Underlined text}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This example produces the following output:
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Double underline
|
|
18
|
+
|
|
19
|
+
Double underlining text can be done easily using the command `\underline` twice or using the command `\uuline`:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
\underline{\underline{Double underlined text!}}
|
|
23
|
+
|
|
24
|
+
\uuline{Double underlined text!}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
produces the output:
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Wavy underlined text
|
|
33
|
+
|
|
34
|
+
We can easily create wavy underlined text using the command `\uwave{}`. Here is an illustrative example:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
\uwave{This text is underlined with a wavy line!}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
which produces the following result:
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Strikethrough text
|
|
46
|
+
|
|
47
|
+
The command `\sout{}` which can be used to strikethrough text. Check this example:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
\sout{Text with a horizontal line through its center!}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
compiling this code yields:
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Slash through letter
|
|
59
|
+
|
|
60
|
+
The command `\xout{}` can be used to create a hatching effect through text. Here is a basic usage of this command:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
\xout{Text with hatching pattern!}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This code yields the following:
|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## Dashed and dotted underline
|
|
72
|
+
|
|
73
|
+
The commands `\dashuline{}` and `\dotuline{}` as their names state can be used to create dashed and dotted lines under text respectively. Check the following code:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
\dashuline{Dashed Underline}
|
|
77
|
+
|
|
78
|
+
\dotuline{Dotted Underline}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
which produces the following output:
|
|
82
|
+
|
|
83
|
+

|