\input ucwmac.tex
-\input ucw-ofs.tex
-\input ucw-ref.tex
-\input ucw-pdfmeta.tex
+\ucwmodule{ofs}
+\ucwmodule{ref}
+\ucwmodule{pdfmeta}
% \clickablefalse
% Written by Martin Mares <mj@ucw.cz> in 2018 and placed into public domain
% -------------------------------------------------------------------------
+\ucwdefmodule{algo}
+
% \algo{name of the algorithm}\algalias{a longer name}
% \algin input description
% \:step
%% Macros for typesetting of labels
+\ucwdefmodule{labels}
+
% Default page parameters. You can change them before calling \setuplabels.
\setmargins{0pt}
\setuppage
% Written by Martin Mares <mj@ucw.cz> in 2018 and placed into public domain
% -------------------------------------------------------------------------
+\ucwdefmodule{link}
+
% Should clickable links be produced?
\newif\ifclickable
\clickabletrue
+\ucwdefmodule{luaofs}
+\ucwdefmodule{ofs}
+
\input luaotfload.sty
\input ofs.tex
\nofontmessages
% Written by Martin Mares <mj@ucw.cz> in 2010 and placed into public domain
% -------------------------------------------------------------------------
+\ucwdefmodule{ofs}
+
\ifx\OFSversion\undefined
\input ofs.tex
% \detailfontmessages
\nofontmessages
\fi
-% Finish if either this or ucw-luaofs.tex is loaded
-\ifx\setbaselines\undefined\else\endinput\fi
-
% We extend OFS's default CM family by several fonts: cmb, cmcsc
\ofsputfamlist{^^JUCW:}
%% ISO 216 paper sizes [ABC]{0..10}
+\ucwdefmodule{paper}
+
\defpaper{a0}{840truemm}{1189truemm}
\defpaper{a1}{594truemm}{840truemm}
\defpaper{a2}{420truemm}{594truemm}
% Written by Martin Mares <mj@ucw.cz> in 2018 and placed into public domain
% -------------------------------------------------------------------------
+\ucwdefmodule{pdfmeta}
+
\ifx\directlua\undefined
\def\pdfmetainfo#1#2{}%
\def\pdfmetaoutline#1#2#3{}%
% Written by Martin Mares <mj@ucw.cz> in 2018 and placed into public domain
% -------------------------------------------------------------------------
-\input ucw-link.tex
+\ucwdefmodule{ref}
+\ucwmodule{link}
% We maintain a collection of objects. Each object has:
% - type (namespace -- e.g., chapter)
% Written by Martin Mares <mj@ucw.cz> in 2010 and placed into public domain
% -------------------------------------------------------------------------
+\ucwdefmodule{verb}
+
% We'll use internal macros of plain TeX
\catcode`@=11
% Written by Martin Mares <mj@ucw.cz> in 2010--2018 and placed into public domain
% -------------------------------------------------------------------------------
+\ifx\ucwmodule\undefined\else\endinput\fi
+
%%% Prolog %%%
% We'll use internal macros of plain TeX
\fi
}
+%%% Modules %%%
+
+\def\ucwmodule#1{
+ \ifcsname ucwmod:#1\endcsname
+ \else
+ \input ucw-#1.tex
+ \fi
+}
+
+\def\ucwdefmodule#1{
+ \ifcsname ucwmod:#1\endcsname\endinput\fi
+ \expandafter\let\csname ucwmod:#1\endcsname=\relax
+}
+
%%% Epilog %%%
% Let's hide all internal macros