Skip to content

[201_90] fix inner product symbol display in tab cycle popup#2939

Open
1sh-repalto wants to merge 1 commit intoMoganLab:mainfrom
1sh-repalto:1sh-repalto/201_90/fix-inner-product-symbol-in-tab-group
Open

[201_90] fix inner product symbol display in tab cycle popup#2939
1sh-repalto wants to merge 1 commit intoMoganLab:mainfrom
1sh-repalto:1sh-repalto/201_90/fix-inner-product-symbol-in-tab-group

Conversation

@1sh-repalto
Copy link
Contributor

Fixes #2926
Inner product symbol does not show on Tab cycling popup window

Summary

When cycling through math variants for the < key (which includes the inner product ⟨⟩ as the 7th variant), the popup window showed a broken/red symbol instead of the angle brackets.

Developer Document: devel/201_90.md

Issue Found

The math-bracket-open case in lambda-to-symbol was concatenating the left and right bracket symbols (e.g., "<langle><rangle>"). This produced a compound string that the widget-box rendering engine (using the roman font) could not render correctly, showing as a red broken symbol or --.

Changes

In TeXmacs/progs/math/math-edit.scm:

Modified lambda-to-symbol to return only the left bracket symbol for math-bracket-open:

 ((math-bracket-open)
  (and (>= (length (cdr body)) 2)
       (string? (cadr body))
       (string? (caddr body))
       (let ((lb (cadr body))
             (rb (caddr body)))
         `(symbol-completion
-          ,(string-append lb rb)))))
+          ,lb))))

How to test

  1. Open Mogan Editor
  2. Enter math mode by pressing $
  3. Type <
  4. Press Tab repeatedly (7 times) to reach the inner product ⟨⟩ variant
  5. Verify that the popup window shows the left angle bracket clearly (instead of a broken red symbol or --)
  6. Press Tab once more to return to < and verify the cycle continues correctly
Screenshot 2026-03-05 145152

@JackYansongLi
Copy link
Contributor

Could you make it show $\langle \rangle$ instead of a single $\langle$

@wumoin
Copy link
Contributor

wumoin commented Mar 6, 2026

image The Tab cycling for the `[` symbol seems to have some issues.

@1sh-repalto
Copy link
Contributor Author

Hello @JackYansongLi and @wumoin ,
Thank you for your reviews. I noticed that these issues had already been fixed when I worked on #2910. I created the PR #2916 which fixed these tab cycling behaviors and it was merged. However, a later PR #2918 modified font_fn in src/Texmacs/Window/tm_button.cpp:

- font fn= smart_font (family, fn_class, series, shape, sz, dpi);
+ font fn= find_font (family, fn_class, series, shape, sz, dpi);

From my investigation, this change led to the unusual behaviour of the fixes I had done in my PR.
From my perspective, the best and minimal change would be to revert find_font back to smart_font. I also attempted to resolve the issue while keeping find_font, but I was unable to find a clean solution. Is there some good reason to let it stay as find_font and also possible to fix the issues at the same time ?

Let me know what you guys think on this.

I have tested both behaviours and am attaching them for reference:

  1. with smart_font
with_smart_font.mp4
  1. with find_font
with_find_font.mp4

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.

Inner product symbol does not show on Tab cycling popup window

3 participants