diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 9b76834..1368f62 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -148,3 +148,4 @@ export default function Navbar() { + diff --git a/src/components/ResultPanel.tsx b/src/components/ResultPanel.tsx index 085a978..84c715d 100644 --- a/src/components/ResultPanel.tsx +++ b/src/components/ResultPanel.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { Download, Code2, Check, Copy } from 'lucide-react'; +import { Download, Code2 } from 'lucide-react'; import ReactMarkdown from 'react-markdown'; import remarkMath from 'remark-math'; import remarkBreaks from 'remark-breaks'; @@ -55,6 +55,13 @@ function preprocessLatex(content: string): string { processed = processed.replace(/\\right\s+\)/g, '\\right)'); + // Fix: \begin{matrix} with mismatched \left/\right -> use \begin{array} + // This is a more complex issue that requires proper \left/\right pairing + // For now, we'll try to convert problematic patterns + + // Replace \left( ... \right. text \right) pattern with ( ... \right. text ) + // This fixes the common mispairing issue + processed = processed.replace(/\\left\(([^)]*?)\\right\.\s*(\\text\{[^}]*\})\s*\\right\)/g, '($1\\right. $2)'); return processed; }