File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
resources/filters/crossref Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
kFigPos ,
20
20
kFigResponsive ,
21
21
kHeaderIncludes ,
22
+ kHtmlMathMethod ,
22
23
kIncludeAfter ,
23
24
kIncludeAfterBody ,
24
25
kIncludeBefore ,
@@ -428,6 +429,7 @@ function quartoFilterParams(
428
429
params [ kShortcodes ] = params [ kShortcodes ] || [ ] ;
429
430
( params [ kShortcodes ] as string [ ] ) . push ( ...extShortcodes ) ;
430
431
}
432
+ params [ kHtmlMathMethod ] = options . format . pandoc [ kHtmlMathMethod ] ;
431
433
432
434
const figResponsive = format . metadata [ kFigResponsive ] === true ;
433
435
if ( figResponsive ) {
Original file line number Diff line number Diff line change @@ -48,7 +48,12 @@ function processEquations(blockEl)
48
48
targetInlines :insert (pandoc .Span (pandoc .RawInline (" latex" , eq .text ), pandoc .Attr (label )))
49
49
targetInlines :insert (pandoc .RawInline (" latex" , " \\ label{" .. label .. " }\\ end{equation}" ))
50
50
else
51
- eq .text = eq .text .. " \\ tag{" .. inlinesToString (numberOption (" eq" , order )) .. " }"
51
+ local eqNumber = eqQquad
52
+ local mathMethod = param (" html-math-method" , nil )
53
+ if isHtmlOutput () and (mathMethod == " mathjax" or mathMethod == " katex" ) then
54
+ eqNumber = eqTag
55
+ end
56
+ eq .text = eq .text .. " " .. eqNumber (inlinesToString (numberOption (" eq" , order )))
52
57
local span = pandoc .Span (eq , pandoc .Attr (label ))
53
58
targetInlines :insert (span )
54
59
end
@@ -85,6 +90,13 @@ function processEquations(blockEl)
85
90
86
91
end
87
92
93
+ function eqTag (eq )
94
+ return " \\ tag{" .. eq .. " }"
95
+ end
96
+
97
+ function eqQquad (eq )
98
+ return " \\ qquad(" .. eq .. " )"
99
+ end
88
100
89
101
function isDisplayMath (el )
90
102
return el .t == " Math" and el .mathtype == " DisplayMath"
You can’t perform that action at this time.
0 commit comments