@unified-latex/unified-latex-util-parse 1.6.0 → 1.7.0

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/README.md CHANGED
@@ -94,6 +94,85 @@ PluginOptions
94
94
  function unifiedLatexFromStringMinimal(options: PluginOptions): void;
95
95
  ```
96
96
 
97
+ ## `unifiedLatexProcessAtLetterAndExplMacros`
98
+
99
+ Unified plugin to reprocess macros names to possibly include `@`, `_`, or `:`.
100
+ This plugin detects the `\makeatletter` and `\ExplSyntaxOn` commands and reprocesses macro names
101
+ inside of those blocks to include those characters.
102
+
103
+ ### Usage
104
+
105
+ `unified().use(unifiedLatexProcessAtLetterAndExplMacros[, options])`
106
+
107
+ #### options
108
+
109
+ ```typescript
110
+ { atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }
111
+ ```
112
+
113
+ ### Type
114
+
115
+ `Plugin<{ atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }[], Ast.Root, Ast.Root>`
116
+
117
+ ```typescript
118
+ function unifiedLatexProcessAtLetterAndExplMacros(options: {
119
+ atLetter?: boolean;
120
+ expl3?: boolean;
121
+ autodetectExpl3AndAtLetter?: boolean;
122
+ }): (tree: Ast.Root) => void;
123
+ ```
124
+
125
+ ## `unifiedLatexProcessMacrosAndEnvironmentsWithMathReparse`
126
+
127
+ Unified plugin to process macros and environments. Any environments that contain math content
128
+ are reparsed (if needed) in math mode.
129
+
130
+ ### Usage
131
+
132
+ `unified().use(unifiedLatexProcessMacrosAndEnvironmentsWithMathReparse[, options])`
133
+
134
+ #### options
135
+
136
+ ```typescript
137
+ { environments: Ast.EnvInfoRecord; macros: Ast.MacroInfoRecord; }
138
+ ```
139
+
140
+ ### Type
141
+
142
+ `Plugin<{ environments: Ast.EnvInfoRecord; macros: Ast.MacroInfoRecord; }[], Ast.Root, Ast.Root>`
143
+
144
+ ```typescript
145
+ function unifiedLatexProcessMacrosAndEnvironmentsWithMathReparse(options: {
146
+ environments: Ast.EnvInfoRecord;
147
+ macros: Ast.MacroInfoRecord;
148
+ }): (tree: Ast.Root) => void;
149
+ ```
150
+
151
+ ## `unifiedLatexReparseMath`
152
+
153
+ Reparse math environments/macro contents that should have been parsed in math mode but weren't.
154
+
155
+ ### Usage
156
+
157
+ `unified().use(unifiedLatexReparseMath[, options])`
158
+
159
+ #### options
160
+
161
+ ```typescript
162
+ { mathEnvs: string[]; mathMacros: string[]; }
163
+ ```
164
+
165
+ ### Type
166
+
167
+ `Plugin<{ mathEnvs: string[]; mathMacros: string[]; }[], Ast.Root, Ast.Root>`
168
+
169
+ ```typescript
170
+ function unifiedLatexReparseMath(options: {
171
+ mathEnvs: string[];
172
+ mathMacros: string[];
173
+ }): (tree: Ast.Root) => void;
174
+ ```
175
+
97
176
  # Functions
98
177
 
99
178
  ## `getParser(options)`
@@ -184,6 +263,30 @@ function parseMinimal(str: String): Ast.Root;
184
263
  | :---- | :------- |
185
264
  | str | `String` |
186
265
 
266
+ `unifiedLatexReparseMathConstructPlugin({
267
+ mathEnvs,
268
+ mathMacros,
269
+ })`
270
+ ---
271
+
272
+ Construct the inner function for the `unifiedLatexReparseMath` plugin. This function should not be used by libraries.
273
+
274
+ ```typescript
275
+ function unifiedLatexReparseMathConstructPlugin({
276
+ mathEnvs,
277
+ mathMacros,
278
+ }: {
279
+ mathEnvs: string[];
280
+ mathMacros: string[];
281
+ }): (tree: Ast.Root) => void;
282
+ ```
283
+
284
+ **Parameters**
285
+
286
+ | Param | Type |
287
+ | :-------------------------------------------- | :-------------------------------- |
288
+ | {&#xA; mathEnvs,&#xA; mathMacros,&#xA;} | <span color='gray'>Omitted</span> |
289
+
187
290
  # Types
188
291
 
189
292
  ## `PluginOptions`