/*
    Math is cool, CSS is cool, use for whatever you like!
    Made by Mathew Pregasen. MIT license.
*/

div[equation] {
    box-sizing: border-box;
    height: auto;
    margin: 50px auto 0;
    min-height: 100px;
    width: 80%;
}

div[equation]::after{
    clear: both;
    content: '';
    display: table;
}

div[equation] * {
    box-sizing: border-box;
    float: left;
}

div[equation] sup {
    float: none;
    font-size: 0.4em;
}

div[integral],
div[doubleintegral],
div[contourintegral],
div[surfaceintegral],
div[volumeintegral],
div[tripleintegral],
div[summation],
div[fraction],
div[contourintegral],
div[limit] {
    display: inline-block;
    height: 100px;
    margin-left: 0;
    margin-right: 0;
    padding-left: 9px;
    padding-right: 9px;
    position: relative;
    width: auto;
}

div[integral]::before {
    content: '\222b';
    float: left;
    font-size: 5em;
}

div[integral] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 40px;
    position: absolute;
    top: 8px;
    width: auto;
}

div[integral] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    padding-left: 30px;
    position: absolute;
    top: 75px;
    width: auto;
}

div[integral] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25px;
    margin-top: 1.5em;
    padding-left: 18px;
    width: auto;
}

div[contourintegral]::before {
    content: '\222E';
    float: left;
    font-size: 5em;
    margin-top: -8px;
}

div[contourintegral] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 47px;
    position: absolute;
    top: 8px;
    width: auto;
}

div[contourintegral] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    padding-left: 30px;
    position: absolute;
    top: 65px;
    width: auto;
}

div[contourintegral] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25px;
    margin-top: 1.5em;
    padding-left: 0;
    width: auto;
}

div[equation] > div[term] {
    display: inline-block;
    float: left;
    font-size: 1.5em;
    font-style: italic;
    height: 30%;
    margin-bottom: 0;
    padding-left: 3px;
    position: relative;
    top: 35%;
    width: auto;
}

div[doubleintegral]::before {
    content: '\222b \222b';
    float: left;
    font-size: 5em;
}

div[doubleintegral] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 62px;
    position: absolute;
    top: 8px;
    width: auto;
}

div[doubleintegral] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    padding-left: 50px;
    position: absolute;
    top: 75px;
    width: auto;
}

div[doubleintegral] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25%;
    margin-top: 1.5em;
    padding-left: 18px;
    width: auto;
}

div[surfaceintegral]::before {
    content: '\222F';
    float: left;
    font-size: 5em;
    margin-top: -8px;
}

div[surfaceintegral] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 72px;
    position: absolute;
    top: 3px;
    width: auto;
}

div[surfaceintegral] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    padding-left: 50px;
    position: absolute;
    top: 65px;
    width: auto;
}

div[surfaceintegral] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25%;
    margin-top: 1.5em;
    padding-left: 0;
    width: auto;
}

div[volumeintegral]::before {
    content: '\2230';
    float: left;
    font-size: 5em;
    margin-top: -8px;
}

div[volumeintegral] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 92px;
    position: absolute;
    top: 3px;
    width: auto;
}

div[volumeintegral] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    padding-left: 75px;
    position: absolute;
    top: 65px;
    width: auto;
}

div[volumeintegral] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25%;
    margin-top: 1.5em;
    padding-left: 0;
    width: auto;
}

div[tripleintegral]::before {
    content: '\222b \222b \222b';
    float: left;
    font-size: 5em;
}

div[tripleintegral] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 86px;
    position: absolute;
    top: 8px;
    width: auto;
}

div[tripleintegral] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    padding-left: 70px;
    position: absolute;
    top: 75px;
    width: auto;
}

div[tripleintegral] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25%;
    margin-top: 1.5em;
    padding-left: 18px;
    width: auto;
}

div[limit]::before {
    content: 'lim';
    float: left;
    font-size: 2em;
    margin-top: 25px;
}

div[limit] > div[variable] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 2px;
    position: absolute;
    top: 53px;
    width: auto;
}

div[limit] > div[variable]::after{
    content: '\2192';
    margin-left: -4px;
}

div[limit] > div[goingto] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    padding-left: 22px;
    position: absolute;
    text-align: right;
    top: 53px;
    width: 40px;
}

div[limit] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25%;
    margin-left: 5px;
    margin-top: 1.5em;
    padding-left: 0;
    width: auto;
}

div[summation]::before {
    content: '\2211';
    float: left;
    font-size: 5em;
}

div[summation] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    position: absolute;
    text-align: center;
    top: 2px;
    width: 50px;
}

div[summation] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    position: absolute;
    text-align: center;
    top: 82px;
    width: 45px;
}

div[summation] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25%;
    margin-top: 1.5em;
    padding-left: 3px;
    width: auto;
}

div[product] {
    display: inline-block;
    float: left;
    height: 100px;
    margin-left: 0;
    padding-left: 9px;
    padding-right: 9px;
    position: relative;
    width: auto;
}

div[product]::before {
    content: '\03A0 ';
    float: left;
    font-size: 5em;
    padding-top: 5px;
}

div[product] > div[upperbound] {
    font-size: 1em;
    font-style: italic;
    height: 25%;
    position: absolute;
    text-align: center;
    top: 4px;
    width: 65px;
}

div[product] > div[lowerbound] {
    font-size: 1em;
    font-style: italic;
    height: auto;
    position: absolute;
    text-align: center;
    top: 80px;
    width: 65px;
}

div[product] > div[of] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 25%;
    margin-top: 1.5em;
    padding-left: 3px;
    width: auto;
}

div[fraction] {
    display: inline-block;
    float: left;
    height: 100px;
    margin-left: 0;
    padding-left: 9px;
    padding-right: 9px;
    position: relative;
    width: auto;
}

div[fraction] > div[top] {
    border-bottom: 2px solid #444;
    font-size: 1.3em;
    font-style: italic;
    height: 24px;
    min-width: 100%;
    padding-bottom: 3px;
    position: relative;
    text-align: center;
    top: 28px;
    width: 65px;
}

div[fraction] > div[bottom] {
    border-top: 2px solid #444;
    font-size: 1.3em;
    font-style: italic;
    height: relative;
    min-width: 100%;
    position: relative;
    text-align: center;
    top: 26px;
}

div[derivative] {
    display: inline-block;
    float: left;
    height: 100px;
    margin-left: 0;
    padding-left: 9px;
    padding-right: 9px;
    position: relative;
    width: 50px;
}

div[derivative] > div[top] {
    border-bottom: 2px solid #444;
    font-size: 1.3em;
    font-style: italic;
    height: 24px;
    min-width: 100%;
    padding-bottom: 3px;
    position: relative;
    text-align: center;
    top: 28px;
}

div[derivative] > div[bottom] {
    border-top: 2px solid #444;
    font-size: 1.3em;
    font-style: italic;
    height: relative;
    min-width: 100%;
    position: relative;
    text-align: center;
    top: 26px;
}

div[partial] > div[top]::before,
div[partial] > div[bottom]::before {
    content: '\2202';
    margin-right: -5px;
}

div[add],
div[subtract],
div[multiply],
div[divide] {
    display:inline-block;
    font-style: normal;
    float:left;
}

div[equation] > hr[multiply] {
    border: none;
    clear: none;
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 100px;
    margin: 0;
    padding-left: 3px;
    padding-top: 35px;
    position: relative;
    width: auto;
}

hr[divide] {
    display: inline-block;
}

hr[divide]::before {
    content: '\00F7';
    float: left;
    font-style: normal;
}

div[equation] > hr[divide] {
    border: none;
    clear: none;
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 100px;
    margin: 0;
    padding-left: 3px;
    padding-top: 35px;
    position: relative;
    width: auto;
}

div[add]::before {
    content: '+';
}

div[subtract]::before {
    content: '-';
}

div[multiply]::before {
    content: '\00D7';
}

div[divide]::before {
    content: '\00F7';
}

div[equation] > div[add],
div[equation] > div[subtract],
div[equation] > div[multiply],
div[equation] > div[divide],
div[equation] > div[term] {
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 100px;
    margin-top: 0;
    padding-left: 3px;
    padding-top: 35px;
    position: relative;
    width: auto;
}

div[equation] hr {
    border: none;
    clear: none;
    margin: 0;
}

div[equation] hr[partial]::before {
    content: '\2202';
    font-style: normal;
}

div[equation] hr[pm]::before {
    content: '\2213';
    font-style: normal;
}

div[equation] hr[infty] {
    -webkit-margin-after: -6px !important;
    -webkit-margin-before: 2px !important;
    display: inline-block !important;
    float: none !important;
}

div[equation] hr[infty]::before {
    content: '\221e';
    font-style: normal;
}

div[equation] hr[approx]::before {
    content: '\2248';
    font-style: normal;
}

div[equation] hr[neq]::before {
    content: '\2260';
    font-style: normal;
}

div[equation] hr[leq]::before {
    content: '\2264';
    font-style: normal;
}

div[equation] hr[geq]::before {
    content: '\2265';
    font-style: normal;
}

div[equation] hr[forall]::before {
    content: '\2200';
    font-style: normal;
}

div[equation] hr[exists]::before {
    content: '\2203';
    font-style: normal;
}

div[equation] hr[nexists]::before {
    content: '\2204';
    font-style: normal;
}

div[equation] hr[in]::before {
    content: '\2208';
    font-style: normal;
}

div[equation] hr[notin]::before {
    content: '\2209';
    font-style: normal;
}

div[equation] hr[and]::before {
    content: '\2227';
    font-style: normal;
}

div[equation] hr[or]::before {
    content: '\2228';
    font-style: normal;
}

div[equation] hr[cap]::before {
    content: '\2229';
    font-style: normal;
}

div[equation] hr[cup]::before {
    content: '\222A';
    font-style: normal;
}


/* Discrete Functionality */

div[equation] hr[congruent]::before {
    content: '\2261';
    font-style: normal;
}

div[equation] hr[subsetleft]::before {
    content: '\2282';
    font-style: normal;
}

div[equation] hr[subsetright]::before {
    content: '\2283';
    font-style: normal;
}

div[equation] hr[notsubsetleft]::before {
    content: '\2284';
    font-style: normal;
}

div[equation] hr[notsubsetright]::before {
    content: '\2285';
    font-style: normal;
}

div[equation] hr[subsetorequaltoleft]::before {
    content: '\2286';
    font-style: normal;
}

div[equation] hr[subsetorequaltoright]::before {
    content: '\2287';
    font-style: normal;
}

div[equation] hr[notsubsetorequaltoleft]::before {
    content: '\2288';
    font-style: normal;
}

div[equation] hr[notsubsetorequaltoright]::before {
    content: '\2289';
    font-style: normal;
}


/* Greek Functionality */

div[equation] hr[pi] {
    -webkit-margin-after: -4px !important;
    display: inline-block !important;
    float: none !important;
}

div[equation] hr[pi]::before {
    content: '\03C0';
    font-style: normal;
}

div[equation] hr[alpha]::before {
    content: '\03B1';
    font-style: normal;
}

div[equation] hr[beta]::before {
    content: '\03B2';
    font-style: normal;
}

div[equation] hr[lambda]::before {
    content: '\03BB';
    font-style: normal;
}

div[equation] hr[delta]::before {
    content: '\2206';
    font-style: normal;
}

hr[add] {
    display: inline-block;
}

hr[add]::before {
    content: '+';
    float: left;
    font-style: normal;
}

div[equation] > hr[add] {
    border: none;
    clear: none;
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 100px;
    margin: 0;
    padding-left: 3px;
    padding-top: 35px;
    position: relative;
    width: auto;
}

hr[subtract] {
    display: inline-block;
}

hr[subtract]::before {
    content: '-';
    float: left;
    font-style: normal;
}

div[equation] > hr[subtract] {
    border: none;
    clear: none;
    display: inline-block;
    font-size: 1.5em;
    font-style: italic;
    height: 100px;
    margin: 0;
    padding-left: 3px;
    padding-top: 35px;
    position: relative;
    width: auto;
}

hr[multiply] {
    display: inline-block;
}

hr[multiply]::before {
    content: '\00D7';
    float: left;
    font-style: normal;
}
