commit 72290d4a0adb1c8408ae27e97b58aca51a729ae9
parent 109f14dfb6b54f06a03aee4988dae0bd86a4108c
Author: robert <robertrussell.72001@gmail.com>
Date: Sun, 30 Jan 2022 15:18:14 -0800
Add macros for setting paper size
Diffstat:
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/page.tex b/page.tex
@@ -0,0 +1,24 @@
+\csdef{paper:letter}{(8.5in,11in)}
+\csdef{paper:a4}{(210mm,297mm)}
+
+\def\@paper(#1,#2){%
+ \pagewidth=\dimexpr#1\relax
+ \pageheight=\dimexpr#2\relax
+}
+\def\paper[#1]{%
+ \ifcs paper:#1\endcs
+ \ea\ea\ea\@paper\begcs paper:#1\endcs
+ \else
+ \errmessage{unknown paper type "#1"}%
+ \fi
+}
+\def\rotatepaper{%
+ \dimenA=\pagewidth
+ \pagewidth=\pageheight
+ \pageheight=\dimenA
+}
+
+% TODO: helper macros for setting margin sizes? Or maybe margins are out of
+% scope for the core.
+
+\endinput
diff --git a/r3tex.tex b/r3tex.tex
@@ -1,14 +1,14 @@
\input catcode % plain-like catcode initialization
\input primitive % LuaTeX primitives, pdfTeX compatibility
\input alloc
+\input debug % utilities for debugging
\input util
\input queue % queue data structures
\input loop
-\input debug % utilities for debugging
\input param
\input text
\input math
-% \input margin
+\input page
% \input font
% \input section
\input list