diff --git a/MathMathML.php b/MathMathML.php index 0bb18f6..058400e 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -219,6 +219,8 @@ class MathMathML extends MathRenderer { if ( $this->getMathStyle() == 'inlineDisplaystyle' ) { // default preserve the (broken) layout as it was $out = 'type=inline-TeX&q=' . rawurlencode( '{\\displaystyle ' . $input . '}' ); + } elseif ($this->getMathStyle() == 'inline' ){ + $out = 'type=inline-TeX&q=' . rawurlencode( $input ); } else { $out = 'type=tex&q=' . rawurlencode( $input ); } diff --git a/MathRenderer.php b/MathRenderer.php index 0ae380b..46aeeea 100644 --- a/MathRenderer.php +++ b/MathRenderer.php @@ -67,17 +67,16 @@ abstract class MathRenderer { if ( isset( $params['id'] ) ) { $this->id = $params['id']; } - $mathStyle = null; if ( isset( $params['display'] ) ) { $layoutMode = $params['display']; if ( $layoutMode == 'block' ) { - $mathStyle = 'display'; + $this->mathStyle = 'display'; $tex = '{\displaystyle ' . $tex . '}'; } elseif ( $layoutMode == 'inline' ) { - $mathStyle = 'inlineDisplaystyle'; + $this->mathStyle = 'inline'; $tex = '{\textstyle ' . $tex . '}'; } elseif ( $layoutMode == 'linebreak' ) { - $mathStyle = 'linebreak'; + $this->mathStyle = 'linebreak'; $tex = '\[ ' . $tex . ' \]'; } } @@ -93,8 +92,6 @@ abstract class MathRenderer { // be centered in a new line, or just in be displayed in the current line. $this->userInputTex = $tex; $this->tex = $tex; - $this->mathStyle = $mathStyle; - } /**