Skip to content

Commit 888a09a

Browse files
authored
Merge pull request #1056 from mathjax/package/bboldx
Adds the bboldx package.
2 parents b22d958 + 0f20cb0 commit 888a09a

File tree

6 files changed

+482
-0
lines changed

6 files changed

+482
-0
lines changed

components/mjs/dependencies.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export const dependencies = {
2525
'[tex]/autoload': ['input/tex-base', '[tex]/require'],
2626
'[tex]/ams': ['input/tex-base'],
2727
'[tex]/amscd': ['input/tex-base'],
28+
'[tex]/bbm': ['input/tex-base'],
29+
'[tex]/bboldx': ['input/tex-base', '[tex]/textmacros'],
2830
'[tex]/bbox': ['input/tex-base', '[tex]/ams', '[tex]/newcommand'],
2931
'[tex]/boldsymbol': ['input/tex-base'],
3032
'[tex]/braket': ['input/tex-base'],
@@ -35,6 +37,7 @@ export const dependencies = {
3537
'[tex]/colorv2': ['input/tex-base'],
3638
'[tex]/colortbl': ['input/tex-base', '[tex]/color'],
3739
'[tex]/configmacros': ['input/tex-base', '[tex]/newcommand'],
40+
'[tex]/dsfonts': ['input/tex/tex-base'],
3841
'[tex]/enclose': ['input/tex-base'],
3942
'[tex]/extpfeil': ['input/tex-base', '[tex]/newcommand', '[tex]/ams'],
4043
'[tex]/html': ['input/tex-base'],
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import './lib/bboldx.js';
2+
import {MathJax, combineDefaults} from 'mathjax-full/js/components/global.js';
3+
4+
const FONTPATH = (typeof document === 'undefined' ?
5+
'@mathjax/mathjax-bboldx-font-extension' :
6+
'https://cdn.jsdelivr.net/npm/mathjax-bboldx-font-extension');
7+
8+
if (MathJax.config?.loader) {
9+
combineDefaults(MathJax.config.loader, 'paths', {
10+
'mathjax-bboldx-extension': FONTPATH
11+
});
12+
MathJax.config.loader['[tex]/bboldx'] = {
13+
checkReady() {
14+
return MathJax.loader.load(`[mathjax-bboldx-extension]/${MathJax.config?.startup?.output || 'chtml'}`);
15+
}
16+
};
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"build": {
3+
"id": "[tex]/bboldx",
4+
"component": "input/tex/extensions/bboldx",
5+
"targets": ["input/tex/bboldx"]
6+
},
7+
"webpack": {
8+
"name": "input/tex/extensions/bboldx",
9+
"libs": [
10+
"components/src/input/tex/extensions/textmacros/lib",
11+
"components/src/input/tex-base/lib",
12+
"components/src/core/lib"
13+
]
14+
}
15+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*************************************************************
2+
*
3+
* Copyright (c) 2017-2023 The MathJax Consortium
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
19+
/**
20+
* @fileoverview The bboldx package.
21+
*
22+
* @author v.sorge@mathjax.org (Volker Sorge)
23+
*/
24+
25+
import {Configuration} from '../Configuration.js';
26+
import './BboldxMappings.js';
27+
28+
/**
29+
* Configuration for the text macros of this package. They are automatically
30+
* available, when the textmacros package is loaded.
31+
*/
32+
Configuration.create('text-bboldx', {
33+
parser: 'text',
34+
handler: {
35+
macro: ['text-bboldx', 'text-bboldx-mathchar0miNormal', 'text-bboldx-delimiterNormal',
36+
'text-bboldx-mathchar0miBold', 'text-bboldx-delimiterBold'],
37+
delimiter: ['text-bboldx-delimiterNormal', 'text-bboldx-delimiterBold'],
38+
}
39+
});
40+
41+
//
42+
// Define the package configuration, including switches for light and always
43+
// bold bb.
44+
//
45+
export const BboldxConfiguration = Configuration.create('bboldx', {
46+
handler: {
47+
macro: ['bboldx', 'bboldx-mathchar0miNormal', 'bboldx-delimiterNormal',
48+
'bboldx-mathchar0miBold', 'bboldx-delimiterBold'],
49+
delimiter: ['bboldx-delimiterNormal', 'bboldx-delimiterBold'],
50+
},
51+
options: {
52+
bboldx: {
53+
bfbb: false,
54+
light: false
55+
},
56+
// add text macros by default to textmacros
57+
textmacros: {
58+
packages: {'[+]': ['text-bboldx']}
59+
}
60+
}
61+
});
62+
Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
/*************************************************************
2+
*
3+
* Copyright (c) 2017-2024 The MathJax Consortium
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
19+
/**
20+
* @fileoverview Symbol mappings for the bboldx package.
21+
*
22+
* @author v.sorge@mathjax.org (Volker Sorge)
23+
*/
24+
25+
import {CommandMap, CharacterMap, DelimiterMap} from '../TokenMap.js';
26+
import {BboldxMethods} from './BboldxMethods.js';
27+
28+
/**
29+
* Bb symbols macros for bboldx package.
30+
*/
31+
new CharacterMap('bboldx-mathchar0miNormal', BboldxMethods.mathchar0miNormal, {
32+
// Upper Case Greek
33+
bbGamma: '\u0393',
34+
bbDelta: '\u2206',
35+
bbTheta: '\u0398',
36+
bbLambda: '\u039B',
37+
bbXi: '\u039E',
38+
bbPi: '\u03A0',
39+
bbSigma: '\u03A3',
40+
bbUpsilon: '\u03A5',
41+
bbPhi: '\u03A6',
42+
bbPsi: '\u03A8',
43+
bbOmega: '\u2126',
44+
// Lower Case Greek
45+
bbalpha: '\u03B1',
46+
bbbeta: '\u03B2',
47+
bbgamma: '\u03B3',
48+
bbdelta: '\u03B4',
49+
bbepsilon: '\u03B5',
50+
bbzeta: '\u03B6',
51+
bbeta: '\u03B7',
52+
bbtheta: '\u03B8',
53+
bbiota: '\u03B9',
54+
bbkappa: '\u03BA',
55+
bblambda: '\u03BB',
56+
bbmu: '\u00B5',
57+
bbnu: '\u03BD',
58+
bbxi: '\u03BE',
59+
bbpi: '\u03C0',
60+
bbrho: '\u03C1',
61+
bbsigma: '\u03C3',
62+
bbtau: '\u03C4',
63+
bbupsilon: '\u03C5',
64+
bbphi: '\u03C6',
65+
bbchi: '\u03C7',
66+
bbpsi: '\u03C8',
67+
bbomega: '\u03C9',
68+
bbdotlessi: '\u0131',
69+
bbdotlessj: '\u0237',
70+
});
71+
72+
/**
73+
* Macros for delimiters.
74+
*/
75+
new DelimiterMap('bboldx-delimiterNormal', BboldxMethods.delimiterNormal, {
76+
'\\bbLparen': '\u0028',
77+
'\\bbRparen': '\u0029',
78+
'\\bbLbrack': '\u005B',
79+
'\\bbRbrack': '\u005D',
80+
'\\bbLangle': '\u2329',
81+
'\\bbRangle': '\u232A',
82+
});
83+
84+
/**
85+
* Bb symbols macros for bboldx package.
86+
*/
87+
new CharacterMap('bboldx-mathchar0miBold', BboldxMethods.mathchar0miBold, {
88+
// Upper Case Greek
89+
bfbbGamma: '\u0393',
90+
bfbbDelta: '\u2206',
91+
bfbbTheta: '\u0398',
92+
bfbbLambda: '\u039B',
93+
bfbbXi: '\u039E',
94+
bfbbPi: '\u03A0',
95+
bfbbSigma: '\u03A3',
96+
bfbbUpsilon: '\u03A5',
97+
bfbbPhi: '\u03A6',
98+
bfbbPsi: '\u03A8',
99+
bfbbOmega: '\u2126',
100+
// Lower Case Greek
101+
bfbbalpha: '\u03B1',
102+
bfbbbeta: '\u03B2',
103+
bfbbgamma: '\u03B3',
104+
bfbbdelta: '\u03B4',
105+
bfbbepsilon: '\u03B5',
106+
bfbbzeta: '\u03B6',
107+
bfbbeta: '\u03B7',
108+
bfbbtheta: '\u03B8',
109+
bfbbiota: '\u03B9',
110+
bfbbkappa: '\u03BA',
111+
bfbblambda: '\u03BFBB',
112+
bfbbmu: '\u00B5',
113+
bfbbnu: '\u03BD',
114+
bfbbxi: '\u03BE',
115+
bfbbpi: '\u03C0',
116+
bfbbrho: '\u03C1',
117+
bfbbsigma: '\u03C3',
118+
bfbbtau: '\u03C4',
119+
bfbbupsilon: '\u03C5',
120+
bfbbphi: '\u03C6',
121+
bfbbchi: '\u03C7',
122+
bfbbpsi: '\u03C8',
123+
bfbbomega: '\u03C9',
124+
bfbbdotlessi: '\u0131',
125+
bfbbdotlessj: '\u0237',
126+
});
127+
128+
/**
129+
* Macros for delimiters.
130+
*/
131+
new DelimiterMap('bboldx-delimiterBold', BboldxMethods.delimiterBold, {
132+
'\\bfbbLparen': '\u0028',
133+
'\\bfbbRparen': '\u0029',
134+
'\\bfbbLbrack': '\u005B',
135+
'\\bfbbRbrack': '\u005D',
136+
'\\bfbbLangle': '\u2329',
137+
'\\bfbbRangle': '\u232A',
138+
});
139+
140+
new CommandMap('bboldx', {
141+
mathbb: ['ChooseFont', '-bboldx', '-bboldx-light', '-bboldx-bold'],
142+
mathbfbb: ['ChooseFont', '-bboldx-bold', '-bboldx', '-bboldx-bold'],
143+
imathbb: ['Macro', '\\bbdotlessi'],
144+
jmathbb: ['Macro', '\\bbdotlessj'],
145+
imathbfbb: ['Macro', '\\bfbbdotlessi'],
146+
jmathbfbb: ['Macro', '\\bfbbdotlessj'],
147+
}, BboldxMethods);
148+
149+
// Text Macros.
150+
/**
151+
* Bb symbols macros for text-bboldx package.
152+
*/
153+
new CharacterMap('text-bboldx-mathchar0miNormal', BboldxMethods.mathchar0miNormal, {
154+
// Upper Case Greek
155+
txtbbGamma: '\u0393',
156+
txtbbDelta: '\u2206',
157+
txtbbTheta: '\u0398',
158+
txtbbLambda: '\u039B',
159+
txtbbXi: '\u039E',
160+
txtbbPi: '\u03A0',
161+
txtbbSigma: '\u03A3',
162+
txtbbUpsilon: '\u03A5',
163+
txtbbPhi: '\u03A6',
164+
txtbbPsi: '\u03A8',
165+
txtbbOmega: '\u2126',
166+
// Lower Case Greek
167+
txtbbalpha: '\u03B1',
168+
txtbbbeta: '\u03B2',
169+
txtbbgamma: '\u03B3',
170+
txtbbdelta: '\u03B4',
171+
txtbbepsilon: '\u03B5',
172+
txtbbzeta: '\u03B6',
173+
txtbbeta: '\u03B7',
174+
txtbbtheta: '\u03B8',
175+
txtbbiota: '\u03B9',
176+
txtbbkappa: '\u03BA',
177+
txtbblambda: '\u03BB',
178+
txtbbmu: '\u00B5',
179+
txtbbnu: '\u03BD',
180+
txtbbxi: '\u03BE',
181+
txtbbpi: '\u03C0',
182+
txtbbrho: '\u03C1',
183+
txtbbsigma: '\u03C3',
184+
txtbbtau: '\u03C4',
185+
txtbbupsilon: '\u03C5',
186+
txtbbphi: '\u03C6',
187+
txtbbchi: '\u03C7',
188+
txtbbpsi: '\u03C8',
189+
txtbbomega: '\u03C9',
190+
txtbbdotlessi: '\u0131',
191+
txtbbdotlessj: '\u0237',
192+
});
193+
194+
/**
195+
* Macros for delimiters.
196+
*/
197+
new DelimiterMap('text-bboldx-delimiterNormal', BboldxMethods.delimiterNormal, {
198+
'\\txtbbLparen': '\u0028',
199+
'\\txtbbRparen': '\u0029',
200+
'\\txtbbLbrack': '\u005B',
201+
'\\txtbbRbrack': '\u005D',
202+
'\\txtbbLangle': '\u2329',
203+
'\\txtbbRangle': '\u232A',
204+
});
205+
206+
/**
207+
* Bb symbols macros for text-bboldx package.
208+
*/
209+
new CharacterMap('text-bboldx-mathchar0miBold', BboldxMethods.mathchar0miBold, {
210+
// Upper Case Greek
211+
txtbfbbGamma: '\u0393',
212+
txtbfbbDelta: '\u2206',
213+
txtbfbbTheta: '\u0398',
214+
txtbfbbLambda: '\u039B',
215+
txtbfbbXi: '\u039E',
216+
txtbfbbPi: '\u03A0',
217+
txtbfbbSigma: '\u03A3',
218+
txtbfbbUpsilon: '\u03A5',
219+
txtbfbbPhi: '\u03A6',
220+
txtbfbbPsi: '\u03A8',
221+
txtbfbbOmega: '\u2126',
222+
// Lower Case Greek
223+
txtbfbbalpha: '\u03B1',
224+
txtbfbbbeta: '\u03B2',
225+
txtbfbbgamma: '\u03B3',
226+
txtbfbbdelta: '\u03B4',
227+
txtbfbbepsilon: '\u03B5',
228+
txtbfbbzeta: '\u03B6',
229+
txtbfbbeta: '\u03B7',
230+
txtbfbbtheta: '\u03B8',
231+
txtbfbbiota: '\u03B9',
232+
txtbfbbkappa: '\u03BA',
233+
txtbfbblambda: '\u03BB',
234+
txtbfbbmu: '\u00B5',
235+
txtbfbbnu: '\u03BD',
236+
txtbfbbxi: '\u03BE',
237+
txtbfbbpi: '\u03C0',
238+
txtbfbbrho: '\u03C1',
239+
txtbfbbsigma: '\u03C3',
240+
txtbfbbtau: '\u03C4',
241+
txtbfbbupsilon: '\u03C5',
242+
txtbfbbphi: '\u03C6',
243+
txtbfbbchi: '\u03C7',
244+
txtbfbbpsi: '\u03C8',
245+
txtbfbbomega: '\u03C9',
246+
txtbfbbdotlessi: '\u0131',
247+
txtbfbbdotlessj: '\u0237',
248+
});
249+
250+
/**
251+
* Macros for delimiters.
252+
*/
253+
new DelimiterMap('text-bboldx-delimiterBold', BboldxMethods.delimiterBold, {
254+
'\\txtbfbbLparen': '\u0028',
255+
'\\txtbfbbRparen': '\u0029',
256+
'\\txtbfbbLbrack': '\u005B',
257+
'\\txtbfbbRbrack': '\u005D',
258+
'\\txtbfbbLangle': '\u2329',
259+
'\\txtbfbbRangle': '\u232A',
260+
});
261+
262+
new CommandMap('text-bboldx', {
263+
textbb: ['ChooseTextFont', '-bboldx', '-bboldx-light', '-bboldx-bold'],
264+
textbfbb: ['ChooseTextFont', '-bboldx-bold', '-bboldx', '-bboldx-bold'],
265+
itextbb: ['Macro', '\\txtbbdotlessi'],
266+
jtextbb: ['Macro', '\\txtbbdotlessj'],
267+
itextbfbb: ['Macro', '\\txtbfbbdotlessi'],
268+
jtextbfbb: ['Macro', '\\txtbfbbdotlessj'],
269+
}, BboldxMethods);
270+

0 commit comments

Comments
 (0)