diff --git a/layouts/partials/paige/figure.html b/layouts/partials/paige/figure.html
index c528563a..156ddcb5 100644
--- a/layouts/partials/paige/figure.html
+++ b/layouts/partials/paige/figure.html
@@ -12,14 +12,17 @@
{{ $vertical := .vertical | default "center" }}
{{ $width := .width }}
+{{ $heightish := or $maxheight $height }}
+{{ $showcaption := $caption }}
+{{ $sidemargin := "" }}
+{{ $style := slice }}
{{ $table := false }}
+{{ $widthish := or $maxwidth $width }}
{{ if and $caption (or $compact $float) }}
{{ $table = true }}
{{ end }}
-{{ $style := slice }}
-
{{ if $height }}
{{ $style = $style | append (printf "height: %v" $height) }}
{{ end }}
@@ -38,8 +41,6 @@
{{ $style = delimit ($style | sort | uniq) "; " }}
-{{ $sidemargin := "" }}
-
{{ if $float }}
{{ if eq $float "start" }}
{{ $sidemargin = "me-4" }}
@@ -50,8 +51,6 @@
{{ end }}
{{ end }}
-{{ $showcaption := $caption }}
-
{{ if $caption }}
{{ if $number }}
{{ $caption = printf "%v %v: %v" (i18n "paige_figure") $number $caption }}