diff options
author | Karl Berry <karl@freefriends.org> | 2019-07-20 22:56:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-07-20 22:56:54 +0000 |
commit | 9eec44b1a8bb8fc5dfe6f0fd70e363a6b5b21fef (patch) | |
tree | e3dcf249fee028b55f65889fdb534aa4285e471c /Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty | |
parent | 6ea85421c7a7509aff90c1ca416e66d58570df82 (diff) |
tuda-ci (21jul19)
git-svn-id: svn://tug.org/texlive/trunk@51691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty b/Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty new file mode 100644 index 00000000000..fd12ea8ffbb --- /dev/null +++ b/Master/texmf-dist/tex/latex/tuda-ci/tudarules.sty @@ -0,0 +1,144 @@ +%% This is file `tudarules.sty' version 1.00 (2019/07/20), +%% it is part of +%% TUDa-CI -- Corporate Design for TU Darmstadt +%% ---------------------------------------------------------------------------- +%% +%% Copyright (C) 2018--2019 by Marei Peischl <marei@peitex.de> +%% +%% ============================================================================ +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% 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.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainers of this work are +%% Marei Peischl <tuda-ci@peitex.de> +%% Markus Lazanowski <latex@ce.tu-darmstadt.de> +%% +%% The development respository can be found at +%% https://github.com/tudace/tuda_latex_templates +%% Please use the issue tracker for feedback! +%% +%% ============================================================================ +%% +\def\fileversion{1.00} +\def\filedate{2019/07/20} +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{expl3} +\ProvidesExplPackage{tudarules}{\filedate}{\fileversion}{Creation of colored bars for tuda-ci bundle} + + +\RequirePackage{l3keys2e} + +\seq_if_exist:NF \l_TUDa_tmpa_seq {\seq_new:N \l_TUDa_tmpa_seq} +\tl_if_exist:NF \l_TUDa_tmpa_tk {\tl_new:N \l_TUDa_tmpa_tl} + +\cs_new:Nn \TUDa_rules_set_values:n { + \seq_set_split:Nnn \l_TUDa_tmpa_seq {|} {#1} + + \int_step_inline:nnnn {1} {1} {4} { + \tl_set:Nn \l_TUDa_tmpa_tl {c_TUDa_ + \clist_item:nn {largerule, rulesep, smallrule, logoheight} {##1} + _dim} + \dim_if_exist:cF {\l_TUDa_tmpa_tl} {\dim_new:c {\l_TUDa_tmpa_tl}} + \dim_gset:cn {\l_TUDa_tmpa_tl} {\seq_item:Nn \l_TUDa_tmpa_seq {##1}} + } +} + +\keys_define:nn {TUDa/rules} { + color .tl_gset:N = \g_TUDa_rules_color_tl, + blackrule .meta:n = {color=black}, + paper .choice:, + paper/dl .code:n = { \TUDa_rules_set_values:n { 3.5mm | 1.4mm | 1.2pt | 17 mm | 0.6pt| 10mm | 14mm}}, + paper/a6 .code:n = { \TUDa_rules_set_values:n { 3 mm | 1.4mm | 1.2pt | 16.5mm | 0.6pt| 10mm | 15mm}}, + paper/a5 .code:n = { \TUDa_rules_set_values:n { 3.3mm | 1.4mm | 1.2pt | 19 mm | 0.6pt| 12mm | 16mm}}, + paper/a4 .code:n = { \TUDa_rules_set_values:n { 4 mm | 1.4mm | 1.2pt | 22 mm | 0.6pt| 15mm | 20mm}}, + paper/a3 .code:n = { \TUDa_rules_set_values:n { 4.5mm | 1.4mm | 1.2pt | 24.5mm | 0.6pt| 15mm | 20mm}}, + paper/a2 .code:n = { \TUDa_rules_set_values:n { 8 mm | 2.5mm | 2.2pt | 44.5mm | 1.1pt| 30mm | 35mm}}, + paper/a1 .code:n = { \TUDa_rules_set_values:n { 10 mm | 3.0mm | 2.8pt | 55.5mm | 1.4pt| 30mm | 35mm}}, + paper/a0 .code:n = { \TUDa_rules_set_values:n { 16 mm | 5.2mm | 4.8pt | 80 mm | 2.4pt| 30mm | 35mm}}, + paper/slide .code:n = { \TUDa_rules_set_values:n { 2mm | .7mm | .6pt | 11 mm | .3pt| 7.5mm | 10mm}}, + paper/beamer .meta:n = {paper= slide}, + color .tl_gset:N = \g_TUDarules_default_color_tl, + color .initial:n = black, + mode .tl_gset:N = \g_TUDarules_default_mode_tl, + mode .initial:n = box +} + +\ProcessKeysOptions{TUDa/rules} + +\RequirePackage{tudacolors} +\RequirePackage{xparse} + +%Switch between TikZ and box mode +\bool_new:N \g_TUDa_rule_TikZmode_bool + +\keys_define:nn {TUDa/rules} { + width .dim_gset:N = \l_TUDa_headrule_width_dim, + color .tl_gset:N = \l_TUDa_headrule_color_tl, + mode .choice:, + mode / box .code:n = \bool_gset_false:N \g_TUDa_rule_TikZmode_bool, + mode / tikz .code:n = \bool_gset_true:N \g_TUDa_rule_TikZmode_bool, + mode / TikZ .code:n = \bool_gset_true:N \g_TUDa_rule_TikZmode_bool, +} + +\NewDocumentCommand{\TUDa@makeheadrule}{om}{ + \keys_set:nn {TUDa/rules} { + %TODO maybe package options for default + width=\textwidth, + } + \exp_args:Nnx \keys_set:nn {TUDa/rules} { + mode= \g_TUDarules_default_mode_tl, + color= \g_TUDarules_default_color_tl + } + \IfNoValueF {#1} {\keys_set:nn {TUDa/rules}{#1}} + \box_new:c {#2_box} + \bool_if:NTF \g_TUDa_rule_TikZmode_bool { + \hbox_gset:cn {#2_box} { + \begin{tikzpicture} + \fill[\l_TUDa_headrule_color_tl](0,\c_TUDa_rulesep_dim)rectangle++(\l_TUDa_headrule_width_dim,\c_TUDa_largerule_dim); + \fill(0,0)rectangle(\l_TUDa_headrule_width_dim,-\c_TUDa_smallrule_dim); + \end{tikzpicture} + } + }{ + \hbox_gset:cn {#2_box} { + \parbox[t]{\l_TUDa_headrule_width_dim}{ + \setlength{\baselineskip}{\z@} + \null\par\nointerlineskip + \textcolor{\l_TUDa_headrule_color_tl}{\rule{\linewidth}{\c_TUDa_largerule_dim}} + \vspace{\c_TUDa_rulesep_dim}\par\nointerlineskip + \rule{\linewidth}{\c_TUDa_smallrule_dim} + } + } + } + \cs_new:cpn {#2} {\box_use:c {#2_box}} +} + +\NewDocumentCommand{\TUDa@makefootrule}{om}{ + \keys_set:nn {TUDa/rules} { + width= \linewidth + } + \IfNoValueF {#1} {\keys_set:nn {TUDa/rules}{#1}} + \box_new:c {#2_box} + \hbox_gset:cn {#2_box} { + \raisebox{-\height}{\rule{\l_TUDa_headrule_width_dim}{.5\c_TUDa_smallrule_dim}} + } + \cs_new:cpn {#2} {\box_use:c {#2_box}} +} + + +%DL | 3.5mm | 1.4mm | 1.2pt | 17 mm | 0.6pt| 10mm | 14mm | +%A6 | 3 mm | 1.4mm | 1.2pt | 16.5mm | 0.6pt| 10mm | 15mm | +%A5 | 3.3mm | 1.4mm | 1.2pt | 19 mm | 0.6pt| 12mm | 16mm | +%A4 | 4 mm | 1.4mm | 1.2pt | 22 mm | 0.6pt| 15mm | 20mm | +%A3 | 4.5mm | 1.4mm | 1.2pt | 24.5mm | 0.6pt| 15mm | 20mm | +%A2 | 8 mm | 2.5mm | 2.2pt | 44.5mm | 1.1pt| 30mm | 35mm | +%A1 | 10 mm | 3.0mm | 2.8pt | 55.5mm | 1.4pt| 30mm | 35mm | +%A0 | 16 mm | 5.2mm | 4.8pt | 80 mm | 2.4pt| 30mm | 35mm | +%punched a4 = inner, bottom=20mm top outer =15mm +\endinput |