Skip to content

Commit cb51e21

Browse files
claude: Add orange-book-margin test suite for Typst margin layouts
Port the margin layout tests from quarto-ilm to test with the orange-book format. Tests verify correct recto/verso margin placement with position assertions for margin figures, tables, equations, listings, callouts, sidenotes, and custom crossref types. Uses reference-location: margin and citation-location: margin with suppress-bibliography: true for margin citation testing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5a266b4 commit cb51e21

12 files changed

Lines changed: 1399 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.quarto/
2+
/_book/
3+
/index.typ
4+
**/*.quarto_ipynb
5+
*_files/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
color:
2+
primary: "#6B8E6B"
3+
secondary: "#2E86AB"
4+
5+
logo:
6+
images:
7+
test-logo:
8+
path: logo.svg
9+
alt: "Test Logo"
10+
medium: test-logo
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
project:
2+
type: book
3+
4+
book:
5+
title: "Test Typst Book with Margins"
6+
author: "Test Author"
7+
date: "2024-01-01"
8+
chapters:
9+
- index.qmd
10+
- part: "Part I: Getting Started"
11+
chapters:
12+
- chapter1.qmd
13+
- part: "Part II: Advanced Topics"
14+
chapters:
15+
- chapter2.qmd
16+
- chapter3.qmd
17+
appendices:
18+
- appendix.qmd
19+
- appendix-b.qmd
20+
21+
bibliography: references.bib
22+
reference-location: margin
23+
citation-location: margin
24+
suppress-bibliography: true
25+
26+
grid:
27+
margin-width: 2in
28+
gutter-width: 0.25in
29+
30+
crossref:
31+
custom:
32+
- kind: float
33+
key: dino
34+
reference-prefix: Dinosaur
35+
36+
format:
37+
typst:
38+
keep-typ: true
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Supplementary Data {#sec-supplementary}
2+
3+
This is the second appendix containing supplementary data and additional examples.
4+
5+
## Appendix B Margin Figures {#sec-appendix-b-margin-figures}
6+
7+
Secondaria body text introduces the supplementary margin content.
8+
9+
::: {.column-margin}
10+
![Databvisual supplementary data](logo.svg){#fig-appendix-b-margin}
11+
:::
12+
13+
Graphica diagram in @fig-appendix-b-margin demonstrates second appendix margin figure numbering.
14+
15+
## Additional Figures {#sec-additional-figures}
16+
17+
::: {#fig-appendix-b-panel layout-ncol=2}
18+
19+
![Third appendix panel](logo.svg){#fig-appendix-b-panel-a}
20+
21+
![Fourth appendix panel](logo.svg){#fig-appendix-b-panel-b}
22+
23+
A panel of sub-figures in Appendix B demonstrating B-prefix numbering.
24+
:::
25+
26+
Secundaria panel in @fig-appendix-b-panel, with @fig-appendix-b-panel-a and @fig-appendix-b-panel-b as components.
27+
28+
## Appendix B Margin Tables {#sec-appendix-b-margin-tables}
29+
30+
Metrica body text introduces additional supplementary data.
31+
32+
::: {.column-margin}
33+
| Parameter | Unit |
34+
|-----------|------|
35+
| Mass | kg |
36+
| Length | m |
37+
| Time | s |
38+
39+
: Unitaria values {#tbl-appendix-b-margin}
40+
:::
41+
42+
Dimensiona units in @tbl-appendix-b-margin demonstrate Appendix B margin table placement.
43+
44+
## Additional Callouts {#sec-additional-callouts}
45+
46+
::: {#wrn-appendix-b .callout-warning}
47+
## Appendix B Warning
48+
Pericula secundaria hazard documented here. Monitoria reference in @wrn-appendix-b.
49+
:::
50+
51+
Exegesis body text explicates supplementary guidance.
52+
53+
::: {#tip-appendix-b .callout-tip .column-margin}
54+
## Appendix B Tip
55+
Gnomicon: Consilia secundaria guidance provided here. Advisoria reference in @tip-appendix-b.
56+
:::
57+
58+
## Additional Dinosaurs {#sec-additional-dinosaurs}
59+
60+
::: {#dino-appendix-b}
61+
**Brachiosaurus**
62+
63+
Sauropoda giganta specimen documented here. Brachiosaura reference in @dino-appendix-b.
64+
:::
65+
66+
## Appendix B Margin Dinosaurs {#sec-appendix-b-margin-dinosaurs}
67+
68+
::: {#dino-appendix-b-margin .column-margin}
69+
**Parasaura**
70+
71+
This crested dinosaur demonstrates Appendix B margin placement.
72+
:::
73+
74+
Hadrosaura body text discusses the margin dinosaur placement.
75+
76+
## Appendix B Margin Equations {#sec-appendix-b-margin-equations}
77+
78+
Magnetica body text introduces additional supplementary mathematics.
79+
80+
::: {.column-margin}
81+
$$
82+
\nabla \times \vec{B} = \mu_0 \vec{J} + \mu_0 \epsilon_0 \frac{\partial \vec{E}}{\partial t}
83+
$$ {#eq-appendix-b-margin}
84+
85+
Maxwelliana field law.
86+
:::
87+
88+
Electromagnetica law in @eq-appendix-b-margin demonstrates Appendix B margin equation placement.
89+
90+
## Cross-references {#sec-appendix-b-crossrefs}
91+
92+
Retrospecta from Appendix A: compositia panel in @fig-appendix-panel.
93+
94+
Marginala from Appendix A: orbitala diagram in @fig-appendix-margin.
95+
96+
Foundationa content: carnivorica @dino-trex from @sec-intro and beveragia @wrn-tea.
97+
98+
Marginala from Chapter 1: copernicana @fig-margin-orbital and keplerian @lst-margin-kepler.
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Additional Resources {#sec-resources}
2+
3+
This appendix contains additional resources and supplementary material.
4+
5+
## Data Sources {#sec-data-sources}
6+
7+
The data used in this book comes from various sources.
8+
9+
## Code Repository {#sec-code-repository}
10+
11+
All code examples are available in the companion repository. Computationa theory from @turing1950 establishes foundational concepts.
12+
13+
Foundationa material in @sec-intro, with kinematica visualization in @fig-cars.
14+
15+
## Appendix Margin Figures {#sec-appendix-margin-figures}
16+
17+
Appendixia body text introduces the appendix margin content.
18+
19+
::: {.column-margin}
20+
![Appendorba supplementary diagram](logo.svg){#fig-appendix-margin}
21+
:::
22+
23+
Additiva diagram in @fig-appendix-margin demonstrates appendix margin figure numbering.
24+
25+
## Appendix Sub-figures {#sec-appendix-sub-figures}
26+
27+
Appendiculata subfigure numbering test. @sec-appendix-sub-figures validates letter-based chapter numbering.
28+
29+
Compositia panel in @fig-appendix-panel, with @fig-appendix-panel-a and @fig-appendix-panel-b as components.
30+
31+
::: {#fig-appendix-panel layout-ncol=2}
32+
33+
![First appendix panel](logo.svg){#fig-appendix-panel-a}
34+
35+
![Second appendix panel](logo.svg){#fig-appendix-panel-b}
36+
37+
A panel of sub-figures in the appendix demonstrating letter-based numbering.
38+
:::
39+
40+
## Appendix Margin Tables {#sec-appendix-margin-tables}
41+
42+
Tabulata body text introduces supplementary data.
43+
44+
::: {.column-margin}
45+
| Constant | Value |
46+
|----------|-------|
47+
| G | 6.674e-11 |
48+
| c | 299792458 |
49+
| h | 6.626e-34 |
50+
51+
: Constantia values {#tbl-appendix-margin}
52+
:::
53+
54+
Fundamentala constants in @tbl-appendix-margin demonstrate appendix margin table placement.
55+
56+
## Appendix Callouts {#sec-appendix-callouts}
57+
58+
Admonitia appendix numbering test. @sec-appendix-callouts validates letter-based callout numbering.
59+
60+
::: {#wrn-appendix .callout-warning}
61+
## Appendix Warning
62+
Pericula appendix hazard documented here. Admonitoria reference in @wrn-appendix.
63+
:::
64+
65+
Appendicata body text introduces the supplementary guidance.
66+
67+
::: {#tip-appendix .callout-tip .column-margin}
68+
## Appendix Tip
69+
Consilia appendix guidance provided here.
70+
:::
71+
72+
Advisoria reference in @tip-appendix demonstrates margin callout placement.
73+
74+
Retrospecta: beveragia warning in @wrn-tea from @sec-intro.
75+
76+
## Appendix Custom Crossref Dinosaurs {#sec-appendix-dinosaurs}
77+
78+
Taxonomica appendix numbering test. @sec-appendix-dinosaurs validates letter-based crossref numbering.
79+
80+
::: {#dino-appendix}
81+
**Triceratops**
82+
83+
Ceratopsia specimen documented here. Fossilica reference in @dino-appendix.
84+
:::
85+
86+
Comparativa: herbivorica specimen @dino-steg from @sec-intro.
87+
88+
## Appendix Margin Dinosaurs {#sec-appendix-margin-dinosaurs}
89+
90+
::: {#dino-appendix-margin .column-margin}
91+
**Diplodoca**
92+
93+
This long-necked dinosaur demonstrates appendix margin placement.
94+
:::
95+
96+
Longneckia body text discusses the margin dinosaur placement.
97+
98+
## Appendix Equations {#sec-appendix-equations}
99+
100+
The Pythagorean theorem:
101+
102+
$$
103+
a^2 + b^2 = c^2
104+
$$ {#eq-pythagorean}
105+
106+
Geometrica appendix result in @eq-pythagorean.
107+
108+
Retrospectiva: relativistica in @eq-einstein from @sec-intro and algebraica in @eq-quadratic from @sec-methods.
109+
110+
## Appendix Margin Equations {#sec-appendix-margin-equations}
111+
112+
Electrica body text introduces supplementary mathematics.
113+
114+
::: {.column-margin}
115+
$$
116+
\oint \vec{E} \cdot d\vec{A} = \frac{Q}{\epsilon_0}
117+
$$ {#eq-appendix-margin-gauss}
118+
119+
Gaussiana electric field law.
120+
:::
121+
122+
Integrala surface law in @eq-appendix-margin-gauss demonstrates appendix margin equation placement.
123+
124+
## Appendix Theorems {#sec-appendix-theorems}
125+
126+
::: {#thm-appendix}
127+
## Example Appendix Theorem
128+
This theorem demonstrates appendix numbering. It should ideally be Theorem A.1.
129+
:::
130+
131+
Demonstrata result in @thm-appendix. Retrospectiva: @thm-pythagorean from @sec-intro and @thm-calculus from @sec-methods.
132+
133+
## Appendix Listings {#sec-appendix-listings}
134+
135+
```{#lst-appendix-example .python lst-cap="Appendix Code Example"}
136+
# This demonstrates appendix listing numbering
137+
# Should display as Listing A.1
138+
def appendix_function():
139+
return "Appendix example"
140+
```
141+
142+
Exemplara code in @lst-appendix-example.
143+
144+
Retrospectiva: programmata in @lst-hello from @sec-intro and sortiva in @lst-quicksort from @sec-methods.
145+
146+
## Appendix Margin Listings {#sec-appendix-margin-listings}
147+
148+
Algoritha body text introduces supplementary code.
149+
150+
::: {.column-margin}
151+
```{#lst-appendix-margin .python lst-cap="Auxiliara annotation"}
152+
def appendix_helper():
153+
"""Appendix margin code."""
154+
return 42
155+
```
156+
:::
157+
158+
Helpera function in @lst-appendix-margin demonstrates appendix margin listing placement.

0 commit comments

Comments
 (0)