summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/minimalist/minimalist.sty
blob: 910f1e7960c58307c9c5225644fe6a6bc291dc38 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
%%
%% This is file `minimalist/minimalist.sty',
%% generated with the docstrip utility.
%%
%% Copyright (C) 2021-2022 by Jinwen XU
%% 
%% This is part of the minimalist class series.
%% 
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3c of this license or (at
%% your option) any later version. The latest version of this license is in
%% 
%%     http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\RequirePackage{l3keys2e}
\ProvidesExplPackage
  {minimalist}
  {2022/06/16} {}
  {A simple and clear style for articles and books}

\keys_define:nn { minimalist }
  {
    , draft             .bool_set:N         = \l__minimalist_fast_bool
    , draft             .initial:n          = { false }
    , fast              .bool_set:N         = \l__minimalist_fast_bool

    , style             .str_set:N          = \l__minimalist_style_str
    , style             .initial:n          = { plain }
    , use-style         .str_set:N          = \l__minimalist_style_str
    , use~style         .str_set:N          = \l__minimalist_style_str
    , use style         .str_set:N          = \l__minimalist_style_str
    , classical         .meta:n             = { style = classical }

    , use-boldface      .bool_set:N         = \l__minimalist_use_boldface_bool
    , use-boldface      .initial:n          = { false }
    , use~boldface      .bool_set:N         = \l__minimalist_use_boldface_bool
    , use boldface      .bool_set:N         = \l__minimalist_use_boldface_bool
    , title-in-boldface .bool_set:N         = \l__minimalist_use_boldface_bool
    , title~in~boldface .bool_set:N         = \l__minimalist_use_boldface_bool
    , title in boldface .bool_set:N         = \l__minimalist_use_boldface_bool
    , title-in-bold     .bool_set:N         = \l__minimalist_use_boldface_bool
    , title~in~bold     .bool_set:N         = \l__minimalist_use_boldface_bool
    , title in bold     .bool_set:N         = \l__minimalist_use_boldface_bool

    , use-scshape       .bool_set:N         = \l__minimalist_use_scshape_bool
    , use-scshape       .initial:n          = { false }
    , use~scshape       .bool_set:N         = \l__minimalist_use_scshape_bool
    , use scshape       .bool_set:N         = \l__minimalist_use_scshape_bool
    , title-in-scshape  .bool_set:N         = \l__minimalist_use_scshape_bool
    , title~in~scshape  .bool_set:N         = \l__minimalist_use_scshape_bool
    , title in scshape  .bool_set:N         = \l__minimalist_use_scshape_bool

    , runin             .bool_set:N         = \l__minimalist_runin_bool
    , runin             .initial:n          = { false }

    , theorem-in-new-line .bool_set:N       = \l__minimalist_theorem_in_new_line_bool
    , theorem-in-new-line .initial:n        = { false }
    , theorem~in~new~line .bool_set:N       = \l__minimalist_theorem_in_new_line_bool
    , theorem in new line .bool_set:N       = \l__minimalist_theorem_in_new_line_bool

    , unknown           .code:n             = {
                                                \PassOptionsToPackage { \CurrentOption } { projlib-language }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-author }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-datetime }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-draft }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-font }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-logo }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-math }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-paper }
                                                \PassOptionsToPackage { \CurrentOption } { projlib-theorem }
                                              }
  }
\ProcessKeysOptions { minimalist }

\bool_new:N \l__minimalist_is_book_bool
\cs_if_exist:cTF { c@chapter }
  {
    \bool_set_true:N \l__minimalist_is_book_bool
  }
  {
    \bool_set_false:N \l__minimalist_is_book_bool
  }

%%================================
%%  Line numbers
%%================================
\PassOptionsToPackage { pagewise,mathlines } { lineno }
\RequirePackage { linenoamsmath }
\renewcommand{\linenumberfont}{\ttfamily\color{main-text!7!paper}\footnotesize}
\setlength{\linenumbersep}{1em}

\newif\ifLNturnsON
\def\LocallyStopLineNumbers{\LNturnsONfalse
    \ifLineNumbers\LNturnsONtrue\fi\nolinenumbers}
\def\ResumeLineNumbers{\ifLNturnsON\linenumbers\fi}

\hook_gput_code:nnn { cmd/tableofcontents/before } { minimalist } { \LocallyStopLineNumbers }
\hook_gput_code:nnn { cmd/tableofcontents/after } { minimalist } { \ResumeLineNumbers }
\hook_gput_code:nnn { env/bibliography/before } { minimalist } { \LocallyStopLineNumbers }
\hook_gput_code:nnn { env/bibliography/after } { minimalist } { \ResumeLineNumbers }

%%================================
%%  Paper configuration
%%================================
\RequirePackage { projlib-paper }

%%================================
%%  Multi-language support
%%================================
\RequirePackage { projlib-language }

%%================================
%%  Loading the style
%%================================
\exp_args:No \RequirePackage { minimalist- \l__minimalist_style_str }

\endinput
%%
%% End of file `minimalist/minimalist.sty'.