Skip to content

[203_2827] support \bold command#2835

Merged
da-liii merged 1 commit intoMoganLab:mainfrom
Gitjay11:fix/latex-bold-support
Feb 22, 2026
Merged

[203_2827] support \bold command#2835
da-liii merged 1 commit intoMoganLab:mainfrom
Gitjay11:fix/latex-bold-support

Conversation

@Gitjay11
Copy link
Copy Markdown
Contributor

@Gitjay11 Gitjay11 commented Feb 22, 2026

2026/02/21 Support \bold command

What

Added support for the \bold command within the LaTeX plugin's import logic.

Why

To Fix issue #2827 @da-liii
The original LaTeX parser treated \bold as an undefined macro during import. This resulted in an unsupported red tag appearing in the Mogan editor.

How

  1. In TeXmacs/plugins/latex/progs/convert/latex/latex-command-drd.scm, registered bold in the latex-modifier-1% logic group so the parser recognizes it as a standard single-argument formatting macro.
  2. In TeXmacs/plugins/latex/progs/convert/latex/tmtex.scm, added a proxy translation rule inside post-process-math-text: ((func? t 'bold 1) (post-process-math-text (list 'mathbf (cadr t)))). This intercepts \bold and delegates it to \mathbf, ensuring that it inherits all necessary logic for properly rendering both text and math content into bold.

How to test

  1. Create a LaTeX file containing \bold{test}.
  2. Import the file into .tm format.
  3. Verify that the imported document correctly renders "test" in bold text, identical to how \mathbf{test} is normally handled, instead of showing a raw red \bold tag.

Copy link
Copy Markdown
Contributor

@da-liii da-liii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@da-liii da-liii merged commit a0024cf into MoganLab:main Feb 22, 2026
@da-liii da-liii added this to the v2026.2.1 milestone Feb 22, 2026
MoonL79 added a commit that referenced this pull request Feb 25, 2026
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.

2 participants