Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5474 closed enhancement (fixed)

[with patch, positive review] delimiters for LaTeX representation of matrices

Reported by: jhpalmieri Owned by: jhpalmieri
Priority: minor Milestone: sage-3.4
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

There was a request on sage-support for the option to change how matrices are displayed, from parentheses to square brackets. William made this suggestion:

How about adding a function to matrix0.pyx that sets a global variable
in that file to the left and right delimiters for matrices?

sage.matrix.matrix0.set_latex_delimiters('[',']')

would set them.  That's minimally intrusive.  Later on somebody could
come up with some grand scheme for customizing latex output, but
please don't until there are a few more use cases. 

The attached patch implements "set_matrix_latex_delimiters". (I changed the name slightly.)

Attachments (2)

matrix-latex-delimiters.patch (2.6 KB) - added by jhpalmieri 5 years ago.
vector-latex-delimiters.patch (2.7 KB) - added by jhpalmieri 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by jhpalmieri

Changed 5 years ago by jhpalmieri

comment:1 Changed 5 years ago by jhpalmieri

Here's a vector version, too.

comment:2 Changed 5 years ago by was

  • Summary changed from [with patch, needs review] delimiters for LaTeX representation of matrices to [with patch, positive review] delimiters for LaTeX representation of matrices

Frickin' awesome! NIce!

comment:3 Changed 5 years ago by mabshoff

  • Milestone changed from sage-3.4.1 to sage-3.4
  • Resolution set to fixed
  • Status changed from new to closed

Merged both patches in Sage 3.4.final.

Cheers,

Michael

comment:4 follow-up: Changed 5 years ago by jason

Thank you! This has been a minor annoyance when using Sage in class, since we use different delimiters than Sage...

comment:5 in reply to: ↑ 4 Changed 5 years ago by jhpalmieri

Replying to jason:

Thank you! This has been a minor annoyance when using Sage in class, since we use different delimiters than Sage...

You're welcome! I hope it works well for you.

Note: See TracTickets for help on using tickets.