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

Sized brackets #82

Open
Happypig375 opened this issue Nov 4, 2019 · 5 comments
Open

Sized brackets #82

Happypig375 opened this issue Nov 4, 2019 · 5 comments
Labels
Aspect/Editor This is related to CSharpMath.Editor. Status/1. Blocked Requires another issue or pull request to be completed before being ready. Type/Enhancement

Comments

@Happypig375
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently, the editor cannot create and edit bracket pairs that scale to the size of the formulae inside. This will be beneficial as bracket-counting will no longer be required.

Describe the solution you'd like
Being able to point MathListIndices to Inner atoms. (e.g. \big(, \big))

Describe alternatives you've considered
Not implementing. Traditional bracket pairs still have the advantage of not requiring to be balanced.

Difficulty: How difficult would it be? (Trivial, Very Easy, Easy, Moderate, Hard, Very Hard, Tedious, Backbreaking)
Hard. Editing inner atoms is tricky because the ambiguity of editing delimiters of Inner atoms.

@Happypig375 Happypig375 added Type/Enhancement Aspect/Editor This is related to CSharpMath.Editor. labels Nov 4, 2019
@charlesroddie
Copy link
Collaborator

I doubt that sizing brackets would involve editing delimiters, or specifying their size explicitly.

Entering ( should give the LaTeX-equivalent of \left( \placeholder \right), or whatever equates to Atom.Bracketed(Bracket.Ordinary, Atom.Placeholder). Brackets will then size automatically.

@charlesroddie charlesroddie changed the title Add Inner atom editing Sized brackets Nov 4, 2019
@Happypig375
Copy link
Collaborator Author

What about writing ranges like [10, 30)?

@charlesroddie
Copy link
Collaborator

charlesroddie commented Nov 4, 2019

Interesting. I think two options: (below in pseudoTeX)

  1. As Office Equation Editor does: when [10,30 has been entered it is stored as ordary atoms ([10,30), but when the final right bracket is entered it gets matched (\left[ 10,30 \right)).
  2. As MathQuill: when [ is entered it is actually \left[ \placeholder \rightGray], and before the ) is entered it is \left[ 10, 30 \rightGray], and then entering ) overwrites the rightGray] with right) giving \left[ 10, 30 \right).

@charlesroddie
Copy link
Collaborator

Either way we need to allow matched brackets, so that is the first step.

MathKeyboardInput.BothRoundBrackets should give matched brackets.

Currently if you initialize with:

let prevMathList = CSharpMath.Atoms.MathLists.FromString(@"\left( \frac{a}{b} \right)")
for atom in prevMathList do
    keyboard.MathList.Add(atom)
    keyboard.InsertionIndex <- MathListIndex.Level0Index keyboard.MathList.Count

then display is fine, but you can't get inside the brackets using arrow keys, and clicking inside gives an error:

System.ArgumentException: 'ListDisplay LinePosition Regular inside an ListDisplay - shouldn't happen
Parameter name: self

@Happypig375 Happypig375 added the Status/1. Ready This issue has been confirmed and is ready to be worked on. label Jun 1, 2020
@Happypig375
Copy link
Collaborator Author

Blocked on #117 and #124.

@Happypig375 Happypig375 added Status/1. Blocked Requires another issue or pull request to be completed before being ready. and removed Status/1. Ready This issue has been confirmed and is ready to be worked on. labels Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aspect/Editor This is related to CSharpMath.Editor. Status/1. Blocked Requires another issue or pull request to be completed before being ready. Type/Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants