Fix: Set default MathStyle to inlineDisplaystyle

Redo Ibf6bdbd4ea36b4905445d5878f32f7e0b2bc8bac, which was
reverted by I029328849f05ec2afcabf38d2b79b337cb54cbd5.

In addition this patch simplifies the tex sent to the mathoid
server. Instead of {\displaystyle {\textstyle ... } } only
{\textstyle is sent (which overwrites \displaystyle anyway).

Change-Id: I16d6f67215c2f85ecd1d3a0bddacfc1700681557
This commit is contained in:
physikerwelt 2015-08-05 11:53:10 +02:00
parent 82db12579e
commit f93333686d
2 changed files with 5 additions and 6 deletions

View file

@ -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 );
}

View file

@ -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;
}
/**