Skip to content

Conversation

@moodyjmz
Copy link

@moodyjmz moodyjmz commented Nov 18, 2025

📝 Summary

This PR adds LaTeX math support to the text app.

it uses:

  • Inline typing $…$
  • Block typing $$…$$
  • Pasting of inline
  • Pasting of blocks
  • Editing of both - I did consider using the same approach as inline links, the bubble, but decided to use the modal approach for both
  • I added a feature into the menu to change existing content into maths - under the markup section

Code:

  • I used a factory for making math nodes to avoid duplicating code
  • It adds a modal, following the pattern of Image

Tests:
It adds some tests covering the features added, and issues I encountered while adding the feature

Limitations:

The existing modal doesn’t appear to be resizable - therefore here is set to largest

🖼️ Screenshots

🏚️ Before 🏡 After
image image
image image
image image

🚧 TODO

  • ...

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

@moodyjmz moodyjmz marked this pull request as draft November 18, 2025 15:12
@moodyjmz
Copy link
Author

I wanted to see if it would push the expected files - not ready for review yet

Signed-off-by: James Manuel <[email protected]>

feat(:tada:): Make clean branch to avoid pollution from build files in project

feat(:wrench:): Update package-lock to be inline with main

feat(:wrench:): Update package-lock to be inline with main
@moodyjmz moodyjmz force-pushed the feat/latex-math-clean branch from 9eaa0ee to 533af02 Compare November 18, 2025 16:50
@moodyjmz moodyjmz marked this pull request as ready for review November 18, 2025 16:54
@moodyjmz
Copy link
Author

@max-nextcloud Sorry about the confusion, hopefully this PR is better to check. It only has one commit as I took the files from the other branch.

@juliusknorr juliusknorr added enhancement New feature or request 3. to review labels Nov 18, 2025
@juliusknorr juliusknorr self-requested a review November 18, 2025 19:33

Nextcloud Text is the default text editor since Nextcloud 17. To start editing just open an existing markdown or plaintext file or create a new one.

### Mathematical formulas
Copy link
Member

Choose a reason for hiding this comment

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

So far we do not really have much end user documentation. I'd say we could keep it in here for now still. We probably want this to go to docs.nextcloud.com but just the math section might not be that useful.

@max-nextcloud @mejo- Something we could discuss further as you were thinking about enhancing documentation for collectives, but there may be some overlap with what we could make use of for text itself.

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 58.65385% with 43 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/nodes/MathematicsView.vue 3.84% 20 Missing and 5 partials ⚠️
src/nodes/Mathematics.js 82.35% 11 Missing and 1 partial ⚠️
src/components/Math/ShowMathModal.vue 20.00% 4 Missing ⚠️
src/components/Menu/entries.js 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Very nice, I left one inline comment and there are two CI checks that need some more work to pass.

When testing the modal seems to have an issue with not taking up the full height of the textarea, but I'm unsure if that is a component issue or could be addressed here as well. Would be fine to track as a follow up for polishing:

Screenshot 2025-11-18 at 20 54 36

@juliusknorr
Copy link
Member

Also cc @marcoambrosini for a design review

@moodyjmz moodyjmz force-pushed the feat/latex-math-clean branch from 0d8e038 to 8d381b5 Compare November 18, 2025 19:59
@moodyjmz
Copy link
Author

Very nice, I left one inline comment and there are two CI checks that need some more work to pass.

When testing the modal seems to have an issue with not taking up the full height of the textarea, but I'm unsure if that is a component issue or could be addressed here as well. Would be fine to track as a follow up for polishing:

Screenshot 2025-11-18 at 20 54 36

Thanks :)

I addressed those issues.

Yes, the modal, I was unsure what caused it, but felt it was out of scope to address in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Latex Math commands

2 participants