simpleclub / math_keyboard

Math expression editing using an on-screen software keyboard or physical keyboard input in a typeset input field in Flutter.
https://simpleclub.github.io/math_keyboard
BSD 3-Clause "New" or "Revised" License
134 stars 50 forks source link

Parentheses with \left and \right #38

Open Francesco-FL opened 2 years ago

Francesco-FL commented 2 years ago

When I was writing, using normal parentheses, if I entered internal fractions, the parenthesis was visibly small and not beautiful.

Immagine 2022-08-15 055735

So I tried to change the normal parenthesis to \left or \right, but each needs the other, and when the user writes the expression starting with opening the parenthesis '\left(' the system fails because it does not find the \right.

So I tried to create a button for myself, in order to create both the \left (and the \right) and let the user type in between. However, I'm not sure how to set it up, I've tried several cases but I don't understand how to do it or if it's possible.

Immagine 2022-08-15 060122 Immagine 2022-08-15 060207

github-actions[bot] commented 2 years ago

Hi 👋🏽 Thank you for opening your first issue with simpleclub/math_keyboard ❤

You can expect triage from us soon 🙂 In the meantime, you can try to search for similar issues in our issue database.

Sub6Resources commented 1 year ago

If #59 gets merged, you should be able to do this with

const BasicKeyboardButtonConfig(
  label: r'\left(\Box\right)',
  value: r'',
  args: [TeXArg.parentheses_lr],
  asTex: true,
  keyboardCharacters: ['(', ')'],
),