Added course's notes

This commit is contained in:
MatsuneMikuroi committed 2026-09-25 13:33:30 +02:00
1 parent e07993262c
commit dcd2c072ae
191 files changed
+42866 -12

No files matched your search

@@ -0,0 +1,86 @@
/* exo — exercise cards, hint folds (sequential unlock), solution fold */
.exo {
margin: 1.2rem 0;
padding: 0.6rem 0.9rem;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 35%, transparent);
border-left: 3px solid var(--calc-notecolor, #B45309);
border-radius: 0.35rem;
scroll-margin-top: 5rem;
}
/* keep wide content inside the card: display math (and tables/code) scroll
on their own rather than spilling past the border. overflow-y stays hidden
so Firefox doesn't add a phantom vertical bar, as in .calc */
.exo mjx-container[display="true"],
.exo .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em; /* keep descenders clear of a horizontal bar */
/* a centred overflowing box clips its left side out of reach, so centre
only while the formula fits (browsers without `safe` keep plain centring) */
display: flex;
justify-content: center;
justify-content: safe center;
}
.exo .math.display { display: block; max-width: 100%; }
.exo :is(pre, table) { max-width: 100%; overflow-x: auto; }
.exo img, .exo svg { max-width: 100%; }
.exo-head p { margin: 0 0 0.4rem; }
.exo-head strong { color: var(--calc-notecolor, #B45309); }
.exo details {
margin: 0.45rem 0;
border-radius: 0.3rem;
}
.exo details > summary {
cursor: pointer;
list-style: none;
user-select: none;
font-size: 0.9em;
font-weight: 600;
}
.exo details > summary::-webkit-details-marker { display: none; }
.exo details > summary::before { content: "▸ "; }
.exo details[open] > summary::before { content: "▾ "; }
/* hints: small highlight boxes */
.exo-hint {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 6%, transparent);
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 30%, transparent);
padding: 0.25rem 0.6rem;
}
.exo-hint > summary { color: var(--calc-notecolor, #B45309); }
/* locked hints: unlock one by one */
.exo-hint.exo-locked > summary {
cursor: not-allowed;
opacity: 0.45;
}
.exo-hint.exo-locked > summary::before { content: "🔒 "; }
/* solution: closed by default, visually separated */
.exo-sol {
border-top: 1px dashed color-mix(in srgb, var(--calc-notecolor, #B45309) 40%, transparent);
padding: 0.35rem 0.1rem 0.1rem;
scroll-margin-top: 5rem;
}
/* in a numbered part, the fold lines up with the part's text */
.exo li > details { margin-left: 0; }
/* hand-in extracts (handin.sh, html output) */
.exo-handin-sol, .exo-handin-hint {
margin: 0.6rem 0;
padding: 0.2rem 0 0.2rem 0.8rem;
border-left: 2px solid var(--calc-notecolor, #B45309);
}
.exo-fold-body { margin-top: 0.3rem; }
.exo-fold-body > p:first-child { margin-top: 0; }
.exo-fold-body > p:last-child { margin-bottom: 0; }
@media print {
.exo details > summary::before { content: ""; }
.exo-hint.exo-locked > summary { opacity: 1; cursor: default; }
}
@@ -0,0 +1,39 @@
// exo — hints unlock one by one within a part; everything unfolds for printing
(function () {
// block opening a locked hint
document.addEventListener("click", function (e) {
var s = e.target.closest ? e.target.closest("details.exo-hint.exo-locked > summary") : null;
if (s) e.preventDefault();
});
// opening hint n of a part unlocks hint n+1 of the same part, wherever it
// sits in the exercise (toggle doesn't bubble: use capture)
document.addEventListener("toggle", function (e) {
var d = e.target;
if (!d.classList || !d.classList.contains("exo-hint") || !d.open) return;
var chain = d.getAttribute("data-exo-chain");
var n = parseInt(d.getAttribute("data-exo-hint"), 10);
if (!chain || isNaN(n)) return;
var hints = document.querySelectorAll("details.exo-hint[data-exo-chain]");
for (var i = 0; i < hints.length; i++) {
if (hints[i].getAttribute("data-exo-chain") === chain &&
parseInt(hints[i].getAttribute("data-exo-hint"), 10) === n + 1) {
hints[i].classList.remove("exo-locked");
}
}
}, true);
// print: open all hints/solutions, restore afterwards
window.addEventListener("beforeprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.dataset.exoWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll(".exo details").forEach(function (d) {
d.open = d.dataset.exoWasOpen === "1";
delete d.dataset.exoWasOpen;
});
});
})();
@@ -0,0 +1,77 @@
/* glossary — usages, entries, hover tooltip */
/* usages: dotted underline, keep math color */
a.gls-sym,
mjx-container a {
color: inherit;
text-decoration: none;
}
.gls-sym {
border-bottom: 1px dotted currentColor;
cursor: help;
}
/* rendered glossary list */
.glossary .gls-entry {
margin: 0.8rem 0;
padding: 0.35rem 0.7rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem; /* don't hide behind Quarto's sticky header */
}
.glossary .gls-entry p { margin: 0 0 0.2rem; }
.glossary .gls-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
/* floating hover tooltip (filled by glossary.js) */
.gls-float {
position: absolute;
z-index: 1000;
max-width: 26rem;
padding: 0.5rem 0.75rem;
border: 1px solid var(--calc-notecolor, #B45309);
border-radius: 0.4rem;
background: var(--bs-body-bg, #fff);
color: var(--bs-body-color, #1a1a1a);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
font-size: 0.9em;
line-height: 1.4;
}
.gls-float p { margin: 0 0 0.25rem; }
.gls-float p:last-child { margin-bottom: 0; }
/* in-place definition cards and property sub-entries */
.gls-inline {
margin: 1rem 0;
padding: 0.4rem 0.8rem;
border-left: 3px solid var(--calc-notecolor, #B45309);
scroll-margin-top: 5rem;
}
.gls-inline p { margin: 0 0 0.3rem; }
.gls-inline:target,
.gls-prop-entry:target {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
border-radius: 0.25rem;
}
.gls-prop-entry {
margin: 0.5rem 0 0.5rem 1.2rem;
padding: 0.25rem 0.6rem;
border-left: 2px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
font-size: 0.95em;
scroll-margin-top: 5rem;
}
.gls-back {
font-size: 0.85em;
opacity: 0.75;
}
/* standalone property cards keep the section flow (no indent) */
.gls-prop-entry.gls-standalone {
margin-left: 0;
font-size: 1em;
}
.glossary .gls-prop-line {
margin: 0.1rem 0 0.1rem 1.2rem;
font-size: 0.9em;
}
@@ -0,0 +1,68 @@
// glossary — hover tooltip for .gls-sym usages (prose links and MathJax \class nodes)
(function () {
var tip = null;
function ensureTip() {
if (tip === null) {
tip = document.createElement("div");
tip.className = "gls-float";
tip.style.display = "none";
document.body.appendChild(tip);
}
return tip;
}
function keyOf(el) {
if (el.dataset && el.dataset.glsKey) return el.dataset.glsKey;
for (var i = 0; i < el.classList.length; i++) {
var c = el.classList[i];
if (c.indexOf("gls-key-") === 0) return c.slice(8);
}
return null;
}
function show(target) {
var key = keyOf(target);
if (!key) return;
var entry = document.getElementById("gls-" + key);
var t = ensureTip();
if (entry) {
// for a main entry, don't drag every property into the popup
var node = entry.cloneNode(true);
node.querySelectorAll(".gls-prop-entry").forEach(function (n) { n.remove(); });
t.innerHTML = node.innerHTML;
} else if (window.__glsData && window.__glsData[key]) {
// entry lives on another page (book chapters render separately)
t.innerHTML = window.__glsData[key];
} else {
return;
}
t.style.display = "block";
if (window.MathJax && window.MathJax.typesetPromise) {
window.MathJax.typesetPromise([t]).catch(function () {});
}
var r = target.getBoundingClientRect();
var x = r.left + window.scrollX;
var y = r.bottom + window.scrollY + 6;
// keep it on screen horizontally
var w = t.offsetWidth;
var maxX = window.scrollX + document.documentElement.clientWidth - w - 12;
t.style.left = Math.max(window.scrollX + 8, Math.min(x, maxX)) + "px";
t.style.top = y + "px";
}
function hide() {
if (tip !== null) tip.style.display = "none";
}
document.addEventListener("mouseover", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) show(el);
});
document.addEventListener("mouseout", function (e) {
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
if (el) hide();
});
document.addEventListener("click", hide);
window.addEventListener("scroll", hide, { passive: true });
})();
@@ -0,0 +1,45 @@
/* latex-tables — HTML rendering of LaTeX tabular environments */
.ltx-table {
border-collapse: collapse;
margin: 1rem auto;
max-width: 100%;
overflow-x: auto;
display: table;
}
.ltx-table th,
.ltx-table td {
padding: 0.35em 0.7em;
vertical-align: top;
line-height: 1.4;
}
.ltx-table th {
font-weight: 600;
}
/* alignment */
.ltx-l { text-align: left; }
.ltx-c { text-align: center; }
.ltx-r { text-align: right; }
/* vertical rules (from | in the column spec) */
.ltx-bl { border-left: 1px solid currentColor; }
.ltx-br { border-right: 1px solid currentColor; }
/* horizontal rules: t = above the row, b = below.
1 = \hline / \midrule / \cline, 2 = booktabs \toprule / \bottomrule,
d = doubled rule (\hline\hline) */
.ltx-t1 { border-top: 1px solid currentColor; }
.ltx-b1 { border-bottom: 1px solid currentColor; }
.ltx-t2 { border-top: 1.6px solid currentColor; }
.ltx-b2 { border-bottom: 1.6px solid currentColor; }
.ltx-td { border-top: 3px double currentColor; }
.ltx-bd { border-bottom: 3px double currentColor; }
/* keep wide tables usable on narrow screens */
@media (max-width: 700px) {
.ltx-table { font-size: 0.9em; }
.ltx-table th, .ltx-table td { padding: 0.25em 0.45em; }
}
@@ -0,0 +1,100 @@
/* calc-notes — HTML layout for the calc / calc* environments */
.calc {
display: grid;
/* lhs | rhs | notes | equation number */
grid-template-columns: max-content max-content minmax(8rem, 1fr) auto;
column-gap: 0.35rem;
row-gap: 0.6rem;
align-items: baseline;
margin: 1rem 0 1.4rem;
/* allow horizontal scrolling for very wide equations, but never show a
vertical bar (Firefox computes phantom vertical overflow otherwise) */
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.4em; /* keep descenders clear of a horizontal bar */
}
.calc-row { display: contents; }
.calc-lhs { grid-column: 1; justify-self: end; }
.calc-rhs { grid-column: 2; justify-self: start; }
.calc-full { grid-column: 1 / 3; justify-self: start; }
/* ---- notes ------------------------------------------------------- */
.calc-notes {
grid-column: 3;
display: flex;
flex-wrap: wrap;
gap: 0.35rem 0.75rem;
align-items: baseline;
min-width: 0;
padding-left: 0.9rem;
}
.calc-note {
color: var(--calc-notecolor, #B45309);
font-size: 0.85em;
line-height: 1.35;
}
.calc-note > summary {
cursor: pointer;
list-style: none; /* remove the default triangle ... */
user-select: none;
opacity: 0.7;
font-style: italic;
}
.calc-note > summary::-webkit-details-marker { display: none; }
.calc-note > summary::before { content: "▸ "; font-style: normal; }
.calc-note[open] > summary::before { content: "▾ "; }
.calc-note > summary:hover { opacity: 1; }
.calc-note[open] {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 8%, transparent);
border-left: 2px solid var(--calc-notecolor, #B45309);
border-radius: 0.25rem;
padding: 0.15rem 0.45rem;
}
.calc-note-body { margin-top: 0.1rem; }
.calc-note-body p { margin: 0; }
/* \mnote: math note (no extra styling needed — body is typeset math) */
.calc-note-math .calc-note-body { padding: 0.1rem 0; }
/* ---- calc*: boxed final result ----------------------------------- */
.calc-box {
display: inline-block;
border: 1.5px solid currentColor;
border-radius: 0.3em;
padding: 0.3em 0.65em;
margin-top: 0.15em;
background: color-mix(in srgb, currentColor 4%, transparent);
}
/* ---- labelled blocks: equation number on the last line ----------- */
.calc-tag {
grid-column: 4;
justify-self: end;
padding-left: 1rem;
white-space: nowrap;
}
/* ---- printing: show notes unfolded, like the PDF ------------------ */
@media print {
.calc-note > summary { display: none; }
.calc-note[open] { background: none; border: none; padding: 0; }
}
/* small screens: notes drop under the equation line */
@media (max-width: 560px) {
.calc { grid-template-columns: max-content 1fr; }
.calc-notes { grid-column: 1 / 3; padding-left: 1.5rem; }
.calc-full { grid-column: 1 / 3; }
.calc-tag { grid-column: 1 / -1; }
}
@@ -0,0 +1,15 @@
// calc-notes — open every note before printing, restore afterwards
(function () {
window.addEventListener("beforeprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.dataset.calcWasOpen = d.open ? "1" : "0";
d.open = true;
});
});
window.addEventListener("afterprint", function () {
document.querySelectorAll("details.calc-note").forEach(function (d) {
d.open = d.dataset.calcWasOpen === "1";
delete d.dataset.calcWasOpen;
});
});
})();