Skip to content

Commit 0bc416b

Browse files
committed
1 parent 2185f0b commit 0bc416b

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

ts/input/tex/base/BaseItems.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,11 @@ export class PrimeItem extends BaseItem {
208208
*/
209209
public checkItem(item: StackItem): CheckType {
210210
let [top0, top1] = this.Peek(2);
211-
const isSup = NodeUtil.isType(top0, 'msubsup') && !NodeUtil.getChildAt(top0, (top0 as MmlMsubsup).sup);
212-
const isOver = NodeUtil.isType(top0, 'munderover') && !NodeUtil.getChildAt(top0, (top0 as MmlMunderover).over);
211+
const isSup = NodeUtil.isType(top0, 'msubsup') &&
212+
!NodeUtil.getChildAt(top0, (top0 as MmlMsubsup).sup);
213+
const isOver = NodeUtil.isType(top0, 'munderover') &&
214+
!NodeUtil.getChildAt(top0, (top0 as MmlMunderover).over) &&
215+
!NodeUtil.getProperty(top0, 'subsupOK');
213216
if (!isSup && !isOver) {
214217
// @test Prime, Double Prime
215218
const node = this.create('node', top0.getProperty('movesupsub') ? 'mover' : 'msup', [top0, top1]);

ts/input/tex/base/BaseMappings.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,13 @@ new sm.CommandMap('macros', {
510510
tan: 'NamedFn',
511511
tanh: 'NamedFn',
512512

513-
limits: ['Limits', 1],
514-
nolimits: ['Limits', 0],
513+
limits: ['Limits', true],
514+
nolimits: ['Limits', false],
515515

516516
overline: ['UnderOver', '2015'],
517517
underline: ['UnderOver', '2015'],
518-
overbrace: ['UnderOver', '23DE', 1],
519-
underbrace: ['UnderOver', '23DF', 1],
518+
overbrace: ['UnderOver', '23DE', true],
519+
underbrace: ['UnderOver', '23DF', true],
520520
overparen: ['UnderOver', '23DC'],
521521
underparen: ['UnderOver', '23DD'],
522522
overrightarrow: ['UnderOver', '2192'],

ts/input/tex/base/BaseMethods.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ BaseMethods.Prime = function(parser: TexParser, c: string) {
258258
if ((NodeUtil.isType(base, 'msubsup') && !NodeUtil.isType(base, 'msup') &&
259259
NodeUtil.getChildAt(base, (base as MmlMsubsup).sup)) ||
260260
(NodeUtil.isType(base, 'munderover') && !NodeUtil.isType(base, 'mover') &&
261-
NodeUtil.getChildAt(base, (base as MmlMunderover).over))) {
261+
NodeUtil.getChildAt(base, (base as MmlMunderover).over) &&
262+
!NodeUtil.getProperty(base, 'subsupOK'))) {
262263
// @test Double Prime Error
263264
throw new TexError('DoubleExponentPrime',
264265
'Prime causes double exponent: use braces to clarify');
@@ -481,9 +482,9 @@ BaseMethods.NamedOp = function(parser: TexParser, name: string, id: string) {
481482
* Handle a limits command for math operators.
482483
* @param {TexParser} parser The calling parser.
483484
* @param {string} name The macro name.
484-
* @param {string} limits The limits arguments.
485+
* @param {boolean} limits True for \limits, false for \nolimits.
485486
*/
486-
BaseMethods.Limits = function(parser: TexParser, _name: string, limits: string) {
487+
BaseMethods.Limits = function(parser: TexParser, _name: string, limits: boolean) {
487488
// @test Limits
488489
let op = parser.stack.Prev(true);
489490
// Get the texclass for the core operator.

0 commit comments

Comments
 (0)