LaTeXSwiftUI icon indicating copy to clipboard operation
LaTeXSwiftUI copied to clipboard

Add support for inline parenthesis equations

Open annapo99 opened this issue 1 year ago • 0 comments

Add support for inline parenthesis equations

Description

This PR adds support for inline parenthesis equations using the (...) syntax. This is a commonly used LaTeX notation for inline equations and enhances our parser's compatibility with standard LaTeX documents.

Changes

Added a new ComponentType case: inlineLatexEquation Updated the Parser to recognize and properly handle (...) syntax Added corresponding unit tests for the new equation type

Motivation

LaTeX users often prefer (...) for inline equations over the older $...$ syntax. Adding support for this notation improves our parser's compatibility with modern LaTeX documents and provides users with more flexibility in equation formatting.

Testing

New unit tests have been added to cover various scenarios for inline parenthesis equations:

Basic usage

Usage within text Escaped parentheses Equations with leading/trailing whitespace and line breaks

All existing tests continue to pass, ensuring no regression in current functionality.

Additional Notes

This change is backwards compatible and does not affect the parsing of existing equation types. Documentation has been updated to reflect the new supported syntax.

Checklist

Code follows the project's coding standards Comments have been added where necessary Unit tests have been added/updated Documentation has been updated All tests pass locally

Please review and let me know if any further changes or information are needed.

annapo99 avatar Sep 24 '24 03:09 annapo99