Giter VIP home page Giter VIP logo

Comments (10)

alexreg avatar alexreg commented on June 15, 2024 1

This is definitely a feature that should be prioritised. I'm not sure if the Java library I ported from handled this at all (actually there were two Java libraries; one for plain TeX and one for LaTeX), but it's worth a check. If not, having a look at the LaTeX source code may be informative.

from xaml-math.

ForNeVeR avatar ForNeVeR commented on June 15, 2024

I think that we'll need to store brace stack somewhere when interpreting the formula, and try to keep size of the matching braces equal. Note that different braces could match each one. E.g. \left< \frac{a}{\frac{b}{c}} \right\} should be rendered as image.

Here's a good explanation of so-called "extensible delimiters" on StackExchange: http://tex.stackexchange.com/a/77593/109147

from xaml-math.

ForNeVeR avatar ForNeVeR commented on June 15, 2024

Aha, it seems like jlatexmath have support for \left and \right.

from xaml-math.

ForNeVeR avatar ForNeVeR commented on June 15, 2024

Just dumping what I've found regarding this task so far.

It seems that we have the atom definition for the brace-enclosed formula; it's called FencedAtom.

It looks like that FencedAtom isn't used in the current code, but it could be exactly what we need. I plan to add the support for \left and \right commands into TexFormulaParser.ProcessCommand method. It seems like that won't be very hard: just parse the formula part before the corresponding \right command and enclose it in FencedAtom (probably we'll want to keep that stack somewhere; we'll see).

I also want to add unit tests for the parser; I'll file another issue about that.

from xaml-math.

alexreg avatar alexreg commented on June 15, 2024

Good work on this. I haven't looked at the implementation yet, but I'm slightly concerned that most of the brackets are implemented except for \left|. Did you not do this in a generic way?

from xaml-math.

ForNeVeR avatar ForNeVeR commented on June 15, 2024

Ah, that's a long story. My initial implementation had some flaws, and I thought there were problems with \left|. Actually there're none.

The delimiters are implemented in a generic way (because there's already a metadata on delimiters), \left| is working. I'll mark it now.

\left. and \right. aren't working currently exactly because there aren't any metadata about them. I think we'll handle them in a special way or simple declare as proper delimiters; will decide later.

from xaml-math.

alexreg avatar alexreg commented on June 15, 2024

Oh, right. Fair enough then!

from xaml-math.

alexreg avatar alexreg commented on June 15, 2024

I just noticed that \left| and \right| still don't work.

from xaml-math.

ForNeVeR avatar ForNeVeR commented on June 15, 2024

Oh, that's interesting. | is considered as an opening delimiter only. Look:
image
image

from xaml-math.

alexreg avatar alexreg commented on June 15, 2024

Good spot. That was definitely the problem.

from xaml-math.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.