Skip to content

unicode bold for symbolic-sized matrices #935

Open
@cbm755

Description

@cbm755

New upstream sympy allows bold matrix symbols using bold unicode characters. Example:

>> syms a n 
>> A = sym('A', [n n])
A = (sym) 𝐀  (n×n matrix expression)

>> 2*a*A
ans = (sym) 2a⋅𝐀

This is off by default upstream. I'm not sure how well this is supported by fonts. But here's a possible patch if we wanted this:

--- a/inst/private/python_header.py
+++ b/inst/private/python_header.py
@@ -157,7 +157,7 @@ try:
             except:
                 # e.g., SymPy issue #10414
                 pretty_ascii = str(x)
-            pretty_unicode = sp.pretty(x, use_unicode=True)
+            pretty_unicode = sp.pretty(x, use_unicode=True, mat_symbol_style="bold")
             a = ET.SubElement(et, "item")
             f = ET.SubElement(a, "f")
             f.text = str(OCTCODE_SYM)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions