@@ -25,27 +25,32 @@ const argv = require("yargs")
25
25
. options ( {
26
26
speech : {
27
27
boolean : true ,
28
- default : true ,
28
+ default : mj . options . speak ,
29
29
describe : "include speech text"
30
30
} ,
31
- speechrules : {
32
- default : "mathspeak" ,
31
+ sre : {
32
+ array : true ,
33
+ nargs : 2 ,
34
+ describe : "SRE flags as key value pairs"
35
+ } ,
36
+ speechrules : { // deprecated
37
+ default : mj . options . speakRules ,
33
38
describe : "ruleset to use for speech text (chromevox or mathspeak)"
34
39
} ,
35
- speechstyle : {
36
- default : "default" ,
40
+ speechstyle : { // deprecated
41
+ default : mj . options . speakStyle ,
37
42
describe : "style to use for speech text (default, brief, sbrief)"
38
43
} ,
39
44
linebreaks : {
40
45
boolean : true ,
41
46
describe : "perform automatic line-breaking"
42
47
} ,
43
48
format : {
44
- default : "TeX" ,
49
+ default : mj . options . format ,
45
50
describe : "input format(s) to look for"
46
51
} ,
47
52
font : {
48
- default : "TeX" ,
53
+ default : mj . options . font ,
49
54
describe : "web font to use"
50
55
} ,
51
56
inline : {
@@ -61,24 +66,24 @@ const argv = require("yargs")
61
66
describe : "For TeX input and MathML output, don't add TeX-specific classes"
62
67
} ,
63
68
output : {
64
- default : "SVG" ,
69
+ default : mj . options . output ,
65
70
describe : "output format (SVG, CommonHTML, or MML)" ,
66
71
coerce : ( x => { return x . toLowerCase ( ) ; } )
67
72
} ,
68
73
ex : {
69
- default : 6 ,
74
+ default : mj . options . ex ,
70
75
describe : "ex-size in pixels"
71
76
} ,
72
77
width : {
73
- default : 100 ,
78
+ default : mj . options . width ,
74
79
describe : "width of equation container in ex (for line-breaking)"
75
80
} ,
76
81
extensions : {
77
- default : "" ,
82
+ default : mj . options . extensions ,
78
83
describe : "extra MathJax extensions e.g. 'Safe,TeX/noUndefined'"
79
84
} ,
80
85
fontURL : {
81
- default : "https://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS" ,
86
+ default : mj . options . fontURL ,
82
87
describe : "the URL to use for web fonts"
83
88
} ,
84
89
css : {
@@ -124,16 +129,17 @@ const mjinput = {
124
129
speakStyle : argv . speechstyle ,
125
130
ex : argv . ex ,
126
131
width : argv . width ,
127
- linebreaks : argv . linebreaks
128
- }
132
+ linebreaks : argv . linebreaks ,
133
+ sre : argv . sre
134
+ } ;
129
135
130
136
console . log ( argv . _ [ 0 ] )
131
137
const output = function ( result ) {
132
138
if ( result . errors ) console . log ( result . errors ) ;
133
139
else if ( argv . css ) console . log ( result . css ) ;
134
140
else console . log ( result [ argv . output ] ) ;
135
- }
141
+ } ;
136
142
137
143
mj . config ( mjconf ) ;
138
144
mj . start ( ) ;
139
- mj . typeset ( mjinput , output )
145
+ mj . typeset ( mjinput , output ) ;
0 commit comments