Skip to content

Commit

Permalink
Use phantom{-} in (up a b), where only one of a and b have a minus si…
Browse files Browse the repository at this point in the history
…gn and the lengths are similar
  • Loading branch information
soegaard committed Mar 4, 2024
1 parent 596d478 commit e1c95b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion racket-cas/format.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@
(parameterize ([output-wrapper values])
(define x (verbose~ u))
(define y (verbose~ v))
(when (and (= (string-length x) (+ (string-length y) 1))
(eqv? (string-ref x 0) #\-))
(set! y (~a "\\phantom{-}" y)))
(when (and (= (string-length y) (+ (string-length x) 1))
(eqv? (string-ref y 0) #\-))
(set! x (~a "\\phantom{-}" x)))
(if (output-brackets-for-up?)
(~a "\\begin{bmatrix} " x "\\\\" y "\\end{bmatrix}")
(~a "\\begin{pmatrix} " x "\\\\" y "\\end{pmatrix}"))))


;;; Intervals
(define (default-output-interval u)
(define v~ verbose~)
Expand Down

0 comments on commit e1c95b0

Please sign in to comment.