Skip to content

Commit 2f35fe3

Browse files
committed
Merge: LaTeX macros for offline math
2 parents edc6708 + 56d683a commit 2f35fe3

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

xsl/pretext-html.xsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14038,6 +14038,9 @@ TODO:
1403814038
<!-- We could rename this properly, since we are -->
1403914039
<!-- sneaking in packages, which load first, in -->
1404014040
<!-- case authors want to build on these macros -->
14041+
<!-- NB: "math support" macros (fillin-math, sfrac) must -->
14042+
<!-- be defined here AND in the "extraction-wrapper" -->
14043+
<!-- template in support/extract-math.xsl -->
1404114044
<xsl:template name="latex-macros">
1404214045
<div id="latex-macros" class="hidden-content process-math" style="display:none">
1404314046
<xsl:call-template name="inline-math-wrapper">

xsl/support/extract-math.xsl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,19 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
129129
<xsl:variable name="latex-macros-html" select="str:replace($no-less-than, '\newcommand{\gt}{&gt;}&#xa;', '')"/>
130130
<!-- put macros and packages early for MJ to find -->
131131
<!-- give the div an @id so we can trash it as a leftover -->
132+
<!-- NB: "math support" macros (fillin-math, sfrac) must -->
133+
<!-- be defined here AND in the "latex-macros" named -->
134+
<!-- template in pretext-html.xsl -->
132135
<div id="latex-macros">
133136
<xsl:call-template name="inline-math-wrapper">
134137
<xsl:with-param name="math">
135138
<xsl:value-of select="$latex-packages-mathjax"/>
136139
<xsl:value-of select="$latex-macros-html"/>
140+
<xsl:call-template name="fillin-math"/>
141+
<!-- legacy built-in support for "slanted|beveled|nice" fractions -->
142+
<xsl:if test="$b-has-sfrac">
143+
<xsl:text>\newcommand{\sfrac}[2]{{#1}/{#2}}&#xa;</xsl:text>
144+
</xsl:if>
137145
</xsl:with-param>
138146
</xsl:call-template>
139147
</div>

0 commit comments

Comments
 (0)