182 lines
3.4 KiB
Plaintext
182 lines
3.4 KiB
Plaintext
---
|
||
title: "Template Quarto"
|
||
subtitle: "pour mes documents"
|
||
document-type:
|
||
activite: true
|
||
format:
|
||
cours-pdf
|
||
---
|
||
|
||
# Introduction
|
||
|
||
Cette extension est un template pour mes documents de cours.\
|
||
Elle est basée sur ma classe $\LaTeX$ `latex-homework/jl-cours`.
|
||
|
||
Ce document est un exemple d'usage de ce template.
|
||
|
||
# Une section
|
||
|
||
\lipsum[1]
|
||
|
||
## Une sous-section
|
||
|
||
\lipsum[1]
|
||
|
||
### Une sous-sous-section
|
||
|
||
\lipsum[1]
|
||
|
||
# Tableaux avec ``tabularray``
|
||
|
||
\begin{center}
|
||
\begin{tblr}{
|
||
colspec={Q[red9,l]Q[c,capri,3cm]ccQ[green9,r]},
|
||
hlines, vlines
|
||
}
|
||
cell 1-1 & cell 1-2 & cell 1-3 & cell 1-4 & cell 1-5 \\
|
||
cell 2-1 & cell 2-2 & cell 2-3 & cell 2-4 & cell 2-5
|
||
\end{tblr}
|
||
\end{center}
|
||
|
||
# Besoin de sauter une page
|
||
|
||
:::{.center}
|
||
Blabla.
|
||
:::
|
||
|
||
# Test des couleurs
|
||
|
||
Test : \textcolor{crimsonglory}{Ce texte est en `crimsonglory`}. Ici en normal.
|
||
|
||
# Test des environnements
|
||
|
||
\begin{definition}[sous-titre]
|
||
Ceci est une définition.
|
||
\end{definition}
|
||
|
||
\begin{definition}*[\textcolor{amber}{sous-titre}]
|
||
Ceci est un définition.
|
||
\end{definition}
|
||
|
||
:::{.definition options="nouveau"}
|
||
Ceci est encore une définition.
|
||
:::
|
||
|
||
\begin{propriete}[sous-titre]
|
||
Ceci est une propriété.
|
||
\end{propriete}
|
||
|
||
\begin{propriete}*[\textcolor{brickred}{sous-titre}]
|
||
Ceci est un propriété.
|
||
\end{propriete}
|
||
|
||
\begin{theoreme}[sous-titre]
|
||
Ceci est une théorème.
|
||
\end{theoreme}
|
||
|
||
\begin{theoreme}*[\textcolor{columbiablue}{\textbf{sous-titre}}]
|
||
Ceci est un théorème.
|
||
\end{theoreme}
|
||
|
||
# Graphique
|
||
|
||
## NumPy
|
||
|
||
```{python}
|
||
import numpy as np
|
||
a = np.arange(15).reshape(3, 5)
|
||
a
|
||
```
|
||
|
||
## Matplotlib
|
||
|
||
```{python}
|
||
import matplotlib.pyplot as plt
|
||
|
||
fig = plt.figure()
|
||
x = np.arange(10)
|
||
y = 2.5 * np.sin(x / 20 * np.pi)
|
||
yerr = np.linspace(0.05, 0.2, 10)
|
||
|
||
plt.errorbar(x, y + 3, yerr=yerr, label='both limits (default)')
|
||
plt.errorbar(x, y + 2, yerr=yerr, uplims=True, label='uplims=True')
|
||
plt.errorbar(x, y + 1, yerr=yerr, uplims=True, lolims=True,
|
||
label='uplims=True, lolims=True')
|
||
|
||
upperlimits = [True, False] * 5
|
||
lowerlimits = [False, True] * 5
|
||
plt.errorbar(x, y, yerr=yerr, uplims=upperlimits, lolims=lowerlimits,
|
||
label='subsets of uplims and lolims')
|
||
|
||
plt.legend(loc='lower right')
|
||
plt.show(fig)
|
||
```
|
||
|
||
|
||
## Julia
|
||
|
||
Plot function pair (x(u), y(u)).
|
||
See @fig-parametric for an example.
|
||
|
||
```{julia}
|
||
#| label: fig-parametric
|
||
#| fig-cap: "Parametric Plots"
|
||
|
||
using Plots
|
||
|
||
plot(sin,
|
||
x->sin(2x),
|
||
0,
|
||
2π,
|
||
leg=false,
|
||
fill=(0,:lavender))
|
||
```
|
||
|
||
```{julia}
|
||
using Plots
|
||
# define the Lorenz attractor
|
||
Base.@kwdef mutable struct Lorenz
|
||
dt::Float64 = 0.02
|
||
σ::Float64 = 10
|
||
ρ::Float64 = 28
|
||
β::Float64 = 8/3
|
||
x::Float64 = 1
|
||
y::Float64 = 1
|
||
z::Float64 = 1
|
||
end
|
||
|
||
function step!(l::Lorenz)
|
||
dx = l.σ * (l.y - l.x)
|
||
dy = l.x * (l.ρ - l.z) - l.y
|
||
dz = l.x * l.y - l.β * l.z
|
||
l.x += l.dt * dx
|
||
l.y += l.dt * dy
|
||
l.z += l.dt * dz
|
||
end
|
||
|
||
attractor = Lorenz()
|
||
|
||
|
||
# initialize a 3D plot with 1 empty series
|
||
plt = plot3d(
|
||
1,
|
||
xlim = (-30, 30),
|
||
ylim = (-30, 30),
|
||
zlim = (0, 60),
|
||
title = "Lorenz Attractor",
|
||
legend = false,
|
||
marker = 2,
|
||
)
|
||
|
||
# build an animated gif by pushing new points to the plot, saving every 10th frame
|
||
@gif for i=1:1500
|
||
step!(attractor)
|
||
push!(plt, attractor.x, attractor.y, attractor.z)
|
||
end every 10
|
||
```
|
||
|
||
# More Information
|
||
|
||
You can learn more about controlling the appearance of PDF output here: <https://quarto.org/docs/output-formats/pdf-basics.html>
|
||
|