$epub-maths: true !default;
@if $epub-maths {

    // Math

    math {}

    // Automatic fractions

    .fractions { 
    	-moz-font-feature-settings: "frac"; 
    	-ms-font-feature-settings: "frac"; 
    	-o-font-feature-settings: "frac"; 
    	-webkit-font-feature-settings: "frac"; 
    	font-feature-settings: "frac"; 
    	font-style: inherit;
    }

    // MathJax
    // Only use these styles to position maths blocks,
    // not to style the maths itself. For dire warnings, see
    // http://stackoverflow.com/questions/5639827/styling-mathjax/25329062#25329062
    // MathJax output should be styled in _includes/mathjax-config.html
    .MathJax_Display, .mjpage__block {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 0 0.4em 0; // avoids vertical scrollbars appearing
        &.visuallyhidden {
            padding: 0;
        }
    }
    // Centre displayed maths generated by mathjax-node-page
    .mjpage__block {
        math {
            margin-left: auto;
            margin-right: auto;
        }
    }

}