       (keep items layout/subgenres))))
 
 (defn- toc-entry
-  ([items path depth]
-   (toc-entry items path depth 1))
-  ([items path depth current-depth]
-   [:fo:block (-> {:text-align-last "justify" :role "TOCI"}
-                  (cond-> (> current-depth 1) (assoc :start-indent "1em")))
+  ([items path numbers depth]
+   (toc-entry items path numbers depth 1))
+  ([items path numbers depth current-depth]
+   [:fo:block {:text-align-last "justify" :role "TOCI"
+               :start-indent (str (- current-depth 1) "em")}
     [:fo:basic-link {:internal-destination (hash path)}
-     (inline {:role "Reference"} (layout/translations (last path)))
+     (inline {:role "Reference"} (section-numbers numbers) (layout/translations (last path)))
      " " [:fo:leader {:leader-pattern "dots" :role "NonStruct"}] " "
      [:fo:page-number-citation {:ref-id (hash path) :role "Reference"}]]
     (when (and (map? items) (< current-depth depth))
-      (map #(toc-entry (% items) (conj path %) depth (inc current-depth)) (order (keys items))))]))
+      (letfn [(numbered-toc [number itm]
+                (toc-entry (get items itm) (conj path itm)
+                           (add-number numbers number)
+                           depth (inc current-depth)))]
+        (map-indexed #(numbered-toc %1 %2) (order (keys items)))))]))
 
 (defn- add-extra-headings [entries editorial? recommendation-at-end? single-recommendation?]
   (let [recommendation (if single-recommendation? :recommendation :recommendations)]

(defn- set-marker [title]
  [:fo:block {:keep-with-next "always"}
   [:fo:marker {:marker-class-name running-header-class-name} title]])

(defn- order
  "Return `items` ordered. Checks first if `items` are either a subset


    (let [subitems (get items fmt)]
      [:fo:flow {:flow-name "xsl-region-body"}
       (toc (select-keys items [fmt]) [] 3
            :heading? true :editorial? true :recommendation-at-end? true :numbered? true)
       (block {:break-before "odd-page"}) ;; the very first format should start on recto
       (heading :h1 :editorial [:editorial] [1])
       (heading :h1 :hörbuch [:hörbuch] [2])
       (letfn [(numbered-genre [number genre]
                 (genre-sexp (get subitems genre) fmt genre 2 (add-number [2] number)))]
         (apply concat (map-indexed #(numbered-genre %1 %2) (order (keys subitems)))))
       (heading :h1 :recommendations [:recommendations] [3])])]])

(defmethod document-sexp :all-formats
  [items _ {:keys [description date]}]
