]> mj.ucw.cz Git - ucwmac.git/commitdiff
A simple module system for maintaining dependencies
authorMartin Mares <mj@ucw.cz>
Tue, 5 Jun 2018 19:52:57 +0000 (21:52 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 5 Jun 2018 19:52:57 +0000 (21:52 +0200)
test-ref.tex
ucw-algo.tex
ucw-labels.tex
ucw-link.tex
ucw-luaofs.tex
ucw-ofs.tex
ucw-paper.tex
ucw-pdfmeta.tex
ucw-ref.tex
ucw-verb.tex
ucwmac.tex

index cefb5dc687a9d619babe78b03d0ec898a7e8b9e3..13f9e1cd4465a74fd79a09121d9bdfc107ca4ff0 100644 (file)
@@ -1,7 +1,7 @@
 \input ucwmac.tex
-\input ucw-ofs.tex
-\input ucw-ref.tex
-\input ucw-pdfmeta.tex
+\ucwmodule{ofs}
+\ucwmodule{ref}
+\ucwmodule{pdfmeta}
 
 % \clickablefalse
 
index 6259fbce4f9265f535df63de52f1ebe360ab2d77..b773396d472f5efcbcb4533ead1b89d50171716d 100644 (file)
@@ -2,6 +2,8 @@
 % 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
index f6730b5eb5e990335ab0d5e13bc031b2fded265e..58bf8831b4a8b88e99e9137b5fcfb95caf65d5b1 100644 (file)
@@ -1,5 +1,7 @@
 %% Macros for typesetting of labels
 
+\ucwdefmodule{labels}
+
 % Default page parameters. You can change them before calling \setuplabels.
 \setmargins{0pt}
 \setuppage
index cbe4ec918e5a4e565d2432ce17b587832d4e1366..58f498f9ab13d1304306ffa258651dc1515d297d 100644 (file)
@@ -2,6 +2,8 @@
 % Written by Martin Mares <mj@ucw.cz> in 2018 and placed into public domain
 % -------------------------------------------------------------------------
 
+\ucwdefmodule{link}
+
 % Should clickable links be produced?
 \newif\ifclickable
 \clickabletrue
index e21d6586be58ea3700dde23fa03901735003117f..5008bea7902a68ebe51f816385e9f918ae9b22aa 100644 (file)
@@ -1,3 +1,6 @@
+\ucwdefmodule{luaofs}
+\ucwdefmodule{ofs}
+
 \input luaotfload.sty
 \input ofs.tex
 \nofontmessages
index a5b21a770adcbf70b478297dfe6e3fc91b5dc28a..5fae70d599b971cb4f8498099c45c61a55f46e9b 100644 (file)
@@ -2,15 +2,14 @@
 % 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:}
index 242ccf254f32afdf9ff7197f6485fc3fa216da82..9b656f0db56898824bf0b1f6d93f22882141f522 100644 (file)
@@ -1,5 +1,7 @@
 %% ISO 216 paper sizes [ABC]{0..10}
 
+\ucwdefmodule{paper}
+
 \defpaper{a0}{840truemm}{1189truemm}
 \defpaper{a1}{594truemm}{840truemm}
 \defpaper{a2}{420truemm}{594truemm}
index 4ac227713c32b760fb5d584b7b9b45381adcde10..31884e15991f07f7cd1d1a4e98cb7e22b330f614 100644 (file)
@@ -2,6 +2,8 @@
 % 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{}%
index 74143e212b2825dd93013bdf0e1307a1ce917a0a..37f3721eb286062d4feaab92da60069862c982de 100644 (file)
@@ -2,7 +2,8 @@
 % 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)
index ab8951812470147aec6a4eb73164e4bb14f74de6..33a0ee311092f6f287a16442db5a0bd3af34b856 100644 (file)
@@ -2,6 +2,8 @@
 % 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
 
index 5dd13f2fdf14291adb84ad86beccd87ddb8cb582..bbee36d376e4aa3553613630549682d7fdc5e544 100644 (file)
@@ -2,6 +2,8 @@
 % 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