2021-12-18 20:04:26 +03:00
// Test the column layouter.
---
2021-12-27 21:01:36 +03:00
// Test normal operation and RTL directions.
2022-01-07 23:24:36 +03:00
#set page(height: 3.25cm, width: 7.05cm, columns: 2)
2023-03-08 12:43:03 +03:00
#set text(lang: "ar", font: ("Noto Sans Arabic", "Linux Libertine"))
2022-01-07 23:24:36 +03:00
#set columns(gutter: 30pt)
2021-12-18 20:04:26 +03:00
2023-02-13 14:04:26 +03:00
#box(fill: conifer, height: 8pt, width: 6pt) وتحفيز
2021-12-27 21:01:36 +03:00
العديد من التفاعلات الكيميائية. (DNA) من أهم الأحماض النووية التي تُشكِّل
إلى جانب كل من البروتينات والليبيدات والسكريات المتعددة
2023-02-13 14:04:26 +03:00
#box(fill: eastern, height: 8pt, width: 6pt)
2022-01-07 23:24:36 +03:00
الجزيئات الضخمة الأربعة الضرورية للحياة.
2021-12-18 20:04:26 +03:00
---
// Test the `columns` function.
#set page(width: auto)
2022-05-01 14:21:07 +03:00
#rect(width: 180pt, height: 100pt, inset: 8pt, columns(2, [
2021-12-18 20:04:26 +03:00
A special plight has befallen our document.
Columns in text boxes reigned down unto the soil
to waste a year's crop of rich layouts.
The columns at least were graciously balanced.
]))
---
2021-12-27 21:01:36 +03:00
// Test columns for a sized page.
#set page(height: 5cm, width: 7.05cm, columns: 2)
2021-12-18 20:04:26 +03:00
2021-12-27 21:01:36 +03:00
Lorem ipsum dolor sit amet is a common blind text
2022-01-07 23:24:36 +03:00
and I again am in need of filling up this page
2021-12-27 21:01:36 +03:00
#align(bottom, rect(fill: eastern, width: 100%, height: 12pt))
#colbreak()
2021-12-18 20:04:26 +03:00
2021-12-27 21:01:36 +03:00
so I'm returning to this trusty tool of tangible terror.
Sure, it is not the most creative way of filling up
a page for a test but it does get the job done.
2021-12-18 20:04:26 +03:00
2021-12-27 21:01:36 +03:00
---
// Test the expansion behavior.
#set page(height: 2.5cm, width: 7.05cm)
2022-05-01 14:21:07 +03:00
#rect(inset: 6pt, columns(2, [
2021-12-27 21:01:36 +03:00
ABC \
BCD
#colbreak()
DEF
]))
2021-12-18 20:04:26 +03:00
---
2021-12-27 21:01:36 +03:00
// Test setting a column gutter and more than two columns.
2022-01-07 23:24:36 +03:00
#set page(height: 3.25cm, width: 7.05cm, columns: 3)
#set columns(gutter: 30pt)
2021-12-18 20:04:26 +03:00
2022-11-28 19:57:16 +03:00
#rect(width: 100%, height: 2.5cm, fill: conifer) #parbreak()
#rect(width: 100%, height: 2cm, fill: eastern) #parbreak()
2021-12-27 21:01:36 +03:00
#circle(fill: eastern)
2021-12-26 19:34:04 +03:00
2021-12-18 20:04:26 +03:00
---
2021-12-27 21:01:36 +03:00
// Test the `colbreak` and `pagebreak` functions.
2021-12-18 20:04:26 +03:00
#set page(height: 1cm, width: 7.05cm, columns: 2)
A
#colbreak()
#colbreak()
B
2021-12-27 21:01:36 +03:00
#pagebreak()
2021-12-18 20:04:26 +03:00
C
2021-12-27 21:01:36 +03:00
#colbreak()
D
2021-12-18 20:04:26 +03:00
---
// Test an empty second column.
#set page(width: 7.05cm, columns: 2)
2022-05-01 14:21:07 +03:00
#rect(width: 100%, inset: 3pt)[So there isn't anything in the second column?]
2021-12-18 20:04:26 +03:00
---
// Test columns when one of them is empty.
#set page(width: auto, columns: 3)
2021-12-26 19:34:04 +03:00
Arbitrary horizontal growth.
2021-12-18 20:04:26 +03:00
---
2021-12-28 02:23:42 +03:00
// Test columns in an infinitely high frame.
2021-12-18 20:04:26 +03:00
#set page(width: 7.05cm, columns: 2)
There can be as much content as you want in the left column
and the document will grow with it.
#rect(fill: conifer, width: 100%, height: 30pt)
Only an explicit #colbreak() `#colbreak()` can put content in the
second column.
---
// Test a page with a single column.
#set page(height: auto, width: 7.05cm, columns: 1)
This is a normal page. Very normal.
---
// Test a page with zero columns.
2022-12-16 00:51:55 +03:00
// Error: 49-50 number must be positive
2021-12-18 20:04:26 +03:00
#set page(height: auto, width: 7.05cm, columns: 0)