|
1 |
| -# JSON LD |
2 |
| - |
3 |
| -A comprehensive collection of LaTeX macro definitions for mathematical notation, providing shortcuts and enhancements for mathematical typesetting in LaTeX2JS. |
4 |
| - |
5 |
| -## Installation |
6 |
| - |
7 |
| -```bash |
8 |
| -npm install @latex2js/macros |
9 |
| -``` |
10 |
| - |
11 |
| -## Features |
12 |
| - |
13 |
| -- **Transform Pairs**: Fourier, Z-transform, and Laplace transform notation |
14 |
| -- **Mathematical Symbols**: Extended collection of mathematical operators and symbols |
15 |
| -- **Set Theory**: Comprehensive set theory notation and operators |
16 |
| -- **Category Theory**: Morphisms, functors, and categorical constructs |
17 |
| -- **Theorem Environments**: Shortcuts for theorem, lemma, proposition, and proof environments |
18 |
| -- **Typography**: Enhanced spacing and formatting for mathematical expressions |
19 |
| - |
20 |
| -## Usage |
21 |
| - |
22 |
| -### Basic Import |
23 |
| - |
24 |
| -```typescript |
25 |
| -import macros from '@latex2js/macros'; |
26 |
| - |
27 |
| -// The macros are provided as a template string |
28 |
| -console.log(typeof macros); // 'string' |
29 |
| -``` |
30 |
| - |
31 |
| -### Integration with LaTeX2JS |
32 |
| - |
33 |
| -```typescript |
34 |
| -import { LaTeX2HTML5 } from 'latex2js'; |
35 |
| -import macros from '@latex2js/macros'; |
36 |
| - |
37 |
| -// Initialize with macros |
38 |
| -const parser = new LaTeX2HTML5(); |
39 |
| -parser.addMacros(macros); |
40 |
| -``` |
41 |
| - |
42 |
| -### Integration with MathJax |
43 |
| - |
44 |
| -```javascript |
45 |
| -import macros from '@latex2js/macros'; |
46 |
| - |
47 |
| -// Configure MathJax with the macros |
48 |
| -window.MathJax = { |
49 |
| - tex: { |
50 |
| - macros: macros |
51 |
| - } |
52 |
| -}; |
53 |
| -``` |
54 |
| - |
55 |
| -## Available Macros |
56 |
| - |
57 |
| -### Transform Pairs |
58 |
| - |
59 |
| -Perfect for signal processing and mathematical analysis: |
60 |
| - |
61 |
| -```latex |
62 |
| -% Fourier Transform |
63 |
| -$$\mathscr{F}\{f(t)\} = F(\omega)$$ |
64 |
| -$$f(t) \FTpair F(\omega)$$ |
65 |
| -
|
66 |
| -% Z-Transform |
67 |
| -$$\mathscr{Z}\{x[n]\} = X(z)$$ |
68 |
| -$$x[n] \ZTpair X(z)$$ |
69 |
| -
|
70 |
| -% Laplace Transform |
71 |
| -$$\mathscr{L}\{f(t)\} = F(s)$$ |
72 |
| -$$f(t) \LTpair F(s)$$ |
73 |
| -``` |
74 |
| - |
75 |
| -### Mathematical Operators |
76 |
| - |
77 |
| -Extended mathematical notation: |
78 |
| - |
79 |
| -```latex |
80 |
| -% Enhanced operators |
81 |
| -$$\E[X]$$ % Expectation |
82 |
| -$$\Var(X)$$ % Variance |
83 |
| -$$\Cov(X,Y)$$ % Covariance |
84 |
| -$$\argmax_x f(x)$$ % Argument maximum |
85 |
| -$$\argmin_x f(x)$$ % Argument minimum |
86 |
| -``` |
87 |
| - |
88 |
| -### Set Theory |
89 |
| - |
90 |
| -Comprehensive set operations: |
91 |
| - |
92 |
| -```latex |
93 |
| -% Set operations |
94 |
| -$$A \intersection B$$ % Intersection |
95 |
| -$$A \union B$$ % Union |
96 |
| -$$A \setminus B$$ % Set difference |
97 |
| -$$\powerset{A}$$ % Power set |
98 |
| -$$A \symdiff B$$ % Symmetric difference |
99 |
| -``` |
100 |
| - |
101 |
| -### Category Theory |
102 |
| - |
103 |
| -Advanced categorical constructs: |
104 |
| - |
105 |
| -```latex |
106 |
| -% Category theory |
107 |
| -$$\Hom(A, B)$$ % Hom-set |
108 |
| -$$A \iso B$$ % Isomorphism |
109 |
| -$$f \colon A \to B$$ % Morphism notation |
110 |
| -$$\End(A)$$ % Endomorphisms |
111 |
| -$$\Aut(A)$$ % Automorphisms |
112 |
| -``` |
113 |
| - |
114 |
| -### Theorem Environments |
115 |
| - |
116 |
| -Shortcuts for mathematical writing: |
117 |
| - |
118 |
| -```latex |
119 |
| -\begin{thm}[Fundamental Theorem] |
120 |
| -Every continuous function on a closed interval is uniformly continuous. |
121 |
| -\end{thm} |
122 |
| -
|
123 |
| -\begin{lem} |
124 |
| -This is a supporting lemma. |
125 |
| -\end{lem} |
126 |
| -
|
127 |
| -\begin{prop} |
128 |
| -This is a proposition. |
129 |
| -\end{prop} |
130 |
| -
|
131 |
| -\begin{proof} |
132 |
| -The proof follows from the definition. |
133 |
| -\end{proof} |
134 |
| -``` |
135 |
| - |
136 |
| -### Typography Enhancements |
137 |
| - |
138 |
| -Improved spacing and formatting: |
139 |
| - |
140 |
| -```latex |
141 |
| -% Enhanced spacing |
142 |
| -$$a \,+\, b$$ % Thin spaces around operators |
143 |
| -$$\int_a^b f(x) \dd x$$ % Proper differential notation |
144 |
| -$$\vec{v} \cdot \vec{u}$$ % Vector notation |
145 |
| -``` |
146 |
| - |
147 |
| -## Complete Macro List |
148 |
| - |
149 |
| -The package includes over 140 macro definitions covering: |
150 |
| - |
151 |
| -- **Analysis**: Real and complex analysis notation |
152 |
| -- **Algebra**: Group theory, ring theory, field theory |
153 |
| -- **Topology**: Topological spaces and continuous maps |
154 |
| -- **Probability**: Probability theory and statistics |
155 |
| -- **Logic**: Logical operators and quantifiers |
156 |
| -- **Geometry**: Geometric constructions and notation |
157 |
| -- **Computer Science**: Algorithms and complexity theory |
158 |
| - |
159 |
| -## Integration Examples |
160 |
| - |
161 |
| -### With React Components |
162 |
| - |
163 |
| -```jsx |
164 |
| -import { LaTeX } from 'latex2react'; |
165 |
| -import macros from '@latex2js/macros'; |
166 |
| - |
167 |
| -function MathDocument() { |
168 |
| - const content = ` |
169 |
| - \\begin{thm}[Fourier Transform] |
170 |
| - For any function $f \\in L^1(\\mathbb{R})$: |
171 |
| - $$f(t) \\FTpair F(\\omega) = \\int_{-\\infty}^{\\infty} f(t) e^{-i\\omega t} \\dd t$$ |
172 |
| - \\end{thm} |
173 |
| - `; |
174 |
| - |
175 |
| - return <LaTeX content={content} macros={macros} />; |
176 |
| -} |
177 |
| -``` |
178 |
| - |
179 |
| -### With Vue Components |
180 |
| - |
181 |
| -```vue |
182 |
| -<template> |
183 |
| - <latex :content="mathContent" :macros="macros" /> |
184 |
| -</template> |
185 |
| -
|
186 |
| -<script> |
187 |
| -import macros from '@latex2js/macros'; |
188 |
| -
|
189 |
| -export default { |
190 |
| - data() { |
191 |
| - return { |
192 |
| - macros, |
193 |
| - mathContent: ` |
194 |
| - $$\\E[X] = \\int_{-\\infty}^{\\infty} x f_X(x) \\dd x$$ |
195 |
| - ` |
196 |
| - }; |
197 |
| - } |
198 |
| -}; |
199 |
| -</script> |
200 |
| -``` |
201 |
| - |
202 |
| -### With HTML5 Integration |
203 |
| - |
204 |
| -```html |
205 |
| -<!DOCTYPE html> |
206 |
| -<html> |
207 |
| -<head> |
208 |
| - <script src="path/to/latex2html5.bundle.js"></script> |
209 |
| -</head> |
210 |
| -<body> |
211 |
| - <script type="text/latex"> |
212 |
| - \begin{thm} |
213 |
| - The Pythagorean theorem: $a^2 + b^2 = c^2$ |
214 |
| - \end{thm} |
215 |
| - </script> |
216 |
| - |
217 |
| - <script> |
218 |
| - // Macros are automatically included in the HTML5 bundle |
219 |
| - LaTeX2HTML5.init(); |
220 |
| - </script> |
221 |
| -</body> |
222 |
| -</html> |
223 |
| -``` |
| 1 | +# jsonldjs |
0 commit comments