Then I added a check to see if a cover image is set and create a figure accordingly
if cover_image != none{
figure(image(cover_image, height: cover_image_height), caption: cover_image_caption)
}
To position the image correctly, I had to add the following before the cover_image check
v(10fr, weak: true)
To add the image, you have to add the wanted cover_image file name, cover_image_height and cover_image_caption to the project's variable inside the report.typ file
#show: project.with(
title: "Rapport de projet ISC",
course_name: "101.1 Programmation impérative",
title_block: "Semestre automne 2023\nCours du Prof. P.-A. Mudry",
cover_image: "cover_image_placeholder.png",
cover_image_height: 10cm, // Default value = 10cm
cover_image_caption: "Cover image caption", // Default value = "Cover image caption"
sub_title: "Avec un joli sous-titre",
authors: (
"P.-A. Mudry",
"Louis Lettry",
"Pamela Delgado"
),
logo: "isc_logo.svg",
date: "5 décembre 2023",
language: "fr", // Or en if required
version: "1.0.0",
)
I added a default cover image (tempalte/cover_image_placeholder.png)
First I had to initialize the values inside the template/isc_template_report.typ file
The cover_image_height is set to 10 by default and the default caption is "Cover image caption"
Then I added a check to see if a cover image is set and create a figure accordingly
To position the image correctly, I had to add the following before the cover_image check
To add the image, you have to add the wanted cover_image file name, cover_image_height and cover_image_caption to the project's variable inside the report.typ file
The final result looks like this :