Skip to content

Commit

Permalink
Added LaTeX support using MathJax
Browse files Browse the repository at this point in the history
  • Loading branch information
jukofyork committed Nov 11, 2024
1 parent 3ae8323 commit 3ef4a48
Show file tree
Hide file tree
Showing 111 changed files with 2,170 additions and 41 deletions.
17 changes: 17 additions & 0 deletions eclipse.plugin.aiassistant/css/main-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,20 @@ h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0;
}

/* MathJax styling */
.MathJax {
font-size: var(--default-font-size) !important;
color: var(--text-color) !important;
}

/* For block equations */
.MathJax_Display {
font-size: var(--default-font-size) !important;
color: var(--text-color) !important;
}

/* For SVG output mode */
.MathJax svg {
fill: var(--text-color) !important;
}
14 changes: 14 additions & 0 deletions eclipse.plugin.aiassistant/js/latex-renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function renderLatex() {
// Convert block latex tags
document.querySelectorAll('BLOCK_LATEX').forEach(elem => {
elem.outerHTML = '\\[' + elem.innerHTML + '\\]';
});

// Convert inline latex tags
document.querySelectorAll('INLINE_LATEX').forEach(elem => {
elem.outerHTML = '\\(' + elem.innerHTML + '\\)';
});

// Trigger MathJax rendering
MathJax.typeset();
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions eclipse.plugin.aiassistant/js/mathjax/es5/a11y/explorer.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions eclipse.plugin.aiassistant/js/mathjax/es5/a11y/sre.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions eclipse.plugin.aiassistant/js/mathjax/es5/core.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 3ef4a48

Please sign in to comment.