Enhance MarkdownText with LaTeX support#441
Draft
samrudha01codespace wants to merge 1 commit intogoogle-ai-edge:mainfrom
Draft
Enhance MarkdownText with LaTeX support#441samrudha01codespace wants to merge 1 commit intogoogle-ai-edge:mainfrom
samrudha01codespace wants to merge 1 commit intogoogle-ai-edge:mainfrom
Conversation
Refactor MarkdownText to support LaTeX expressions and improve structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request significantly enhances the
MarkdownTextcomposable inMarkdownText.ktby adding LaTeX math expression support and improving Markdown rendering. It introduces a helper for converting common LaTeX math to Unicode, processes inline math in Markdown, and adds previews and theming improvements. The changes also refactor imports and update styling for better integration with the app's theme.LaTeX and Math Rendering Enhancements:
convertLatexToUnicodehelper function to translate common LaTeX math expressions (Greek letters, operators, superscripts, subscripts, fractions) into Unicode equivalents. This enables basic math rendering within Markdown content.MarkdownTextcomposable to process and replace inline LaTeX expressions (e.g., `$...) with their Unicode representations before rendering.
MathExpressioncomposable for rendering block and inline math with appropriate styling, though only inline math is currently handled in the Markdown.UI and Theming Improvements:
OfflineLLMThemeand reorganized the file’s import structure for consistency with the rest of the app. [1] [2]Developer Experience:
MarkdownTextPreview,SimpleTutorialButton) to showcase Markdown with math examples and demonstrate the new features in the UI.Refactoring and Cleanup:
File Organization:
com.genzopia.offlineai.Designpackage and updated the package declaration accordingly.