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

    // Math

    math[display="block"] {
        margin-left: auto;
        margin-right: auto;
    }

    // Automatic fractions

    .fractions { 
    	font-variant: prince-opentype(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 {
        margin: $line-height-default auto;
        & + p {
           text-indent: 0;
        }
    }
    // Centre displayed maths generated by mathjax-node-page
    .mjpage__block {
        math {
            margin-left: auto;
            margin-right: auto;
        }
    }
    // PDF output override to match math font size to
    // text font size when using mathjax-node-page.
    // This may be a magic number to adjust,
    // depending on your body text font.
    .mjpage * {
        font-size: $math-size-percent;
    }
}
