Skip to content

Commit

Permalink
Resolve apresentação de fórmula tex-math em que \begin{document} e …
Browse files Browse the repository at this point in the history
…`\end{document}` não estão respectivamente no início e no fim do conteúdo da tag (#294)
  • Loading branch information
robertatakenaka authored Apr 18, 2022
1 parent 5fb56cd commit 1607339
Show file tree
Hide file tree
Showing 4 changed files with 4,008 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

<xsl:template match="inline-formula/tex-math | inline-formula/alternatives/tex-math">
<xsl:choose>
<xsl:when test="contains(.,'\begin{document}') and contains(.,'\end{document}')">
<xsl:value-of select="normalize-space(substring-after(substring-before(.,'\end{document}'),'\begin{document}'))"/>
</xsl:when>
<xsl:when test="starts-with(.,'\begin') and contains(.,'\end')">
<xsl:value-of select="."/>
</xsl:when>
Expand All @@ -44,6 +47,10 @@
<xsl:template match="disp-formula/tex-math | disp-formula/alternatives/tex-math">
<span class="formula-body">
<xsl:choose>
<xsl:when test="contains(.,'\begin{document}') and contains(.,'\end{document}')">
<span>
<xsl:value-of select="normalize-space(substring-after(substring-before(.,'\end{document}'),'\begin{document}'))"/></span>
</xsl:when>
<xsl:when test="starts-with(.,'\begin') and contains(.,'\end')">
<xsl:value-of select="."/>
</xsl:when>
Expand Down
4 changes: 3 additions & 1 deletion packtools/catalogs/htmlgenerator/v2.0/config-vars.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
<xsl:variable name="MATHJAX">
<xsl:choose>
<xsl:when test="$math_js!=''"><xsl:value-of select="$math_js"/></xsl:when>
<xsl:otherwise>https://cdn.jsdelivr.net/npm/mathjax@3.0.0/es5/tex-mmlmath-chtml.js</xsl:otherwise>
<xsl:otherwise>https://cdn.jsdelivr.net/npm/mathjax@3.0.0/es5/tex-mml-svg.js</xsl:otherwise>


</xsl:choose>
</xsl:variable>

Expand Down
Loading

0 comments on commit 1607339

Please sign in to comment.