Commit 35527fc2 authored by Jérôme Chauveau's avatar Jérôme Chauveau
Browse files

mathml stuff

parent 282fcde3
Loading
Loading
Loading
Loading
+61 −63
Changes for certic-jats2html.xsl: 61 added lines, 63 removed lines.
Original line number Diff line number Diff line
@@ -3,50 +3,54 @@
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xs="http://www.w3.org/1999/XSL/Transform"
                xmlns:mml="http://www.w3.org/1998/Math/MathML"
                xmlns:xs="http://www.w3.org/1999/XSL/Transform"
                xmlns:xsl-="http://www.w3.org/1999/XSL/Transform"
                exclude-result-prefixes="xlink mml">


    <xsl:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
                doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                encoding="UTF-8"/>
    <!--<xsl:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"-->
                <!--doctype-system="http://www.w3.org/TR/html4/loose.dtd"-->
                <!--encoding="UTF-8"/>-->

    <xsl:output method="html" version="5.0"
        encoding="UTF-8" indent="no"/>

    <xsl:strip-space elements="*"/>

    <!-- Space is preserved in all elements allowing #PCDATA -->
    <xsl:preserve-space
            elements="abbrev abbrev-journal-title access-date addr-line
              aff alt-text alt-title article-id article-title
              attrib award-id bold chapter-title chem-struct
              collab comment compound-kwd-part compound-subject-part
              conf-acronym conf-date conf-loc conf-name conf-num
              conf-sponsor conf-theme contrib-id copyright-holder
              copyright-statement copyright-year corresp country
              date-in-citation day def-head degrees disp-formula
              edition elocation-id email etal ext-link fax fpage
              funding-source funding-statement given-names glyph-data
              gov inline-formula inline-supplementary-material
              institution isbn issn-l issn issue issue-id issue-part
              issue-sponsor issue-title italic journal-id
              journal-subtitle journal-title kwd label license-p
              long-desc lpage meta-name meta-value mixed-citation
              monospace month named-content object-id on-behalf-of
              overline p page-range part-title patent person-group
              phone prefix preformat price principal-award-recipient
              principal-investigator product pub-id publisher-loc
              publisher-name related-article related-object role
              roman sans-serif sc season self-uri series series-text
              series-title sig sig-block size source speaker std
              strike string-name styled-content std-organization
              sub subject subtitle suffix sup supplement surname
              target td term term-head tex-math textual-form th
              time-stamp title trans-source trans-subtitle trans-title
              underline uri verse-line volume volume-id volume-series
              xref year

              mml:annotation mml:ci mml:cn mml:csymbol mml:mi mml:mn
              mml:mo mml:ms mml:mtext"/>
    <!--<xsl:preserve-space-->
            <!--elements="abbrev abbrev-journal-title access-date addr-line-->
              <!--aff alt-text alt-title article-id article-title-->
              <!--attrib award-id bold chapter-title chem-struct-->
              <!--collab comment compound-kwd-part compound-subject-part-->
              <!--conf-acronym conf-date conf-loc conf-name conf-num-->
              <!--conf-sponsor conf-theme contrib-id copyright-holder-->
              <!--copyright-statement copyright-year corresp country-->
              <!--date-in-citation day def-head degrees disp-formula-->
              <!--edition elocation-id email etal ext-link fax fpage-->
              <!--funding-source funding-statement given-names glyph-data-->
              <!--gov inline-formula inline-supplementary-material-->
              <!--institution isbn issn-l issn issue issue-id issue-part-->
              <!--issue-sponsor issue-title italic journal-id-->
              <!--journal-subtitle journal-title kwd label license-p-->
              <!--long-desc lpage meta-name meta-value mixed-citation-->
              <!--monospace month named-content object-id on-behalf-of-->
              <!--overline p page-range part-title patent person-group-->
              <!--phone prefix preformat price principal-award-recipient-->
              <!--principal-investigator product pub-id publisher-loc-->
              <!--publisher-name related-article related-object role-->
              <!--roman sans-serif sc season self-uri series series-text-->
              <!--series-title sig sig-block size source speaker std-->
              <!--strike string-name styled-content std-organization-->
              <!--sub subject subtitle suffix sup supplement surname-->
              <!--target td term term-head tex-math textual-form th-->
              <!--time-stamp title trans-source trans-subtitle trans-title-->
              <!--underline uri verse-line volume volume-id volume-series-->
              <!--xref year-->

              <!--mml:annotation mml:ci mml:cn mml:csymbol mml:mi mml:mn-->
              <!--mml:mo mml:ms mml:mtext"/>-->


    <xsl:template match="node() | @*">
@@ -321,8 +325,8 @@
        </caption>
    </xsl:template>

    <xsl:template match="title">

    <xsl:template match="title">
        <xsl:variable name="ancestors">
            <xs:value-of select="count(ancestor::sec) + count(ancestor::caption)"/>
        </xsl:variable>
@@ -331,43 +335,23 @@
            <xs:value-of select="count(preceding::title)"/>
        </xsl:variable>

        <xsl:choose>
            <xsl:when test="$ancestors=1">
                <h2>
                    <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
                    <xsl:apply-templates></xsl:apply-templates>
                </h2>
            </xsl:when>
            <xsl:when test="$ancestors=2">
                <h3>
                    <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
                    <xsl:apply-templates></xsl:apply-templates>
                </h3>
            </xsl:when>

            <xsl:when test="$ancestors=3">
                <h4>
                    <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
                    <xsl:apply-templates></xsl:apply-templates>
                </h4>
            </xsl:when>
            <xsl:otherwise>
                <h5>
        <xsl:element name="h{$ancestors + 1}">
            <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
            <xsl:apply-templates></xsl:apply-templates>
                </h5>
            </xsl:otherwise>

        </xsl:choose>

        </xsl:element>
    </xsl:template>


    <!-- boxed-text -->
    <xsl:template match="boxed-text">
        <div class="boxed-text">
            <xsl:apply-templates/>
        </div>
    </xsl:template>



    <!-- table -->
    <xsl:template match="table-wrap">
        <xsl:choose>
@@ -415,4 +399,18 @@
        </em>
    </xsl:template>

    <!-- mathml -->
    <xsl:template match="disp-formula[@content-type='math/mathml']">
        <div class="disp-formula">
            <xsl:apply-templates/>
        </div>
    </xsl:template>


    <xsl:template match="mml:*">
        <xsl:element name="{local-name(.)}">
            <xsl:apply-templates select="@*|*|text()"/>
        </xsl:element>
    </xsl:template>

</xsl:stylesheet>
+3 −1
Changes for resources/styles/article.css: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ section.back{
    max-height: calc(100vh - var(--nav-height));
    scrollbar-color: var(--third-color) var(--third-color);
}

.article-wrap{
    max-width: 820px;
    margin-left: auto;
@@ -121,9 +122,10 @@ section.back{
    font-size: 3.2rem;
    margin-bottom: 50px;
    line-height: normal;
    padding-top:5px;
    padding-top: calc(var(--nav-height));
}


.article-wrap ul, .article-wrap ol{
    margin-left: 40px;
}