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

Allow multiple lines in formula blocks using "line breaks” with backslashes (\) with LaTex #2884

Closed
eliknebel opened this issue Aug 2, 2022 · 4 comments
Labels
Enhancement New feature or request Jira Create a Jira issue for this Priority 3: Normal

Comments

@eliknebel
Copy link
Contributor

Math course authors want the ability to create “line breaks” within the equations by using backslashes () with LaTex. This would allow multiple lines of formulas in one block of math editor.

@eliknebel eliknebel added Priority 3: Normal Enhancement New feature or request labels Aug 2, 2022
@marc-hughes
Copy link
Contributor

According to mathjax/MathJax#2312

New lines are not currently supported in MathJax 3 (weird, right?)
Supposedly, it's under development for a release with a timeframe of "end of this summer"

We have three options:

  1. Wait until that release
  2. Work-around that by parsing out newlines and then rendering two different mathjax formulas within a single block so it is visually on two lines
  3. Authors can use the \displaylines{} command something like this:

image

If we went with 2. for the short-term, we could go back to 1. when its ready, and I don't think it would be more than a day or two's work to do that, but considering 3. works today, I'm unsure if it's worth doing. @eliknebel or @darrensiegel - Got a suggestion on a direction there?

@andersweinstein
Copy link
Contributor

Would it be even easier than 2. if torus just inserted a step to rewrite \\-containing LaTeX payloads to \displaylines{..} form before rendering?

@andersweinstein
Copy link
Contributor

andersweinstein commented Dec 2, 2023

It turns out there are a LOT of instances of this in Chem1 and Chem2. It is used pervasively in those courses to show derivations in question feedback and explanations. Grep finds about 20,000 \\'s in 287 files in legacy Chem1 XML source. Many equations have multiple occurrences so there are fewer equations than that. And a small number are only at the end of the equation so may not need to be handled. But it is too many to easily fix by manual editing and a very high priority issue for courses that have already migrated to torus.

Edit to add: many chem equations wrap formula in \begin{array}...\end{array} which also works with embedded newlines in MathJax 3. So the number of equations needing repair is lower.

@andersweinstein andersweinstein added the Jira Create a Jira issue for this label Dec 4, 2023
Copy link

github-actions bot commented Dec 4, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Jira Create a Jira issue for this Priority 3: Normal
Projects
None yet
Development

No branches or pull requests

4 participants