summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/whatsnote/whats-layout-module.code.tex
blob: ff190de2293a8a49f26cc97de5c88f0509699166 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
\whatsnote_provide_module:n { layout }

\bool_if:NTF \g__whatsnote_darkmode_bool
  {
    \pagecolor{black!90}
    \color{black!10}
    \tl_set:Nn \l__whats_darkmode_fading_tl {!30}
    \AtBeginDocument{\color_select:n{black!10}}
  }
  { \tl_new:N \l__whats_darkmode_fading_tl }

\def\@makechapterhead#1
  {
    \vspace*{ -25\p@ }
    {
      \parindent \z@ \raggedright \normalfont
      \int_compare:nNnT { \c@secnumdepth } > { \m@ne }
        {
          \if@mainmatter
            \parbox { 16ex }
              {
                \centering
                \@setfontsize\HUGE{30}{40} \normalfont\bfseries
                \textcolor{darkgray}{\thechapter}
                \vskip6\p@
                \normalsize \bfseries\sffamily\scshape
                \textcolor{darkgray}{\@chapapp}
              }
          \fi
        }
      \interlinepenalty\@M \hspace*{2.5ex}
      \parbox { \dim_eval:n { \linewidth - 21ex } } { \huge \bfseries #1 }
      \par\nobreak
      \vskip 45\p@
    }
  }

\def\@makeschapterhead#1
  {
    \renewcommand*{\thesection}{\arabic{section}}
    \renewcommand*{\theproblem}{\arabic{problem}}
    \setcounter{section}{0}
    \setcounter{problem}{0}
      {
        \centering
        \parindent \z@
        \normalfont
        \interlinepenalty\@M
        \huge \bfseries #1\par\nobreak
        \vskip 40\p@
      }
  }

\NewDocumentEnvironment{textfig}{O{7 \c_colon_str 2}}
  {
    \group_begin:
    \seq_set_split:Nee \l__whats_textfig_ratio_seq {\c_colon_str} {#1}
    \vspace{4.5pt plus 1.5pt minus 1.5pt} \noindent
    \minipage
      {
        \fp_eval:n
          {
            .96*\seq_item:Nn \l__whats_textfig_ratio_seq {1}/
              (
                \seq_item:Nn \l__whats_textfig_ratio_seq {1} + 
                \seq_item:Nn \l__whats_textfig_ratio_seq {2}
              )
          }\dimexpr \linewidth
      }
  }
  {
    \endminipage
    \vspace{4.5pt plus 1.5pt minus 1.5pt} \par
    \group_end:
  }

\NewDocumentCommand \textfigsplit {}
  {
    \endminipage
    \hspace{.02\linewidth}
    \minipage
      {
        \fp_eval:n
          {
            .96*\seq_item:Nn \l__whats_textfig_ratio_seq {2}/
              (
                \seq_item:Nn \l__whats_textfig_ratio_seq {1} + 
                \seq_item:Nn \l__whats_textfig_ratio_seq {2}
              )
          }\dimexpr \linewidth
      } 
  }

\RequirePackage{ tasks, multirow, multicol }
\settasks { label = \sffamily\Alph*., item-indent = 2.5em, label-offset = .5pt }

\RequirePackage[inline]{enumitem}

\RequirePackage{fancyhdr}

\endinput