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

bad paren format in math #141

Open
QuadnucYard opened this issue Oct 14, 2024 · 1 comment
Open

bad paren format in math #141

QuadnucYard opened this issue Oct 14, 2024 · 1 comment

Comments

@QuadnucYard
Copy link
Contributor

In the cases below, I would rather not format it than wrap the content in parentheses/braces, especially when I already wrap in the cases, in which the contents of cases should not affect formatting before.

$
  f(
    x
  ) = cases(
    "a very very very very very very very long case",
    "b very very very very very very very long case".
  )
$
$
  f(
    x
  ) = abs("aaaaaaaaaaa very very very very very very very very very very very very very very very very very long arg")
$
$
  (
    a + b
  ) = abs("aaaaaaaa very very very very very very very very very very very very very very very very very long arg")
$
$
  f[
    x
  ] = abs("aaaaaaaaaaa very very very very very very very very very very very very very very very very very long arg")
$
$
  f[
    x
  ] = cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos
$
$
  f{
    x
  } = cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos + cos
$

Suggested format result (not considering binop line breaks):

$
  f(x) = cases(
    "a very very very very very very very long case",
    "b very very very very very very very long case".
  )
$
$
  f(x) = abs(
    "aaaaaaaaaaa very very very very very very very very very very very very very very very very very long arg"
  )
$
$
  (a + b) = abs(
    "aaaaaaaa very very very very very very very very very very very very very very very very very long arg"
  )
$
$
  f[x] = abs(
    "aaaaaaaaaaa very very very very very very very very very very very very very very very very very long arg"
  )
$
@Enter-tainer
Copy link
Owner

This is indeed hard to handle. The tricky part is that whether to break or not is determined by the semantics of the equation.

For example, we may disable line breaking for f(x) in f(x) = long long equation, but we may want f((x+y)-(x-y)) = long long equation to be breaked into multiple lines. Would you like proposing a rule to determine whether to break a MathDelimited into multiple lines or not?

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

2 participants