Skip to content

[203_27] Fix LaTeX export for partially colored formulas using \textcolor#3038

Open
Prthmsh7 wants to merge 1 commit intoMoganLab:mainfrom
Prthmsh7:203_27
Open

[203_27] Fix LaTeX export for partially colored formulas using \textcolor#3038
Prthmsh7 wants to merge 1 commit intoMoganLab:mainfrom
Prthmsh7:203_27

Conversation

@Prthmsh7
Copy link
Contributor

Fix: #3035

What

Updated LaTeX export for colored expressions to use \textcolor and ensures xcolor is included when required.

Why

  • Replaces fragile \color usage with scoped \textcolor, preventing color leakage
  • Ensures correct behavior in both text and math mode
  • Fixes missing xcolor inclusion for HTML (hex) colors

After:
Screenshot 2026-03-25 at 5 35 17 PM

How

  • Updated tmtex-make-color in tmtex.scm to use \textcolor
  • Fixed HTML color handling in tmtex-decode-color
  • Aligned macro definitions in latex-define.scm with the new approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

公式添加前景色,使用部分颜色时,复制到 LaTeX 会出现错误

1 participant