basic scaffold

This commit is contained in:
2025-08-19 12:09:23 +02:00
parent 7282c6a6ec
commit 3f4fb35555
20 changed files with 1017 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
*.pdf
# but keep the pdfs in the "assets" folder
!assets/*

3
abstract.typ Normal file
View File

@@ -0,0 +1,3 @@
= Abstract
We present refinements to the BEoRN framework, a semi-numerical simulation suite that generates 21-cm maps of the cosmic dawn and the epoch of reionization. The refinements include a self-consistent treatment of the evolution of individual sources, which allows for a more accurate prediction of the 21-cm signal.
We validate the refined suite against ?? and quantify the gain in consistency resulting from the more accurate treatment of the sources.

4
acknowledgements.typ Normal file
View File

@@ -0,0 +1,4 @@
// = Acknowledgements
#heading(numbering: none, level: 1, outlined: false)[Acknowledgements]
We would like to thank Sambit Giri and Yu-Hsiu Huang for their valuable input and helpful discussions during the development of this code. Their expertise and insights have significantly contributed to the robustness and accuracy of the simulation suite.

2
appendix.typ Normal file
View File

@@ -0,0 +1,2 @@
#heading(numbering: none, level: 1)[Appendix]

BIN
assets/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

4
assets/eth-logo.svg Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="32">
<path d="M70.122 12h-6.931l2.434-12h-58.644l-6.194 31h23.379l1.59-8h-13.815l.79-4h13.824l1.403-7h-13.792l.788-4h21.952l-4.595 23h9.533l4.593-23h8.003l-4.593 23h9.606l2.377-12h6.929l-2.375 12h9.56l6.198-31h-9.586zm40.902-8h3.189l.79-4h-3.174zm8.179 0h3.191l.788-4h-3.174zm29.828 0h3.189l.792-4h-3.176zm15.963 5.908c-5.565 0-9.47 3.94-10.72 10.812a18.357 18.357 0 0 0-.3 3.26c0 4.694 2.833 7.612 7.401 7.612a9.713 9.713 0 0 0 7.009-2.962l.028-.03-1.769-2.168-.032-.038-.034.036a6.453 6.453 0 0 1-5.034 2.426c-2.177 0-4.504-1.306-4.504-4.962a16.14 16.14 0 0 1 .336-3.156 12.177 12.177 0 0 1 2.712-6.048 6.229 6.229 0 0 1 4.608-2.042 4.407 4.407 0 0 1 4.089 2.332l.026.042 2.252-1.912.032-.028-.024-.034a6.832 6.832 0 0 0-6.076-3.14zm20.354-.449a7.848 7.848 0 0 0-6.038 2.392l2.392-11.851h-3.084l-6.196 31h3.084l2.572-13.023c1.102-5.488 5.36-5.766 6.2-5.766a3.43 3.43 0 0 1 3.766 3.697 11.505 11.505 0 0 1-.216 1.968l-2.616 13.124h3.08l2.706-13.409a11.086 11.086 0 0 0 .216-2.115 5.629 5.629 0 0 0-5.866-6.017zm-41.577 21.49l-.01.052h3.041l4.15-21h-2.99zm-55.772-18.005l-.009.057h10.322l-13.609 15.465-.006.008-.511 2.527h14.657l.577-3h-10.957l13.649-15.465.006-.01.513-2.525h-14.062zm50.709-3.199a7.129 7.129 0 0 0-5.745 2.662l.472-2.359.008-.047h-3l-4.147 20.948-.008.052h3.045l2.536-12.85c.649-3.295 3.168-5.688 5.994-5.688a3.474 3.474 0 0 1 2.919 1.466l.03.038 2.469-2.224-.024-.03a5.652 5.652 0 0 0-4.549-1.968zm-18.369.256h3.084l-.008.05-4.144 20.95h-3.001l.01-.052.397-2.18a7.768 7.768 0 0 1-6.051 2.484 5.546 5.546 0 0 1-5.78-5.937 9.544 9.544 0 0 1 .217-1.899l.035-.19 2.622-13.226h3.043l-.01.05-2.577 12.898a11.772 11.772 0 0 0-.207 1.94 3.402 3.402 0 0 0 3.753 3.648c.825 0 4.989-.276 6.076-5.693z" style="fill:#00000f;fill-opacity:0.94117647"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<info>
<title>The Astrophysical Journal</title>
<id>http://www.zotero.org/styles/the-astrophysical-journal</id>
<link href="http://www.zotero.org/styles/the-astrophysical-journal" rel="self"/>
<link href="http://www.zotero.org/styles/nature" rel="template"/>
<link href="http://aas.org/journals/authors/common_instruct#references" rel="documentation"/>
<author>
<name>Chris Lowder</name>
<email>clowder@solar.physics.montana.edu</email>
</author>
<contributor>
<name>Sebastian Karcher</name>
</contributor>
<category citation-format="author-date"/>
<category field="science"/>
<issn>0004-637X</issn>
<eissn>1538-4357</eissn>
<updated>2012-12-12T13:57:00+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="author">
<names variable="author">
<name sort-separator=", " delimiter=", " and="symbol" initialize-with=". " delimiter-precedes-last="always" name-as-sort-order="all"/>
<substitute>
<names variable="editor"/>
<text variable="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" sort-separator=", " delimiter=", " and="symbol" initialize-with=". " name-as-sort-order="all"/>
<substitute>
<names variable="editor"/>
<text variable="title"/>
</substitute>
</names>
</macro>
<macro name="issuance">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="year-date">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="editor">
<choose>
<if type="chapter paper-conference" match="any">
<names variable="editor">
<label form="short" plural="never" suffix=" "/>
<name and="symbol" delimiter-precedes-last="always" initialize-with=". "/>
</names>
</if>
</choose>
</macro>
<macro name="container-title">
<choose>
<if type="article-journal">
<text variable="container-title" form="short" strip-periods="true"/>
</if>
<else>
<group delimiter=" ">
<choose>
<if type="chapter paper-conference" match="any">
<text term="in" form="long" plural="false"/>
</if>
</choose>
<text variable="container-title"/>
</group>
</else>
</choose>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition"/>
</else>
</choose>
</macro>
<macro name="volume">
<choose>
<if type="article-journal article-magazine" match="any">
<text variable="volume"/>
</if>
<else>
<group delimiter=" ">
<text term="volume" form="short" text-case="capitalize-first"/>
<text variable="volume"/>
</group>
</else>
</choose>
</macro>
<macro name="publisher">
<group prefix="(" suffix=")" delimiter="; ">
<text macro="edition"/>
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</group>
</macro>
<citation collapse="year" et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true">
<sort>
<key macro="author-short"/>
</sort>
<layout delimiter="; " prefix="(" suffix=")">
<group delimiter=", ">
<group delimiter=" ">
<text macro="author-short"/>
<text macro="year-date"/>
</group>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography et-al-min="6" et-al-use-first="3" entry-spacing="0">
<sort>
<key macro="author"/>
<key macro="issuance"/>
</sort>
<layout>
<group delimiter=", ">
<group delimiter=" ">
<text macro="author" suffix="."/>
<text macro="issuance"/>
</group>
<choose>
<if type="book report thesis" match="any">
<text variable="title"/>
</if>
</choose>
<text macro="container-title"/>
<text macro="editor"/>
<text macro="volume"/>
</group>
<text macro="publisher" prefix=" "/>
<text variable="page-first" prefix=", "/>
<text variable="URL" prefix=", "/>
</layout>
</bibliography>
</style>

141
assets/uzh-logo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 91 KiB

2
conclusion.typ Normal file
View File

@@ -0,0 +1,2 @@
= Conclusion
#lorem(900)

1
halo_mass_history.typ Normal file
View File

@@ -0,0 +1 @@
= Halo mass history

11
implementation.typ Normal file
View File

@@ -0,0 +1,11 @@
= Implementation of changes
This section describes the changes and improvements that were necessary to adapt the simulation suite in order to achieve the refined procedure. We distinguish between necessary changes that were required to reflect the underlying model and "beneficial" changes that only indirectly affect the quality of the simulation outputs.
== Necessary changes
Fundamental changes include:
-
== Secondary changes
Beorn was very opinionated in its assumptions and initial data. Since we intend it to create fast and reusable realisations we adapted the code to be more easily adjustable.

160
introduction.typ Normal file
View File

@@ -0,0 +1,160 @@
= Introduction
The earliest cosmological events (such as the formation of the first astrophysical objects - stars, galaxies, black holes...) have a profound influence on the evolution of the universe. Though poorly understood, these events have shaped the characteristics of our current uninverse, including the structure and distribution of matter itself.
// Citation about an overview paper on ionization vs structure formation.
Despite the milestones achieved in observational cosmology
// Citation about CMB measurements, JWST, etc.
, many aspects of the early universe and its dark ages remain difficult to probe. While traditional measurements provide insights into relatively recent epochs, and the cosmic microwave background (CMB) serves as an early snapshot of the universe, the dark ages are incompatible with direct observations. They represent the critical link between the late-time universe and the primordial conditions.
The dark ages of the universe refer to the period after recombination where the primordial atoms remain neutral. They are characterized by a total lack of sources of radiation (beyond the radiation background).
The dominant interactions during that period are either gravitational or due to the cooling of the primordial gas. The formation of the first stars, called population III stars
// Citation about Pop III stars and their role in the cosmic dawn.
, marks the beginning of the cosmic dawn and with it the process of reionization.
....
The large amounts of neutral hydrogen in the intergalactic medium (IGM) during the dark ages and cosmic dawn allow for an additional mode of observation: the 21-cm line emission. Due to the hyperfine transition of neutral hydrogen
// This period is crucial as it sets the stage for the subsequent evolution of the universe, including the formation of galaxies and large-scale structures.
Paragraph about the earliest cosmlogical events, leading up to the central importance of reionization.
Points to mention
- pop III stars and cosmic dawn
- wouthuysen
- cold reionization
Mention of recent observational advancements that highlight the relevance of larger + more precise simulations that capture the full dynamic range of the interactions.
Shortcomings of similar codes (as noted in beorn paper).
Assumptions made by beorn and what inaccuracies they introduce.
e.g. papers like "2309...." suggest a revised halo mass growth.
e.g. bursty star formation as presented by Romain Teyssier
Refer to the "halo model of reionization" 2302
The hyperfine transition of neutral hydrogen generates photons at
the wavelength of 21 cm, opening a new observational window into
the early Universe approximately one billion years after the Big
Bang. During this era, the radiation from the first stars and galaxies
pushes the spin temperature out of equilibrium before heating and
eventually ionising the neutral hydrogen of the intergalactic medium
(IGM). Next to the source properties, the 21-cm signal depends on
the clustering and temperature distribution of the neutral gas, the
primordial background radio emission, and the detailed interaction
processes between radiation and matter. It is therefore not surprising
that the 21-cm radiation from the cosmic dawn contains a wealth of
information about the properties of the first stars (Fialkov & Barkana
2014; Mirocha et al. 2018; Ventura et al. 2023; Sartorio et al. 2023),
galaxies (Park et al. 2019; Reis et al. 2020; Hutter et al. 2021), and
black holes (Pritchard & Furlanetto 2007; Ross et al. 2019). It can
furthermore be used to constrain the cosmological model (Liu &
Parsons 2016; Schneider et al. 2023; Shmueli et al. 2023) and, in
particular, the dark sector, such as the nature of dark matter (Sitwell
et al. 2014; Chatterjee et al. 2019; Nebrin et al. 2019; Muñoz et al.
2020; Jones et al. 2021; Giri & Schneider 2022; Hotinli et al. 2022;
Flitter & Kovetz 2022; Hibbard et al. 2022), interactions between
the dark and visible sector (Barkana et al. 2018; Fialkov et al. 2018;
Kovetz et al. 2018; Lopez-Honorez et al. 2019; Mosbech et al. 2023),
or potential exotic decay and annihilation processes (DAmico et al.
2018; Liu & Slatyer 2018; Mitridate & Podo 2018).
Reliable detection of the 21-cm signal at these redshifts has yet to
be achieved, but ongoing experiments, such as the Giant Metrewave
Radio Telescope (GMRT, Paciga et al. 2013), the Precision Array for
Probing the Epoch of Reionization (PAPER, Kolopanis et al. 2019),
the Murchison Widefield Array (MWA, Trott et al. 2020), the Low-
Frequency ARray (LOFAR, Mertens et al. 2020), and the Hydrogen
Epoch of Reionization Array (HERA, The HERA Collaboration et al.
2023) have provided upper limits on the 21-cm power spectrum for
a broad range of redshifts. These bounds have been used to exclude
regions of the parameter space describing extreme properties of the
IGM during the epoch of reionisation (Ghara et al. 2020, 2021; Greig
et al. 2021a,b; The HERA Collaboration et al. 2022a).
The Square Kilometre Array (SKA), a next-generation radio in-
terferometer, is currently under construction in South Africa and
Western Australia. Its low-frequency component, SKA-low, has the
capability to not only measure the 21-cm power spectrum with high
signal-to-noise ratio but also provide sky images at redshifts around2
T. Schaeffer et al.
𝑧 5 25 (e.g. Mellema et al. 2015; Wyithe et al. 2015; Ghara
et al. 2017; Giri et al. 2018a; Bianco et al. 2021b). The potential
of SKA-low for studying the cosmic dawn and reionization era has
been extensively investigated in various studies, exploring properties
of the ionizing sources and the ionization structure of the universe
(e.g. Giri et al. 2018b; Zackrisson et al. 2020; Giri & Mellema 2021;
Gazagnes et al. 2021; Bianco et al. 2023). These studies highlight
the significant role that SKA-low will play in advancing our under-
standing of these critical cosmic epochs.
Next to the tremendous experimental effort, accurate and reliable
theoretical methods to model the 21-cm signal at the required accu-
racy level are currently being developed. Modelling the 21-cm signal
is challenging as it involves a broad dynamical range from minihaloes
to cosmological scales. It depends on the details of hydrodynamical
feedback processes for galaxies, the propagation of radiation through
large cosmological scales, and the detailed interaction processes of
photons with gas particles of the IGM (e.g., Iliev et al. 2006; Mellema
et al. 2006b; Trac & Cen 2007).
One option is to predict the 21-cm signal with the help of coupled
radiative-transfer hydrodynamic simulations, some well-known ex-
amples being the Cosmic Dawn (CoDA) (Ocvirk et al. 2016; Ocvirk
et al. 2020; Lewis et al. 2022), the 21SSD (Semelin et al. 2017),
and the THESAN simulations (Kannan et al. 2022; Garaldi et al.
2022). Another option is to post-process N-body simulations with
ray-tracing algorithms, such as the Conservative, Causal Ray-tracing
code (C2 RAY; Mellema et al. 2006a) or the Cosmological Radiative
transfer Scheme for Hydrodynamics (CRASH; Maselli et al. 2003).
Full radiative-transfer numerical methods are fundamental to un-
derstanding the 21-cm signal and estimating the accuracy of more
approximate methods. However, they are very computationally ex-
pensive and can hardly be used to scan the vast cosmological and
astrophysical parameter space. To perform Bayesian inference anal-
ysis on a mock 21-cm data set, semi-numerical algorithms are often
used, better suited to generate thousands of realizations of the sig-
nal itself. They rely on the excursion set formalism (Furlanetto et al.
2004), such as 21cmFAST (Mesinger et al. 2011) or SIMFAST21 (San-
tos et al. 2010).
In this paper, we present the new framework BEoRN which stands
for Bubbles during the Epoch of Reionisation Numerical simulator.
The code is based on a one-dimensional radiative transfer method
in which interactions between matter and radiation are treated in a
spherically symmetric way around sources. This approach is signifi-
cantly faster than full 3-d radiative transfer codes and arguably more
precise than semi-numerical algorithms which are not based on indi-
vidual sources. In this aspect, BEoRN is similar to other existing codes
such as BEARS (Thomas et al. 2009) or GRIZZLY (Ghara et al. 2018).
However, in contrast to other 1d radiative transfer codes, BEoRN self-
consistently accounts for the evolution of individual sources during
the emission of photons. This includes both the redshifting of pho-
tons due to the expansion of space and the increase of luminosity
caused by the growth of individual sources over time. Both effects
have a non-negligible influence on the radiation profile surrounding
sources.
The BEoRN framework allows for a flexible parametrisation to
model any source of radiation, such as e.g. Pop-III stars, galaxies,
or quasars. It produces a 3-dimensional (3D) light-cone realisation
of the 21-cm signal from the cosmic dawn to the end of reionisation
including redshift space distortion effects. The underlying gas density
field as well as the position of sources is directly obtained from
outputs of an 𝑁-body simulation. We have designed BEoRN to be
user-friendly and modular so that it can be applied in combination
with different gravity solvers or source models, for example.
MNRAS 000, 118 (2023)
The paper is structured as follows: Section 2 describes the BEoRN
code, while section 3 validates it by comparing its predictions with
the publicly available 21cmFAST code. In section 4, three benchmark
models are presented, calibrated to the latest observations, and the
evolution of the 21-cm signal during the cosmic dawn and epoch
of reionization is studied. The work concludes with a summary and
conclusion in section 5.
Note that throughout the paper, physical distance units are specified
with the prefix "𝑝", while co-moving distance units are specified
with the prefix "𝑐". The cosmological parameters used in this work
are consistent with Planck 2018 results (Planck Collaboration et al.
2020), namely matter abundance Ωm = 0.31, baryon abundance
Ωb = 0.045, and dimensionless Hubble constant = 0.68. The
standard deviation of matter perturbations at 8 1 cMpc scale is
𝜎8 = 0.81.

56
main.typ Normal file
View File

@@ -0,0 +1,56 @@
#import "template/template.typ": *
#import "@preview/muchpdf:0.1.1": muchpdf
// Patch the ETH logo to actually be white:
#let logo = "assets/eth-logo.svg"
#let original = read(logo)
#let changed = original.replace(
"#00000f",
white.to-hex(),
)
#let logos = (
image(bytes(changed)),
image("assets/uzh-logo.svg")
)
#show: tasteful-thesis.with(
title: "Refinements of BEoRN",
subtitle: "Self-consistent semi-numerical simulation of the epoch of reionization",
authors: ("Rémy Moll",),
affiliation: "ETH Zürich, Universität Zürich",
abstract: include("abstract.typ"),
background-color: color.rgb(32, 64, 123),
logos: logos,
background-image: image("assets/background.png"),
date: datetime.today().display("[day]. [month repr:long] [year]"),
font: "FreeSans",
pre_content: muchpdf(read("assets/declaration-originality.pdf", encoding: none)),
)
//
// Content
//
Stars form early #cite(<10.1093>, form: "normal") but @10.1093 state that they are bright.
#include "introduction.typ"
#include "procedure.typ"
#include "halo_mass_history.typ"
#include "implementation.typ"
#include "validation.typ"
// Maybe no validation?
#include "results.typ"
#include "outlook.typ"
#include "conclusion.typ"
#include "acknowledgements.typ"
#bibliography("references.bib", style: "assets/the-astrophysical-journal.csl")
#include "appendix.typ"

1
outlook.typ Normal file
View File

@@ -0,0 +1 @@
= Outlook

6
procedure.typ Normal file
View File

@@ -0,0 +1,6 @@
= Overview of the BEoRN simulation procedure
This section describes the full procedure for a single simulation run of the BEoRN simulation suite, as well as the necessary adaptations to reflect the refined underlying model.
== Simulation steps
The code of BEoRN as well as a comprehensive documentation are publicly available under #link("https://github.com/cosmic-reionization/BEoRN", "https://github.com/cosmic-reionization/BEoRN").

61
references.bib Normal file
View File

@@ -0,0 +1,61 @@
@article{10.1093,
author = {Mirocha, Jordan and Furlanetto, Steven R},
title = {Balancing the efficiency and stochasticity of star formation with dust extinction in z ≳ 10 galaxies observed by JWST},
journal = {Monthly Notices of the Royal Astronomical Society},
volume = {519},
number = {1},
pages = {843-853},
year = {2022},
month = {12},
abstract = {Early observations with JWST indicate an overabundance of bright galaxies at redshifts z ≳ 10 relative to Hubble-calibrated model predictions. More puzzling still is the apparent lack of evolution in the abundance of such objects between z 9 and the highest redshifts yet probed, z 1317. In this study, we first show that, despite a poor match with JWST luminosity functions (LFs), semi-empirical models calibrated to rest-ultraviolet LFs and colours at 4 ≲ z ≲ 8 are largely consistent with constraints on the properties of individual JWST galaxies, including their stellar masses, ages, and spectral slopes. We then show that order-of-magnitude scatter in the star formation rate of galaxies (at fixed halo mass) can indeed boost the abundance of bright galaxies, provided that star formation is more efficient than expected in low-mass haloes. However, this solution to the abundance problem introduces tension elsewhere: because it relies on the upscattering of low-mass haloes into bright magnitude bins, one expects typical ages, masses, and spectral slopes to be much lower than constraints from galaxies observed thus far. This tension can be alleviated by non-negligible reddening, suggesting that if the first batch of photometrically selected candidates are confirmed star formation and dust production could be more efficient than expected in galaxies at z ≳ 10.},
issn = {0035-8711},
doi = {10.1093/mnras/stac3578},
url = {https://doi.org/10.1093/mnras/stac3578},
eprint = {https://academic.oup.com/mnras/article-pdf/519/1/843/48343456/stac3578.pdf},
}
@article{Kannan_2021,
title={Introducing the <scp>thesan</scp> project: radiation-magnetohydrodynamic simulations of the epoch of reionization},
volume={511},
ISSN={1365-2966},
url={http://dx.doi.org/10.1093/mnras/stab3710},
DOI={10.1093/mnras/stab3710},
number={3},
journal={Monthly Notices of the Royal Astronomical Society},
publisher={Oxford University Press (OUP)},
author={Kannan, R and Garaldi, E and Smith, A and Pakmor, R and Springel, V and Vogelsberger, M and Hernquist, L},
year={2021},
month=dec, pages={40054030} }
@article{Garaldi_2022,
title={The<scp>thesan</scp>project: properties of the intergalactic medium and its connection to reionization-era galaxies},
volume={512},
ISSN={1365-2966},
url={http://dx.doi.org/10.1093/mnras/stac257},
DOI={10.1093/mnras/stac257},
number={4},
journal={Monthly Notices of the Royal Astronomical Society},
publisher={Oxford University Press (OUP)},
author={Garaldi, E and Kannan, R and Smith, A and Springel, V and Pakmor, R and Vogelsberger, M and Hernquist, L},
year={2022},
month=feb, pages={49094933} }
@article{Smith_2022,
title={The<scp>thesan</scp>project: Lyman-α emission and transmission during the Epoch of Reionization},
volume={512},
ISSN={1365-2966},
url={http://dx.doi.org/10.1093/mnras/stac713},
DOI={10.1093/mnras/stac713},
number={3},
journal={Monthly Notices of the Royal Astronomical Society},
publisher={Oxford University Press (OUP)},
author={Smith, A and Kannan, R and Garaldi, E and Vogelsberger, M and Pakmor, R and Springel, V and Hernquist, L},
year={2022},
month=mar, pages={32433265} }

0
results.typ Normal file
View File

409
template/template.typ Normal file
View File

@@ -0,0 +1,409 @@
/// An *opinionated* template for a longer report or thesis.
#let tasteful-thesis(
/// The main title of the document.
/// -> string
title: "",
/// An optional subtitle for the document.
/// -> string
subtitle: "",
/// The authors of the document.
/// -> array(string)
authors: (),
supervisors: (),
affiliation: none,
other: none,
abstract: none,
background-image: none,
date: datetime.today().display(),
background-color: color.blue,
logos: (),
font: "New Computer Modern",
alpha: 50%,
pre_content: none,
body,
) = {
//
// Global settings and style customization.
//
set document(author: authors, title: title, description: subtitle)
let font-color = color;
// Check if the background color is closer to black or white
let components = background-color.components()
// show the components for debugging
let luminance = float(0.299 * components.at(0) + 0.587 * components.at(1) + 0.114 * components.at(2))
if luminance > 0.5 {
font-color = color.black
} else {
font-color = color.white
}
//customize look of figure
// set figure.caption(separator: [ --- ], position: top)
//customize inline raw code
show raw.where(block: false) : it => h(0.5em) + box(fill: color.lighten(90%), outset: 0.2em, it) + h(0.5em)
// Set body font family.
set text(font: font, 12pt)
show heading: set text(font: font, fill: background-color)
// add space for heading
show heading.where(level:1): it => it + v(0.5em)
// Set link style
show link: it => underline(text(fill: background-color, it))
show ref: it => text(fill: background-color, it)
show ref.where(): it => text(fill: background-color, it)
//numbered list colored
set enum(indent: 1em, numbering: n => [#text(fill: background-color, numbering("1.", n))])
//unordered list colored
set list(indent: 1em, marker: n => [#text(fill: background-color, "•")])
set cite(
form: "prose"
)
// display of outline entries
show outline.entry: it => text(size: 12pt, weight: "regular",it)
//
// Title page
//
// Title page background
set page(
// the title page should not have any margin, this will be reset in the next page
margin: 0pt,
)
// set the image first so that it is the lowest layer
place(
bottom,
background-image
)
// Add a tiling of white squares over the background to simulate a grid
for i in range(0, 14) {
for j in range(0, 14) {
place(
bottom + right,
dx: -i * 3.55em + 0.1em,
dy: -j * 3.55em,
)[
#square(
size: 3.55em,
// fill: gradient.linear(
// color.white,
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// angle: 45deg,
// ),
fill: none,
stroke: (
paint: color.white,
thickness: 0.02em,
)
)
]
}
}
place(
top + left,
dx: -20em,
line(
angle: -10deg,
length: 200%,
stroke: (
paint: background-color.lighten(alpha),
thickness: 900pt,
),
),
)
place(
top + left,
dx: -20em,
line(
angle: -10deg,
length: 200%,
stroke: (
paint: background-color,
thickness: 800pt,
)
),
)
place(
bottom + right,
dx: 20em,
dy: 20em,
line(
angle: -10deg,
length: 200%,
stroke: (
paint: background-color.lighten(alpha),
thickness: 400pt,
)
),
)
place(
bottom + right,
dx: 20em,
dy: 20em,
line(
angle: -10deg,
length: 200%,
stroke: (
paint: background-color,
thickness: 300pt,
)
),
)
// add a few more tiles *above* the background image to simulate a grid structure
let draw_pairs = (
(0, 10),
// (1, 10),
// (2, 10),
(3, 10),
// (4, 10),
(5, 10),
(6, 10),
// (7, 10),
(8, 10),
// (9, 10),
(10, 10),
(11, 10),
// (12, 10),
(13, 10),
(0, 11),
(1, 11),
// (2, 11),
(3, 11),
// (4, 11),
(5, 11),
// (6, 11),
// (7, 11),
(8, 11),
// (9, 11),
(10, 11),
(11, 11),
// (12, 11),
(13, 11),
(0, 12),
// (1, 12),
// (2, 12),
(3, 12),
// (4, 12),
(5, 12),
// (6, 12),
// (7, 12),
// (8, 12),
(9, 12),
// (10, 12),
// (11, 12),
// (12, 12),
// (13, 12),
// (0, 13),
(1, 13),
// (2, 13),
(3, 13),
// (4, 13),
// (5, 13),
// (6, 13),
(7, 13),
// (8, 13),
// (9, 13),
// (10, 13),
// (11, 13),
(12, 13),
// (13, 13),
// (0, 14),
// (1, 14),
// (2, 14),
// (3, 14),
(4, 14),
// (5, 14),
// (6, 14),
// (7, 14),
// (8, 14),
// (9, 14),
(10, 14),
// (11, 14),
// (12, 14),
(13, 14),
)
for (i, j) in draw_pairs {
place(
bottom + right,
dx: -i * 3.55em + 0.1em,
dy: -j * 3.55em,
)[
#square(
size: 3.55em,
// fill: gradient.linear(
// color.white,
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// angle: 45deg,
// ),
fill: none,
stroke: (
paint: color.white,
thickness: 0.02em,
)
)
]
}
// Title page content
pad(
x: 4em,
y: 4em,
)[
#align(center, text(font: font, 3em, weight: 700, title, fill: font-color))
#v(2em, weak: true)
#if subtitle != none {
align(center, text(font: font, 2em, weight: 600, subtitle, fill: font-color))
}
#v(2em, weak: true)
#align(
center,
text(font: font, 1em, authors.join(", "), fill: font-color)
)
]
let padded_logos = logos.map(logo => pad(x: 0.2cm, logo))
place(bottom + right, dy: -2em, dx: -2em)[
#set text(font: font, fill: font-color, size: 1.2em)
#set image(height: 0.8cm, width: auto)
#date
#stack(
dir: ltr,
// text(font: font, 1em, affiliation, fill: font-color),
..padded_logos
)
]
if pre_content != none {
pagebreak()
place(
top + left,
// dx: 2em,
// dy: 2em,
)[
#pre_content
]
}
pagebreak()
let footer = grid(
rows: auto,
v(0mm),
line(length: 100%, stroke: (paint: background-color, thickness: 1pt)),
v(2.5mm),
text(
)[
#title
#h(1fr)
#context [
#text(counter(page).display())
]
// context needed for page counter for typst >= 0.11.0
]
)
set page(
// no header
footer: footer,
margin: 4em,
)
//
// Table of contents.
//
abstract
v(2em)
outline()
pagebreak()
//
// Main body.
//
set heading(numbering: "1.")
set par(justify: true)
body
}
// let footer = grid(
// rows: auto,
// v(0mm),
// line(length: 100%, stroke: 0.6pt), // should be 1.6pt according to guidelines
// v(2.5mm),
// text(
// font: "Roboto",
// stretch: 100%,
// fallback: false,
// weight: "regular",
// size: 10pt
// )[
// #set align(right)
// // context needed for page counter for typst >= 0.11.0
// #context [
// #let counter_disp = counter(page).display()
// //#hide(counter_disp)
// //#counter_disp
// #context {
// let after_table_of_contents = query(selector(<__after_table_of_contents>).before(here())).len() >= 1
// if after_table_of_contents {counter_disp}
// else {hide(counter_disp)}
// }
// ]
// ]
// )

1
validation.typ Normal file
View File

@@ -0,0 +1 @@
= Validation