Skip to content

Commit 87c45b4

Browse files
Fixed bug in #toLatex
1 parent 0d6e4cb commit 87c45b4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/DataFrame/DataFrame.class.st

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,9 @@ DataFrame >> toLatex [
23552355

23562356
columnWidths := dataFrame columnNames collect: [ :columnName |
23572357
| maxWidth |
2358-
maxWidth := columnName size.
2358+
columnName isString
2359+
ifFalse: [ maxWidth := columnName asString size ]
2360+
ifTrue: [ maxWidth := columnName size ].
23592361
dataFrame rows do: [ :row |
23602362
| value |
23612363
value := row at: columnName.
@@ -2364,7 +2366,10 @@ DataFrame >> toLatex [
23642366

23652367
dataFrame columnNames withIndexDo: [ :columnName :index |
23662368
| paddedColumnName |
2367-
paddedColumnName := columnName padRightTo: (columnWidths at: index).
2369+
paddedColumnName := (columnName isString
2370+
ifFalse: [ columnName asString ]
2371+
ifTrue: [ columnName ]) padRightTo:
2372+
(columnWidths at: index).
23682373
index = dataFrame numberOfColumns
23692374
ifFalse: [ markdown nextPutAll: paddedColumnName , ' & ' ]
23702375
ifTrue: [ markdown nextPutAll: paddedColumnName ] ].

0 commit comments

Comments
 (0)