mathpix-markdown-it 1.0.83 → 1.0.85

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 (98) hide show
  1. package/.idea/vcs.xml +1 -0
  2. package/.idea/workspace.xml +588 -455
  3. package/README.md +2 -2
  4. package/doc/images/sections/section_01.png +0 -0
  5. package/doc/images/sections/section_02.png +0 -0
  6. package/doc/images/sections/section_03.png +0 -0
  7. package/doc/images/sections/section_04.png +0 -0
  8. package/doc/sections.md +103 -0
  9. package/es5/bundle.js +1 -1
  10. package/es5/context-menu.js +1 -1
  11. package/es5/index.js +1 -1
  12. package/lib/contex-menu/index.js +8 -8
  13. package/lib/contex-menu/index.js.map +1 -1
  14. package/lib/contex-menu/menu/consts.d.ts +6 -1
  15. package/lib/contex-menu/menu/consts.js +15 -2
  16. package/lib/contex-menu/menu/consts.js.map +1 -1
  17. package/lib/contex-menu/menu/helper.d.ts +2 -1
  18. package/lib/contex-menu/menu/helper.js +25 -7
  19. package/lib/contex-menu/menu/helper.js.map +1 -1
  20. package/lib/contex-menu/menu/menu-item-actions.js +1 -1
  21. package/lib/contex-menu/menu/menu-item-actions.js.map +1 -1
  22. package/lib/contex-menu/menu/menu-item.js +12 -0
  23. package/lib/contex-menu/menu/menu-item.js.map +1 -1
  24. package/lib/index.d.ts +2 -2
  25. package/lib/index.js +2 -1
  26. package/lib/index.js.map +1 -1
  27. package/lib/markdown/common/consts.d.ts +11 -0
  28. package/lib/markdown/common/consts.js +12 -1
  29. package/lib/markdown/common/consts.js.map +1 -1
  30. package/lib/markdown/common/tsv.js +4 -2
  31. package/lib/markdown/common/tsv.js.map +1 -1
  32. package/lib/markdown/common.d.ts +30 -0
  33. package/lib/markdown/common.js +76 -1
  34. package/lib/markdown/common.js.map +1 -1
  35. package/lib/markdown/md-block-rule/begin-tabular/index.d.ts +1 -0
  36. package/lib/markdown/md-block-rule/begin-tabular/index.js +1 -0
  37. package/lib/markdown/md-block-rule/begin-tabular/index.js.map +1 -1
  38. package/lib/markdown/md-block-rule/begin-tabular/multi-column-row.js +23 -4
  39. package/lib/markdown/md-block-rule/begin-tabular/multi-column-row.js.map +1 -1
  40. package/lib/markdown/md-block-rule/begin-tabular/sub-math.d.ts +1 -1
  41. package/lib/markdown/md-block-rule/begin-tabular/sub-math.js +16 -7
  42. package/lib/markdown/md-block-rule/begin-tabular/sub-math.js.map +1 -1
  43. package/lib/markdown/md-block-rule/begin-tabular/tabular-td.js +2 -1
  44. package/lib/markdown/md-block-rule/begin-tabular/tabular-td.js.map +1 -1
  45. package/lib/markdown/md-inline-rule/setcounter-section.d.ts +6 -0
  46. package/lib/markdown/md-inline-rule/setcounter-section.js +47 -0
  47. package/lib/markdown/md-inline-rule/setcounter-section.js.map +1 -0
  48. package/lib/markdown/md-renderer-rules/render-tabular.js +1 -1
  49. package/lib/markdown/md-renderer-rules/render-tabular.js.map +1 -1
  50. package/lib/markdown/md-theorem/block-rule.js +23 -8
  51. package/lib/markdown/md-theorem/block-rule.js.map +1 -1
  52. package/lib/markdown/md-theorem/index.js +6 -2
  53. package/lib/markdown/md-theorem/index.js.map +1 -1
  54. package/lib/markdown/md-theorem/inline-rule.js +106 -53
  55. package/lib/markdown/md-theorem/inline-rule.js.map +1 -1
  56. package/lib/markdown/mdPluginRaw.js +42 -1
  57. package/lib/markdown/mdPluginRaw.js.map +1 -1
  58. package/lib/markdown/mdPluginTOC.d.ts +14 -0
  59. package/lib/markdown/mdPluginTOC.js +105 -96
  60. package/lib/markdown/mdPluginTOC.js.map +1 -1
  61. package/lib/markdown/mdPluginText.d.ts +7 -1
  62. package/lib/markdown/mdPluginText.js +248 -105
  63. package/lib/markdown/mdPluginText.js.map +1 -1
  64. package/lib/markdown/rules.js +6 -5
  65. package/lib/markdown/rules.js.map +1 -1
  66. package/lib/markdown/test.d.ts +0 -0
  67. package/lib/markdown/test.js +399 -0
  68. package/lib/markdown/test.js.map +1 -0
  69. package/lib/mathjax/helpers/array/ArrayConfiguration.d.ts +6 -0
  70. package/lib/mathjax/helpers/array/ArrayConfiguration.js +14 -0
  71. package/lib/mathjax/helpers/array/ArrayConfiguration.js.map +1 -0
  72. package/lib/mathjax/helpers/array/ArrayMappings.d.ts +1 -0
  73. package/lib/mathjax/helpers/array/ArrayMappings.js +12 -0
  74. package/lib/mathjax/helpers/array/ArrayMappings.js.map +1 -0
  75. package/lib/mathjax/helpers/array/ArrayMethods.d.ts +6 -0
  76. package/lib/mathjax/helpers/array/ArrayMethods.js +28 -0
  77. package/lib/mathjax/helpers/array/ArrayMethods.js.map +1 -0
  78. package/lib/mathjax/index.d.ts +2 -0
  79. package/lib/mathjax/index.js +45 -8
  80. package/lib/mathjax/index.js.map +1 -1
  81. package/lib/mathjax/mathjax.d.ts +4 -0
  82. package/lib/mathjax/mathjax.js +12 -0
  83. package/lib/mathjax/mathjax.js.map +1 -1
  84. package/lib/mathjax/serialized-ascii/handlers.d.ts +2 -0
  85. package/lib/mathjax/serialized-ascii/handlers.js +246 -48
  86. package/lib/mathjax/serialized-ascii/handlers.js.map +1 -1
  87. package/lib/mathjax/serialized-ascii/helperA.d.ts +46 -0
  88. package/lib/mathjax/serialized-ascii/helperA.js +135 -124
  89. package/lib/mathjax/serialized-ascii/helperA.js.map +1 -1
  90. package/lib/mathjax/serialized-ascii/index.d.ts +3 -0
  91. package/lib/mathjax/serialized-ascii/index.js +43 -5
  92. package/lib/mathjax/serialized-ascii/index.js.map +1 -1
  93. package/lib/mathpix-markdown-model/index.d.ts +2 -1
  94. package/lib/mathpix-markdown-model/index.js +6 -1
  95. package/lib/mathpix-markdown-model/index.js.map +1 -1
  96. package/lib/styles/index.js +1 -1
  97. package/lib/styles/index.js.map +1 -1
  98. package/package.json +1 -1
package/README.md CHANGED
@@ -41,7 +41,7 @@ Mathpix Markdown addresses these limitations by adding support for the following
41
41
  - lists: unordered lists via `\begin{itemize} ... \end{itemize}` and ordered lists via `\begin{enumerate} ... \end{enumerate}`
42
42
  - numbered and unnumbered equation enviornments `\begin{elem} ... \end{elem}` and `\begin{elem*} ... \end{elem*}` where elem=`equation|align|split|gather`
43
43
  - equation, table, and figure references via `\label`, `\ref`, `\eqref`, `\tag`
44
- - text formatting options `\title{...}`, `\author{...}`, `\begin{abstract}...\end{abstract}`, `\section{Section Title}`, `\subsection{Section Title}`, `\subsubsection{Section Title}`, `\textit{italicized text}`, `\textbf{bold text}`, `\url{link}`
44
+ - [text formatting options](doc/sections.md) `\title{...}`, `\author{...}`, `\begin{abstract}...\end{abstract}`, `\section{Section Title}`, `\subsection{Section Title}`, `\subsubsection{Section Title}`, `\textit{italicized text}`, `\textbf{bold text}`, `\url{link}`
45
45
  - chemistry equation via `<smiles>OC(=O)c1cc(Cl)cs1</smiles>` or
46
46
  ~~~
47
47
  ```smiles
@@ -443,7 +443,7 @@ const parsed = MathpixMarkdownModel.parseMarkdownByHTML(html, false);
443
443
  ```js
444
444
  [
445
445
  {
446
- type: 'thml',
446
+ type: 'html',
447
447
  value: '<table>..</table>'
448
448
  },
449
449
  {
@@ -0,0 +1,103 @@
1
+ # Sections
2
+
3
+ ## Basic example
4
+
5
+ Let’s begin with a basic example to demonstrate the `\section{section title}` command, which marks the beginning of a new section called section title. Section numbering is automatic and can be customized, or disabled.
6
+
7
+ ```tex
8
+ \title{Sections and Chapters}
9
+
10
+ \section{Introduction}
11
+
12
+ This is the first section.
13
+
14
+ \section{Second Section}
15
+ This is the second section
16
+ ```
17
+
18
+ This example produces the following output:
19
+
20
+ ![](images/sections/section_01.png)
21
+
22
+ ## Document sectioning
23
+
24
+ | levels | |
25
+ | :----: |:------------------------------|
26
+ |1 |`\section{section}` |
27
+ |2 |`\subsection{subsection}` |
28
+ |3 |`\subsubsection{subsubsection}`|
29
+
30
+
31
+ ## Numbered and unnumbered sections
32
+
33
+ To get an unnumbered chapter, section, subsection, etc. add an asterisk `(*)` at the end of the command, before the opening curly brace. These will not go into the table of contents. Here is our first example (above) but this time using `\section*` instead of `\section`:
34
+
35
+ ```tex
36
+ \title{Sections and Chapters}
37
+
38
+ \section*{Introduction}
39
+
40
+ This is the first section.
41
+
42
+ \section*{Second Section}
43
+ This is the second section
44
+ ```
45
+
46
+ This example produces the following output:
47
+
48
+ ![](images/sections/section_02.png)
49
+
50
+
51
+ ## Start section counter from specific number
52
+
53
+ `\setcounter{section}{number}`
54
+ Sets count for `section` to contain the value number.
55
+
56
+ - *Note:* number can be positive or negative.
57
+
58
+ ```tex
59
+ \title{Sections and Chapters}
60
+
61
+ \setcounter{section}{7}
62
+
63
+ \section{Introduction}
64
+
65
+ This is the first section.
66
+
67
+ \setcounter{section}{0}
68
+ \section{Second Section}
69
+ This is the second section
70
+ ```
71
+
72
+ This example produces the following output:
73
+
74
+ ![](images/sections/section_03.png)
75
+
76
+
77
+ ## Unnumbered sections in the table of contents
78
+
79
+ To add an unnumbered section to the table of contents, use the `\addcontentsline` command like this:
80
+
81
+ `\addcontentsline{toc}{section}{Title of the section}`
82
+ Here is an example using `\addcontentsline`:
83
+
84
+ ```tex
85
+ [[toc]]
86
+
87
+ \title{Sections and Chapters}
88
+
89
+ \section{Introduction}
90
+ This is the first section (numbered).
91
+
92
+ \addcontentsline{toc}{section}{Unnumbered Section}
93
+ \section*{Unnumbered Section}
94
+ An unnumbered section
95
+
96
+
97
+ \section{Second section}
98
+ The second numbered section.
99
+ ```
100
+
101
+ This example produces the following output:
102
+
103
+ ![](images/sections/section_04.png)