summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/modular/modular.sty
blob: 72d6fc912ababdc99421483ea454369a919eccca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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