diff --git a/hybrid_calc_history.txt b/hybrid_calc_history.txt index cf02f25..9efcc89 100644 --- a/hybrid_calc_history.txt +++ b/hybrid_calc_history.txt @@ -1,12 +1,20 @@ x=t**2+5/m -t=? - m=3 x=4 - t=? - +solve(t) +form=solve(t) + + +ip=IP4(10.1.1.1,20) +ip.BroadcastAddress() + +# Test LATEX +$$Brix = \frac{Brix_{syrup} \cdot \delta_{syrup} + (Brix_{water} \cdot \delta_{water} \cdot Rateo)}{\delta_{syrup} + \delta_{water} \cdot Rateo}$$ +$$Brix = \frac{Solid_Weight}{Total_Weight}$$ +$$\delta = \frac{W}{V} \Rightarrow W = \delta \cdot V$$ +$$Brix_{Bev} = \frac{Brix_{syr} + Brix_{H_2O} \cdot R_M}{R_M + 1}$$ diff --git a/hybrid_calc_settings.json b/hybrid_calc_settings.json index 7af5413..a750eb2 100644 --- a/hybrid_calc_settings.json +++ b/hybrid_calc_settings.json @@ -1,15 +1,15 @@ { "window_geometry": { - "x": 732, - "y": 205, - "width": 741, + "x": 332, + "y": 170, + "width": 1353, "height": 700 }, "debug_mode": false, "latex_panel_visible": true, "sash_pos_x": 450, "splitter_sizes": [ - 210, - 155 + 357, + 472 ] } \ No newline at end of file diff --git a/main_calc_app_pyside6.py b/main_calc_app_pyside6.py index 12199dc..41c9867 100644 --- a/main_calc_app_pyside6.py +++ b/main_calc_app_pyside6.py @@ -116,8 +116,16 @@ class LatexPanel(QWidget): super().__init__(parent) self.equations = [] self._webview_available = False + self._mathjax_ready = False + self._pending_equations = [] + self._parent_calculator = parent self._setup_ui() + # Timer para verificar si MathJax está listo + self._mathjax_check_timer = QTimer() + self._mathjax_check_timer.timeout.connect(self._check_mathjax_ready) + self._mathjax_check_timer.start(500) # Verificar cada 500ms + def _setup_ui(self): """Configura la UI del panel""" layout = QVBoxLayout(self) @@ -212,8 +220,16 @@ class LatexPanel(QWidget): processEscapes: true }, chtml: { - scale: 1.1, + scale: 0.9, minScale: 0.5 + }, + startup: { + ready: function () { + MathJax.startup.defaultReady(); + // Notificar que MathJax está listo + window.mathJaxReady = true; + console.log('MathJax completamente cargado'); + } } }; @@ -223,19 +239,18 @@ class LatexPanel(QWidget): color: #d4d4d4; font-family: 'Segoe UI', Arial, sans-serif; margin: 0; - padding: 20px; - line-height: 1.6; + padding: 8px; + line-height: 1.2; } .equation-block { background: rgba(45, 45, 48, 0.8); - border-left: 4px solid; - margin: 12px 0; - padding: 15px 20px; - border-radius: 8px; - transition: all 0.2s ease; + border-left: 3px solid; + margin: 4px 0; + padding: 6px 12px; + border-radius: 4px; + transition: all 0.1s ease; } .equation-block:hover { - transform: translateY(-1px); background: rgba(45, 45, 48, 0.9); } .comment { border-left-color: #6a9955; } @@ -243,35 +258,49 @@ class LatexPanel(QWidget): .equation { border-left-color: #c586c0; } .symbolic { border-left-color: #9cdcfe; } - .equation-type { - font-size: 11px; - font-weight: bold; - text-transform: uppercase; - margin-bottom: 8px; - opacity: 0.8; + .math-content { + margin: 2px 0; + font-size: 14px; + } + + .comment-text { + font-style: italic; + color: #6a9955; + font-size: 12px; + margin: 0; } - .comment .equation-type { color: #6a9955; } - .assignment .equation-type { color: #dcdcaa; } - .equation .equation-type { color: #c586c0; } - .symbolic .equation-type { color: #9cdcfe; } .info-message { text-align: center; - padding: 40px 20px; - color: #888; - font-style: italic; + padding: 20px; + color: #666; + font-size: 12px; + } + + /* Reducir espaciado de MathJax */ + .MathJax { + font-size: 0.9em !important; + } + + mjx-math { + margin: 1px 0 !important; + } + + mjx-container { + margin: 2px 0 !important; }