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

Failure on rendering \sqrt{} command #188

Open
nuixdt opened this issue May 16, 2024 · 0 comments
Open

Failure on rendering \sqrt{} command #188

nuixdt opened this issue May 16, 2024 · 0 comments

Comments

@nuixdt
Copy link

nuixdt commented May 16, 2024

If the latex is \sqrt only, it will crash on getNextCharacter function call. We modify the sqrt command to check the array index and length by hasCharacters function in MTMathListBuilder.m

  • (MTMathAtom*) atomForCommand:(NSString*) command
    {
    ......
    } else if ([command isEqualToString:@"sqrt"]) {
    // A sqrt command with one argument
    MTRadical* rad = [MTRadical new];
    if ([self hasCharacters]) {
    unichar ch = [self getNextCharacter];
    if (ch == '[') {
    // special handling for sqrt[degree]{radicand}
    rad.degree = [self buildInternal:false stopChar:']'];
    rad.radicand = [self buildInternal:true];
    } else {
    [self unlookCharacter];
    rad.radicand = [self buildInternal:true];
    }
    }
    return rad;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant