mathpix-markdown-it 1.2.12 → 1.2.14

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.
Files changed (57) hide show
  1. package/.idea/workspace.xml +568 -487
  2. package/README.md +37 -13
  3. package/doc/images/latex-footnotes/latex-footnotes_02.png +0 -0
  4. package/doc/images/latex-footnotes/latex-footnotes_03.png +0 -0
  5. package/doc/images/latex-footnotes/latex-footnotes_04.png +0 -0
  6. package/doc/images/latex-underline/latex-underline_07.png +0 -0
  7. package/doc/latex-footnotes.md +15 -0
  8. package/es5/bundle.js +1 -1
  9. package/es5/index.js +1 -1
  10. package/lib/components/mathpix-markdown/index.js +3 -2
  11. package/lib/components/mathpix-markdown/index.js.map +1 -1
  12. package/lib/index.d.ts +2 -2
  13. package/lib/index.js.map +1 -1
  14. package/lib/markdown/common/consts.js +2 -2
  15. package/lib/markdown/common/consts.js.map +1 -1
  16. package/lib/markdown/index.js +3 -2
  17. package/lib/markdown/index.js.map +1 -1
  18. package/lib/markdown/mathpix-markdown-plugins.js +3 -2
  19. package/lib/markdown/mathpix-markdown-plugins.js.map +1 -1
  20. package/lib/markdown/md-block-rule/begin-tabular/common.js +2 -2
  21. package/lib/markdown/md-block-rule/begin-tabular/common.js.map +1 -1
  22. package/lib/markdown/md-block-rule/begin-tabular/tabular-td.js +8 -1
  23. package/lib/markdown/md-block-rule/begin-tabular/tabular-td.js.map +1 -1
  24. package/lib/markdown/md-core-rules/set-positions.js +8 -3
  25. package/lib/markdown/md-core-rules/set-positions.js.map +1 -1
  26. package/lib/markdown/md-inline-rule/core-inline.js +25 -2
  27. package/lib/markdown/md-inline-rule/core-inline.js.map +1 -1
  28. package/lib/markdown/md-latex-footnotes/block-rule.js +80 -21
  29. package/lib/markdown/md-latex-footnotes/block-rule.js.map +1 -1
  30. package/lib/markdown/md-latex-footnotes/core-rule.js +58 -12
  31. package/lib/markdown/md-latex-footnotes/core-rule.js.map +1 -1
  32. package/lib/markdown/md-latex-footnotes/index.js +8 -2
  33. package/lib/markdown/md-latex-footnotes/index.js.map +1 -1
  34. package/lib/markdown/md-latex-footnotes/inline-rule.js +12 -3
  35. package/lib/markdown/md-latex-footnotes/inline-rule.js.map +1 -1
  36. package/lib/markdown/md-latex-footnotes/inline-ruler2.js +14 -0
  37. package/lib/markdown/md-latex-footnotes/inline-ruler2.js.map +1 -1
  38. package/lib/markdown/md-latex-footnotes/interfaces.d.ts +2 -0
  39. package/lib/markdown/md-latex-footnotes/render-rule.d.ts +2 -0
  40. package/lib/markdown/md-latex-footnotes/render-rule.js +45 -10
  41. package/lib/markdown/md-latex-footnotes/render-rule.js.map +1 -1
  42. package/lib/markdown/md-latex-footnotes/utils.d.ts +1 -0
  43. package/lib/markdown/md-latex-footnotes/utils.js +72 -21
  44. package/lib/markdown/md-latex-footnotes/utils.js.map +1 -1
  45. package/lib/markdown/mdPluginText.js +28 -0
  46. package/lib/markdown/mdPluginText.js.map +1 -1
  47. package/lib/markdown/rules.js +1 -1
  48. package/lib/markdown/rules.js.map +1 -1
  49. package/lib/markdown/utils.d.ts +4 -0
  50. package/lib/markdown/utils.js +60 -1
  51. package/lib/markdown/utils.js.map +1 -1
  52. package/lib/mathpix-markdown-model/index.d.ts +5 -0
  53. package/lib/mathpix-markdown-model/index.js +3 -2
  54. package/lib/mathpix-markdown-model/index.js.map +1 -1
  55. package/lib/styles/index.js +1 -1
  56. package/lib/styles/index.js.map +1 -1
  57. 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
- ```text
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
- ```text
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}
@@ -106,6 +106,24 @@ Auto increment counter to 8 \footnote{text should be 8}
106
106
 
107
107
  - [Latex underline](doc/latex-underline.md)
108
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
+ ![](doc/images/latex-underline/latex-underline_07.png)
126
+
109
127
  # What is mathpix-markdown-it?
110
128
 
111
129
  **mathpix-markdown-it** is an open source implementation of the mathpix-markdown spec written in Typescript.
@@ -692,6 +710,7 @@ The `MathpixMarkdown` React element accepts the following props:
692
710
  | `smiles` | [ISmilesOptions](https://github.com/Mathpix/mathpix-markdown-it#ismilesoptions);*`{}`* | Sets options to output chemistry equation |
693
711
  | `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
694
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 |
695
714
 
696
715
 
697
716
  ## MathpixMarkdownModel methods
@@ -741,6 +760,7 @@ The `MathpixMarkdown` React element accepts the following props:
741
760
  | `enableCodeBlockRuleForLatexCommands`| boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
742
761
  | `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
743
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 |
744
764
 
745
765
  ### optionsMathpixMarkdown
746
766
 
@@ -771,6 +791,7 @@ The `MathpixMarkdown` React element accepts the following props:
771
791
  | `enableCodeBlockRuleForLatexCommands`| boolean;*`false`* | By default, if latex commands are indented (4 spaces / 1 tab) they do not become `Code Blocks`. |
772
792
  | `parserErrors` | [ParserErrors](https://github.com/Mathpix/mathpix-markdown-it#parsererrors);*`{}`* | Sets options to output parser errors for equations and tabular |
773
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 |
774
795
 
775
796
  ### TOutputMath
776
797
 
@@ -831,16 +852,6 @@ The `MathpixMarkdown` React element accepts the following props:
831
852
  | `includeStyles` | boolean *`false`* | Includes mathpix-markdown styles |
832
853
  | `includeFonts` | boolean *`false`* | Includes mathpix-markdown fonts |
833
854
 
834
-
835
- ### TAccessibility
836
-
837
- | | type *`default`* | description
838
- |-----------------------------|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
839
- | `assistiveMml` | boolean *`false`* | Should Assistive MathML be enabled to math (mjx-container). |
840
- | `sre` | object *`null`* | spe object from library [speech-rule-engine](https://www.npmjs.com/package/speech-rule-engine) for semantic interpretation. |
841
- | | | If this value is not set then the aria-label for accessibility will not be added to the math at render time. |
842
-
843
-
844
855
  ### ParserErrors enum
845
856
 
846
857
  | | |
@@ -856,8 +867,21 @@ The `MathpixMarkdown` React element accepts the following props:
856
867
  | `auto` | boolean *`false`* | Highlighting with language detection |
857
868
  | `code` | boolean *`true`* | Add code highlighting for a code block which created by indenting. To auto-detect the language, set auto=true |
858
869
 
859
- `sre` Has different loaders for node and browser.
870
+ ### Footnotes
871
+
872
+ | | type *`default`* | |
873
+ |----------------|-----------------------------|-------------------------------------------|
874
+ | `fontSize` | string *`unset`* | Ability to change font size for footnotes |
875
+
876
+ ### TAccessibility
860
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.
861
885
  1. For **Browser libraries**, synchronous loading is used.
862
886
  ```js
863
887
  import { loadSre } from "mathpix-markdown-it/lib/sre/sre-browser";
@@ -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
  ![](images/latex-footnotes/latex-footnotes_03.png)
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
+ ![](images/latex-footnotes/latex-footnotes_04.png)