% !TeX program = lualatex % ===================================================================== % 01-text-style.tex % Text, styling and structure: the case rule, colours, fonts, sizes, % alignment, tabs, vertical skips, scripts — then the two ideas that % make scholatex scale: factoring repeated styling into aliases, and a real % table of contents driven by the heading keywords. % ===================================================================== \documentclass[ margins=20, font=Latin Modern Roman, size=12, lang=en ]{scholatex} \begin{document} % --------------------------------------------------------------------- % Factor every recurring style into an alias, once, at the top. From here % on the document never repeats a tag's attributes: it just names them. % A heading alias carries its section keyword among the words, so the same % name works as a heading (
{
A tag is written <<...>> and its attributes obey one rule, read off the
letter case alone: {
The styles are {bold}, {italic}, {underlined}, {
Colours are always written in CamelCase, one rule for all 151 of them —
the everyday ones are simply capitalised: {
A font name is written in capitals: {
A plain paragraph is justified by default, so the alias p above is
simply < {
Raised and lowered text ride on the base line without changing its size:
the 1 {
A handful of characters drive the language: angle brackets open and close
a tag, braces delimit a block, the hash interpolates. To print one of them
literally, double it — that is the whole rule.
}
{
So a doubled character always prints as the single character itself. The
underscore, ampersand, percent and tilde are handled for you — type them
as they are:
}
{
The backslash is an ordinary character now, so a file path or a Windows
folder prints exactly as written — nothing to escape:
}
{
A line break inside a paragraph is the tag < {
The heading keywords section, subsection and
subsubsection — folded into h1, h2, h3 at the top —
number themselves and feed the < {
This subsection is numbered one level down and appears indented in the
table of contents above.
}
{
One level deeper still, with its own counter that restarts whenever its
parent advances.
}
{
Opening a new subsection bumps the middle counter and resets the deeper
one — all automatic.
}
{
A list is written < {
A list written under an item becomes its sub-list, nested as deep as you
like, each level with its own style:
}
{
A checklist is handy for materials or steps to tick off:
}
{
Every heading and paragraph in this document named an alias rather than
repeating a list of attributes. Change let h1 = <Inline styles and colours
Fonts and sizes
Alignment, tabs and skips
Scripts
Escapes and special characters
Structure and the table of contents
A second-level heading
A third-level heading
Another second-level heading
Lists
The payoff of factoring