-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Math Block: Use monospaced font for LaTeX input #72557
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
Conversation
Signed-off-by: ItsRoy69 <[email protected]>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @ItsRoy69! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Signed-off-by: ItsRoy69 <[email protected]>
Signed-off-by: ItsRoy69 <[email protected]>
ntsekouras
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides my comment, this looks good to me. Thank you!
Signed-off-by: ItsRoy69 <[email protected]>
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! If you are interested, you might be able to apply similar improvements not only to the Math "blocks" but also to the Math "formatting" as a separate PR.
gutenberg/packages/format-library/src/math/index.js
Lines 82 to 91 in efb328b
| <TextControl | |
| __nextHasNoMarginBottom | |
| __next40pxDefaultSize | |
| hideLabelFromVision | |
| label={ __( 'LaTeX math syntax' ) } | |
| value={ latex } | |
| onChange={ handleLatexChange } | |
| placeholder={ __( 'e.g., x^2, \\frac{a}{b}' ) } | |
| autoComplete="off" | |
| /> |
|
This pull request is an enhancement, but it's a very small change, and I believe it's worth backporting to 6.9. |
* Use monospaced font for LaTeX input Signed-off-by: ItsRoy69 <[email protected]> * fix the font declaration Signed-off-by: ItsRoy69 <[email protected]> * fix the font declaration Signed-off-by: ItsRoy69 <[email protected]> * fixed by removing selectors Signed-off-by: ItsRoy69 <[email protected]> --------- Co-authored-by: ItsRoy69 <[email protected]> Co-authored-by: ellatrix <[email protected]> Co-authored-by: ntsekouras <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: t-hamano <[email protected]>
|
I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: 287c60b |
What?
Adds a monospaced font to the LaTeX input field in the Math block.
Closes #72542
Why?
LaTeX syntax uses special characters, brackets, and precise spacing that are easier to read and edit in a monospaced font (similar to code editors). This improves the user experience when writing mathematical expressions.
How?
Added
style={ { fontFamily: 'monospace' } }prop to theTextareaControlcomponent in the Math block's edit component.Testing Instructions
\frac{a}{b},x^2 + y^2 = r^2) and confirm it's more readableChecklist