summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/modular/modular.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/modular/modular.sty')
-rw-r--r--macros/latex/contrib/modular/modular.sty24
1 files changed, 24 insertions, 0 deletions
diff --git a/macros/latex/contrib/modular/modular.sty b/macros/latex/contrib/modular/modular.sty
new file mode 100644
index 0000000000..72d6fc912a
--- /dev/null
+++ b/macros/latex/contrib/modular/modular.sty
@@ -0,0 +1,24 @@
+% Copyright 2017 Daniel Thomas Sank (sank.daniel@gmail.com)
+%
+% This work may be distributed under the terms of the LPPL.
+% See README.md for details.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{modular}[2016/12/27 Modular document design]
+\RequirePackage{ifthen}
+\RequirePackage{coseoul}
+\RequirePackage{import}
+
+\makeatletter
+\newcounter{currentimportdepth}
+\setcounter{currentimportdepth}{0}
+\newcommand{\subimportlevel}[3]{
+ \expandafter\edef\csname @currentlevel\thecurrentimportdepth\endcsname{\thecurrentlevel}
+ \addtocounter{currentimportdepth}{1}
+ \addtocounter{currentlevel}{-#3}
+ \subimport*{#1}{#2}
+ \addtocounter{currentimportdepth}{-1}
+ \setcounter{currentlevel}{\csname @currentlevel\thecurrentimportdepth\endcsname}
+ }
+\makeatother
+