Opened 6 years ago
Last modified 5 years ago
#14509 new defect
Fix LaTeX of free algebras (and repr_lincomb)
Reported by:  kcrisman  Owned by:  was 

Priority:  minor  Milestone:  sage6.4 
Component:  user interface  Keywords:  latex 
Cc:  Merged in:  
Authors:  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  Commit:  
Dependencies:  Stopgaps: 
Description
sage: K.< alpha,b > = FreeAlgebra(SR) sage: latex(alpha*b) \alphab
Someone we are not using repr_lincomb
correctly, and in fact that function itself looks pretty hackishly defined. I couldn't even find a very good workaround.
Change History (6)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
In fact, what will break if we simply add a space after every such comman variable name?

sage/misc/latex.py
a b 2503 2503 '\\alpha' 2504 2504 """ 2505 2505 if a in common_varnames: 2506 return "\\" + a 2506 return "\\" + a + " " 2507 2507 elif len(a) == 1: 2508 2508 return a 2509 2509 elif is_fname is True:
Visually, and in latex, this is probably the simplest fix.
Edit: Ok. Visually, this breaks subscripts and superscripts although the latex is fine.
comment:3 Changed 6 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:4 Changed 6 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:5 Changed 5 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:6 Changed 5 years ago by
 Milestone changed from sage6.3 to sage6.4
Note: See
TracTickets for help on using
tickets.
sage/misc/latex.py
This fixes the latex, but the raw latex doesn't look good any more.