Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow (embellished) operators in \underset, \overset, and \underoverset to specify accent="true" #894

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions ts/input/tex/base/BaseMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,10 @@ BaseMethods.Overset = function(parser: TexParser, name: string) {
// @test Overset
const top = parser.ParseArg(name);
const base = parser.ParseArg(name);
const topMo = top.coreMO();
const accent = (topMo.isKind('mo') && NodeUtil.getAttribute(topMo, 'accent') === true);
ParseUtil.checkMovableLimits(base);
if (top.isKind('mo')) {
NodeUtil.setAttribute(top, 'accent', false);
}
const node = parser.create('node', 'mover', [base, top]);
const node = parser.create('node', 'mover', [base, top], {accent});
parser.Push(node);
};

Expand All @@ -644,11 +643,10 @@ BaseMethods.Underset = function(parser: TexParser, name: string) {
// @test Underset
const bot = parser.ParseArg(name);
const base = parser.ParseArg(name);
const botMo = bot.coreMO();
const accentunder = (botMo.isKind('mo') && NodeUtil.getAttribute(botMo, 'accent') === true);
ParseUtil.checkMovableLimits(base);
if (bot.isKind('mo')) {
NodeUtil.setAttribute(bot, 'accent', false);
}
const node = parser.create('node', 'munder', [base, bot], {accentunder: false});
const node = parser.create('node', 'munder', [base, bot], {accentunder});
parser.Push(node);
};

Expand All @@ -662,14 +660,12 @@ BaseMethods.Overunderset = function(parser: TexParser, name: string) {
const top = parser.ParseArg(name);
const bot = parser.ParseArg(name);
const base = parser.ParseArg(name);
const topMo = top.coreMO();
const botMo = bot.coreMO();
const accent = (topMo.isKind('mo') && NodeUtil.getAttribute(topMo, 'accent') === true);
const accentunder = (botMo.isKind('mo') && NodeUtil.getAttribute(botMo, 'accent') === true);
ParseUtil.checkMovableLimits(base);
if (top.isKind('mo')) {
NodeUtil.setAttribute(top, 'accent', false);
}
if (bot.isKind('mo')) {
NodeUtil.setAttribute(bot, 'accent', false);
}
const node = parser.create('node', 'munderover', [base, bot, top], {accent: false, accentunder: false});
const node = parser.create('node', 'munderover', [base, bot, top], {accent, accentunder});
parser.Push(node);
};

Expand Down