@@ -125,7 +135,7 @@
Renders as: We define the Hyper Tape as a construct...
- First Occurrence Rule
+ First occurrence rule
The term system is intentionally conservative. For the tags <RT-term> and <RT-neologism>, only the first occurrence of a unique term is decorated. Subsequent mentions are rendered as normal prose.
@@ -134,7 +144,7 @@
Uniqueness is tracked by normalizing the term text (trimmed, then lowercased). This means that Symbol and symbol count as the same term.
- Forced Emphasis Variants
+ Forced emphasis variants
Sometimes a later mention of a term should be emphasized again. For that purpose, the system provides explicit emphasis tags:
@@ -148,9 +158,9 @@
These variants are always decorated, even if the term appeared earlier.
- Automatic Definition Anchors
+ Automatic definition anchors
- For first occurrences, the term module automatically assigns an id attribute if one does not already exist. This creates stable anchors for future indexing and linking.
+ For first occurrences, the term module automatically assigns an id attribute if one does not already exist. This establishes stable anchors for future indexing and linking.
@@ -161,7 +171,7 @@
The first occurrence will be given an id similar to def-symbol. For neologisms, an additional marker is used, for example def-neo-hyper-tape.
- Technical Content
+ Technical content
Code
@@ -188,14 +198,14 @@
f(x) = \sum_{i=0}^{n} x_i
-
Navigation & Layout
+ Navigation and layout
- Automatic Table of Contents
+ Automatic table of contents
- Use <RT-TOC> to insert a generated table of contents. The tag scans the document forward from its current position to collect headings.
+ Use <RT-TOC> to insert a compiled table of contents. The tag scans the document forward from its current position to collect headings.
- Explicit Mode
+ Explicit mode
Use the level="N" attribute to target a specific heading depth.
@@ -204,7 +214,7 @@
<RT-TOC level="2">: Collects all <h2> elements until it encounters the next <h1>. Best for chapter summaries.
- Implicit Mode
+ Implicit mode
If no level is specified, the TOC scans backwards to find the nearest heading (for example H1) and assumes you want to collect children one level deeper (for example H2).
@@ -212,9 +222,9 @@
Note: Implicit mode can fail if placed before the first heading of a section. Use explicit levels for robust results.
- The Title Block
+ The title block
- Use <RT-title> as the first element in your <body> (before the article container). This tag generates a standardized, styled header block with the document title and metadata.
+ Use <RT-title> as the first element in your <body> (before the article container). This tag produces a standardized, styled header block with the document title and metadata.
Attributes
@@ -229,7 +239,7 @@
+ date="2026-06-17 15:13:00Z">
@@ -237,7 +247,7 @@
Renders as: A centered, high contrast H1 followed by a serif styled metadata row containing the author and date.
- The Article Container
+ The article container
The root element must be <RT-article>. This is the boundary for the pagination logic.
@@ -250,9 +260,17 @@
Soft Limit Pagination: The system attempts to keep headers with their following paragraphs. It will break a page early rather than stranding a header at the bottom.
+ Manual page breaks and chapters
+
+ A person can assert explicit control over the layout engine using the <RT-page-break></RT-page-break> tag. This tag forces the engine to close the current page and push all subsequent content to the top of the next page. Standard HTML5 parsing requires this custom tag to be explicitly closed; self-closing syntax will fail.
+
+
+ For major document divisions, use <RT-chapter>. The semantic processor translates this tag into an <RT-page-break> followed by an <h1 class="RT-chapter">. This ensures the chapter starts on a new page, inherits standard typography, and is automatically indexed by the TOC engine.
+
+
Debugging
- Debug Tokens
+ Debug tokens
RT provides a lightweight debug logging system in utility.js. Logging is controlled by a set of active debug tokens. Each log message is assigned a token, and the message prints only if that token is enabled.
@@ -261,7 +279,7 @@
Examples of common tokens include style, layout, pagination, selector, config, and term.
- How Logging is Gated
+ How logging is gated
Normal log and warning output are gated. The methods debug.log(token,message) and debug.warn(token,message) will print only when the token exists in debug.active_tokens.
@@ -270,14 +288,14 @@
This prevents the console from being flooded during normal use, while still allowing deep visibility during development.
- Errors are Always Printed
+ Errors are always printed
Errors are treated differently. The method debug.error(token,message) always prints, regardless of token state. These messages represent failures that require attention.
- Enabling and Disabling Tokens
+ Enabling and disabling tokens
- Tokens may be enabled or disabled in two ways: by editing the active_tokens set in utility.js, or at runtime by calling:
+ Tokens are enabled or disabled in two ways: by editing the active_tokens set in utility.js, or at runtime by calling:
@@ -316,7 +334,7 @@
window.StyleRT.style_orchestrator();
- RT Conventions
+ RT conventions
Headings are first letter capitalized. Remaining words are as they would be in English prose.
Exercises
@@ -324,27 +342,27 @@
-
- Term Occurrences: If an author tags a word with <RT-term> five times in a document, how many times will the term be visually decorated by the styling engine? How does a person force the engine to decorate a later occurrence?
+ Term occurrences: If an author tags a word with <RT-term> five times in a document, how many times will the term be visually decorated by the styling engine? How does a person force the engine to decorate a later occurrence?
-
- Term Normalization: A person writes <RT-term>Parse Tree</RT-term> in paragraph one, and <RT-term>parse tree</RT-term> in paragraph two. Will the system assign a definition anchor to the second occurrence?
+ Term normalization: A person writes <RT-term>Parse Tree</RT-term> in paragraph one, and <RT-term>parse tree</RT-term> in paragraph two. Will the system assign a definition anchor to the second occurrence?
-
- TOC Generation: What happens if one places an <RT-TOC> tag without a level attribute before the first heading of a section?
+ TOC compilation: What happens if a person places an <RT-TOC> tag without a level attribute before the first heading of a section?
-
- Code and Math Formatting: How does the RT system determine whether to render an <RT-code> or <RT-math> element inline with the text versus as a standalone block?
+ Code and math formatting: How does the RT system determine whether to render an <RT-code> or <RT-math> element inline with the text versus as a standalone block?
-
- Pagination Logic: When the script bundles elements into an <RT-page> container, how does the soft limit pagination handle a heading that falls at the very bottom of the page capacity?
+ Pagination logic: When the script bundles elements into an <RT-page> container, how does the soft limit pagination handle a heading that falls at the very bottom of the page capacity?
diff --git a/developer/authored/RT/element/chapter.js b/developer/authored/RT/element/chapter.js
new file mode 100644
index 0000000..1cbf76e
--- /dev/null
+++ b/developer/authored/RT/element/chapter.js
@@ -0,0 +1,32 @@
+/*
+ Processes tags.
+ Transforms the tag into an followed by an with the RT-chapter class.
+*/
+window.StyleRT = window.StyleRT || {};
+
+window.StyleRT.chapter = function(){
+ const debug = window.StyleRT.debug || { log: function(){} };
+
+ document.querySelectorAll('RT-chapter').forEach( (el ,index) => {
+ if(debug.log) debug.log('chapter' ,`Processing chapter ${index + 1}`);
+
+ const brk = document.createElement('RT-page-break');
+ const h1 = document.createElement('h1');
+
+ h1.innerHTML = el.innerHTML;
+
+ if(el.className){
+ h1.className = el.className;
+ }
+ h1.classList.add('RT-chapter');
+
+ Array.from(el.attributes).forEach( (attr) => {
+ if(attr.name !== 'class'){
+ h1.setAttribute(attr.name ,attr.value);
+ }
+ });
+
+ el.parentNode.insertBefore(brk ,el);
+ el.replaceWith(h1);
+ });
+};
diff --git a/developer/authored/RT/layout/article_tech_ref.js b/developer/authored/RT/layout/article_tech_ref.js
index a663f0f..9e7386b 100644
--- a/developer/authored/RT/layout/article_tech_ref.js
+++ b/developer/authored/RT/layout/article_tech_ref.js
@@ -32,6 +32,7 @@
let is_layout_locked = true;
// 5. Declare Dependencies
+ RT.include('RT/element/chapter');
RT.include('RT/element/citation');
RT.include('RT/core/utility');
RT.include('RT/element/math');
@@ -206,6 +207,8 @@
function run_layout() {
debug.log('scroll', `5. run_layout starting.`);
+
+ if(RT.chapter) RT.chapter();
if(RT.TOC) RT.TOC();
if(RT.paginate_by_element) RT.paginate_by_element();
if(RT.page) RT.page();
diff --git a/developer/authored/RT/layout/paginate_by_element.js b/developer/authored/RT/layout/paginate_by_element.js
index 8c2dbb6..a511e39 100644
--- a/developer/authored/RT/layout/paginate_by_element.js
+++ b/developer/authored/RT/layout/paginate_by_element.js
@@ -292,10 +292,12 @@ window.StyleRT.paginate_by_element = function () {
continue;
}
+
// --- Ordinary (non-splittable) element ---
const h = getElHeight(el);
+ const is_RT_page_break = el.tagName && el.tagName.toLowerCase() === 'rt-page-break';
- if (current_h + h > page_height_limit && current_batch_seq.length > 0) {
+ if( (is_RT_page_break || current_h + h > page_height_limit) && current_batch_seq.length > 0 ){
let backtrack_seq = [];
let backtrack_h = 0;