Skip to content

Conversation

@alifa98
Copy link
Contributor

@alifa98 alifa98 commented Sep 12, 2025

This PR fixes an issue where long MathJax formulas in blog posts overflowed horizontally and broke the layout.

  • Added a small CSS rule to make MathJax formulas horizontally scrollable instead of overflowing.
  • Now, when a formula is wider than the container, users can scroll horizontally without the page layout getting messed up.

SCSS changes:

mjx-container[jax="CHTML"][display="true"] {
  overflow-x: auto;
}

Testing:
Verified that:

  • Long formulas no longer push the layout wider than the viewport.
  • Short formulas render as before.

Before:
https://github.com/user-attachments/assets/521b4967-cc1e-4e8b-b2fc-2c59314a8dee

After code fix:
https://github.com/user-attachments/assets/698811ff-d418-43eb-9261-5073105a3d9f

Live demo at: PI Day -- bellards formula; open with responsive design mode or with a mobile device.

@netlify
Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for relaxed-lollipop-b6bc17 ready!

Name Link
🔨 Latest commit 250252a
🔍 Latest deploy log https://app.netlify.com/projects/relaxed-lollipop-b6bc17/deploys/68c468ccfd58fb0008ef9c5c
😎 Deploy Preview https://deploy-preview-3302--relaxed-lollipop-b6bc17.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@stale
Copy link

stale bot commented Nov 12, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 12, 2025
@stale stale bot removed the wontfix label Nov 17, 2025
@george-gca
Copy link
Collaborator

Thanks for the fix.

@george-gca george-gca merged commit fa93875 into alshedivat:main Nov 17, 2025
4 checks passed
Tzxtoiny pushed a commit to Tzxtoiny/Tzxtoiny.github.io that referenced this pull request Nov 20, 2025
…ens view. (alshedivat#3302)

This PR fixes an issue where long MathJax formulas in blog posts
overflowed horizontally and broke the layout.

* Added a small CSS rule to make MathJax formulas horizontally
scrollable instead of overflowing.
* Now, when a formula is wider than the container, users can scroll
horizontally without the page layout getting messed up.

**SCSS changes:**

```scss
mjx-container[jax="CHTML"][display="true"] {
  overflow-x: auto;
}
```

**Testing:**
Verified that:

* Long formulas no longer push the layout wider than the viewport.
* Short formulas render as before.



Before:

https://github.com/user-attachments/assets/521b4967-cc1e-4e8b-b2fc-2c59314a8dee

After code fix:

https://github.com/user-attachments/assets/698811ff-d418-43eb-9261-5073105a3d9f


Live demo at: [PI Day -- bellards
formula](https://blog.faraji.info/math/Pi-day.html#bellards-formula-for-pi);
open with responsive design mode or with a mobile device.
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.

2 participants