#set page(paper: "a4")

#show link: content => {
  set text(fill: blue)
  content
}

// Code formatting
#show raw.where(block: true): it => {
  set par(justify: false)
  let split = it.text.split("\n")
  let len = split.len()
  grid(
    columns: (100%, 100%),
    column-gutter: -100%,
    block(width: 100%, inset: 1em, for (i, line) in split.enumerate() {
      if i != len - 1 {
        box(width: 0pt, align(right, str(i + 1) + h(2em)))
        hide(line)
        linebreak()
      }
    }),
    block(radius: 1em, fill: luma(246), width: 100%, inset: 1em, it),
  )
}

#show heading: content => {
  content
  v(1em)
}

#show figure: content => {
  content
  v(1em)
}

// First page
#set page(background: image("assets/background.png", width: 100%))
#set text(fill: white)

#align(center + bottom)[
  #rect(width: 120%, fill: rgb(0, 0, 0))[
    #pad(5pt, text(weight: "bold", size: 20pt)[Dynamic Adaptive 3D Streaming over HTTP])
    #text(weight: "bold")[For the University of Toulouse PhD granted by the INP Toulouse]\
    #text(weight: "bold")[Presented and defended on Friday 29th November, 2019 by Thomas Forgione]

    *Gilles GESQUIÈRE*, president\
    *Sidonie CHRISTOPHE*, reviewer \
    *Gwendal SIMON*, reviewer\
    *Maarten WIJNANTS*, examiner\
    *Wei Tsang OOI*, examiner\
    *Vincent CHARVILLAT*, thesis supervisor\
    *Axel CARLIER*, thesis co-supervisor\
    *Géraldine MORIN*, thesis co-supervisor

    #set text(size: 10pt)

    #align(left, [*Doctoral school and field*: EDMITT: École Doctorale de Mathématiques, Informatiques et Télécommunications de
      Toulouse\
      *Field*: Computer science and telecommunication\
      *Research unit*: IRIT (5505)\
      *Thesis supervisors*: Vincent CHARVILLAT, Axel CARLIER and Géraldine MORIN\
      *Reviewers*: Sidonie CHRISTOPHE and Gwendal SIMON
    ])
  ]
]

#set text(fill: black)
#set par(first-line-indent: 1em, justify: true, leading: 1em)

// Abstracts
#pagebreak()
#set page(background: none)
#pagebreak()

#h(1em) *Titre :* Transmission Adaptative de Modèles 3D Massifs

*Résumé :*

#include "abstracts/fr.typ"

#pagebreak()
#pagebreak()
#set page(background: none)

#h(1em) *Title:* Dynamic Adaptive 3D Streaming over HTTP

*Abstract:*

#include "abstracts/en.typ"

// Acknowledgments
#pagebreak()
#include "acknowledgments.typ"

// Content of the thesis
#pagebreak()
#set heading(numbering: "1.1")
#include "introduction/main.typ"

#set heading(numbering: (..nums) =>
  counter("chapter").display() + "." + nums
    .pos()
    .map(str)
    .join(".")
)

#pagebreak()
#include "foreword/main.typ"
