Number font in mathml for DocBook
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 39
- Joined: Wed Dec 31, 2008 12:42 am
Number font in mathml for DocBook
Post by expatriate »
Changing the font to sans-serif for a DocBook article containing mathml formulae changes the math font too, which is what I hoped. But it doesn't change the number font (at least, not for FOP PDF output), which remains serif. Can this be fixed?
-
- Posts: 63
- Joined: Fri Dec 12, 2003 6:34 pm
- Contact:
Re: Number font in mathml for DocBook
Post by iulian_velea »
Hello,
What I understand from your message is that you want to change the font of the MathML equations in the final FOP PDF output.
The MathML equations can be included in the DocBook documents as inline content or as an external graphic.
For formulae referenced using <fo:external-graphic> there is no support for transmitting the ".fo" context when transformed to PDF.
Inline MathML is supported through the <fo:instream-foreign-object> tag.
MathML specified inline will take the following attributes from the surrounding ".fo" context:
* Font size
* Font color
* Background color
* Name of the fonts used.
So if you want to change the font of the MathML objects, you need to specify values for the font related attributes of the instream-foreign-object.
To do this you need to modify the DocBook stylesheet responsible for transforming the MathML into FO. The stylesheet is located in the
"{Oxygen_Installation_Folder}/frameworks/docbook/xsl/fo/math.xsl" file.
The template that applies to the MathML sections can be modified like this for instance (I changed the font family and font size):
What I understand from your message is that you want to change the font of the MathML equations in the final FOP PDF output.
The MathML equations can be included in the DocBook documents as inline content or as an external graphic.
For formulae referenced using <fo:external-graphic> there is no support for transmitting the ".fo" context when transformed to PDF.
Inline MathML is supported through the <fo:instream-foreign-object> tag.
MathML specified inline will take the following attributes from the surrounding ".fo" context:
* Font size
* Font color
* Background color
* Name of the fonts used.
So if you want to change the font of the MathML objects, you need to specify values for the font related attributes of the instream-foreign-object.
To do this you need to modify the DocBook stylesheet responsible for transforming the MathML into FO. The stylesheet is located in the
"{Oxygen_Installation_Folder}/frameworks/docbook/xsl/fo/math.xsl" file.
The template that applies to the MathML sections can be modified like this for instance (I changed the font family and font size):
Code: Select all
<!-- "Support" for MathML -->
<xsl:template match="mml:math" xmlns:mml="http://www.w3.org/1998/Math/MathML">
<xsl:choose>
<!-- * If user is using passivetex, we don't wrap the output in -->
<!-- * fo:instream-foreign-object (which passivetex doesn't support). -->
<xsl:when test="not($passivetex.extensions = 0)">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<fo:instream-foreign-object font-family="Monospaced" font-size="20">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</fo:instream-foreign-object>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service