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

attempt to parse display math for proper PTX md/mrow structure when a… #1089

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

Alex-Jordan
Copy link
Contributor

…pplicable

In PTX, multi-lined math expressions are structured with md and mrow tags. Or you can just have the usual LaTeX multi-line math constructors inside an me tag. Up until this PR, we have just done the latter for PG display math being converted to PTX. This PR changes things so that if the display math is an align, alignat, or gather environment, it all gets parsed into an md with mrows.

The following code demonstrates various math structures. Only the last three structures are meant to be affected by this PR, because those are what PTX converts md/mrow to. You can try this before the PR using the PG editor with PTX output, and you will see the display math is always wrapped in me. Then with these changes, the last three have md/mrow structure.

BEGIN_PGML
[`\pi`]

[``\pi``]

[```\pi```]

[```
\begin{aligned}
\pi&=3.14\ldots\\
&<\frac{22}{7}
\end{aligned}
```]

[```
\begin{align}
\pi&=3.14\ldots\\
&<\frac{22}{7}
\end{align}
```]

[```
\begin{alignat}{1}\pi&=3.14\ldots\\
&\approx\frac{22}{7}
\end{alignat}
```]

[```
\begin{gather}
\pi=3.14\ldots\\
\approx\frac{22}{7}
\end{gather}
```]

END_PGML

There is an observable (and desirable) difference in PDF output when the PTX source is structured this way. I can elaborate if anyone cares.

Copy link
Sponsor Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. As usual, you are the only one that really knows what is needed here.

@drgrice1 drgrice1 merged commit ea38a2d into openwebwork:PG-2.19 Aug 6, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants