Skip to content

Commit

Permalink
Literally embed Form when pretty-printing to a rich-text stream
Browse files Browse the repository at this point in the history
This commits lays the ground for implementing Notarfrancesco-style
pretty-printing of multiline mathematical objects
  • Loading branch information
shingarov committed Oct 15, 2023
1 parent d9c6186 commit 93fcd70
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions MachineArithmetic-MathNotation-Pharo/Form.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Extension { #name : #Form }

{ #category : #'*MachineArithmetic-MathNotation-Pharo' }
Form >> printOn: aStream [
aStream collectionSpecies = Text ifTrue: [
aStream
withAttribute: (TextAnchor new anchoredMorph: self)
do: [ aStream nextPutAll: (String value: 1) ].
^self ].
aStream
nextPutAll: self class name;
nextPut: $(; print: width;
nextPut: $x; print: height;
nextPut: $x; print: depth;
nextPut: $).
]

0 comments on commit 93fcd70

Please sign in to comment.