     ] |> to_lines
   end
   defp category_text(_round, %Appearance{}, %Performance{} = p) do
-    [[:span, "in der Wertung für "], [:i, category_name(p)]]
+    [[:span, "in der Wertung für "], [:i, category_name(p)], [:br]]
   end
 
   defp rating_points_text(0, _, _), do: "teilgenommen."

  end

  def certificates(performances, contest) do
    render_certificate_pages(performances, contest) |> generate_pdf("portrait")
  end

  # Private helpers

  defp generate_pdf(body_html, orientation) do
    html = Sneeze.render([:html,
      [:head, [:meta, %{charset: "UTF-8"}]],
      [:body,
        %{style: style(%{
          "font-family" => "LatoLatin",
          "font-size" => "18px",
          "line-height" => 1.3,
        })},
        body_html
      ]

      for group <- result_groups(p) do
        for a <- group do
          group_size = length(group)
          appearances_height = @line_height_factor * @certificate_font_size * group_size

          [:div, %{style: style(%{
              "padding-left" => "65px",
              "padding-right" => "65px",
              "padding-top" => "#{490 - appearances_height}px",
              "page-break-before" => "always",
            })},
            [:p,
              [:b, group |> Enum.map(&([:span, appearance_info(&1)])) |> to_lines],
            ],
            [:p, %{style: style(%{"margin-left" => "40px", "margin-top" => "50px"})},
              [
                [:span, contest_text(contest, group_size)],
                [:span, "für das instrumentale und vokale Musizieren der Jugend"],
                [:span, category_text(contest.round, a, p)],
                [:span, "in der Altersgruppe #{a.age_group}"],
                [:span, rating_points_text(contest.round, a.points, group_size)],
              ] |> to_lines
            ],
            [:p, %{style: style(%{"height" => "130px", "margin-top" => "50px"})},
              prize_text(contest.round, a)
            ],
            [:p, %{style: style(%{"height" => "70px"})}, date_text(contest)],
            [:p, signatures_text(contest.round)],
          ]
        end
