Skip to content

Commit e1c95b0

Browse files
committed
Use phantom{-} in (up a b), where only one of a and b have a minus sign and the lengths are similar
1 parent 596d478 commit e1c95b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

racket-cas/format.rkt

+6-1
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,16 @@
107107
(parameterize ([output-wrapper values])
108108
(define x (verbose~ u))
109109
(define y (verbose~ v))
110+
(when (and (= (string-length x) (+ (string-length y) 1))
111+
(eqv? (string-ref x 0) #\-))
112+
(set! y (~a "\\phantom{-}" y)))
113+
(when (and (= (string-length y) (+ (string-length x) 1))
114+
(eqv? (string-ref y 0) #\-))
115+
(set! x (~a "\\phantom{-}" x)))
110116
(if (output-brackets-for-up?)
111117
(~a "\\begin{bmatrix} " x "\\\\" y "\\end{bmatrix}")
112118
(~a "\\begin{pmatrix} " x "\\\\" y "\\end{pmatrix}"))))
113119

114-
115120
;;; Intervals
116121
(define (default-output-interval u)
117122
(define v~ verbose~)

0 commit comments

Comments
 (0)