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

[FEATURE] Pressing "Enter" in an inline math block should insert a newline after the math block instead of inside it #279

Open
ByThePowerOfScience opened this issue Mar 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ByThePowerOfScience
Copy link

ByThePowerOfScience commented Mar 26, 2024

Description of the Problem

This is more of a note-to-self than an actual issue since it's fairly trivial to implement, so I'm just making this so I remember to submit a PR adding the functionality myself.

But basically, a newline inside an inline math block (i.e. single-dollar signs: $ ... $) is never valid syntax, so there's no reason not to override the current ENTER-press functionality of "inserting a newline in the middle of the inline math block".

Description of the Solution

There are a few options for what pressing ENTER should do in normal usage:

  1. Place a newline at the end of the line and move the cursor to the newly-created next line,
  2. Convert the inline math block to a multiline math block, or
  3. Same as number 1 but start a new inline math block on the newly-created line.

I propose that we do this:

  • ENTER: number 1.
  • SHIFT+ENTER: number 3.
  • (CTRL/CMD)+SHIFT+ENTER: number 2.
  • And if we are inside of a begin ... end block:
    • Pressing ENTER escapes the math block (number 1),
    • Pressing SHIFT+ENTER inserts \\ (for inline matrices such as column vectors), and
    • Pressing (CTRL/CMD)-SHIFT-ENTER converts it to a multiline math block. (number 2)
@ByThePowerOfScience ByThePowerOfScience added the enhancement New feature or request label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant