diff options
author | Karl Berry <karl@freefriends.org> | 2022-04-04 20:54:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-04-04 20:54:49 +0000 |
commit | 656055251bead88e4d7e7d685722255033367f49 (patch) | |
tree | 6c5f28eb221ee4213fc5ef8b6211eb464f5992a2 /Master/texmf-dist/tex/latex/projlib/projlib-titlepage.sty | |
parent | 4ca1cb3da46997c41eff1ae88aad0d090f717b3c (diff) |
jxu (4apr22)
git-svn-id: svn://tug.org/texlive/trunk@62900 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/projlib/projlib-titlepage.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/projlib/projlib-titlepage.sty | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/projlib/projlib-titlepage.sty b/Master/texmf-dist/tex/latex/projlib/projlib-titlepage.sty new file mode 100644 index 00000000000..b9b05b7ce15 --- /dev/null +++ b/Master/texmf-dist/tex/latex/projlib/projlib-titlepage.sty @@ -0,0 +1,116 @@ +%% +%% This is file `projlib-titlepage.sty', +%% generated with the docstrip utility. + +%% Copyright (C) 2021-2022 by Jinwen XU +%% +%% This is part of the ProjLib Toolkit. +%% +%% 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 + {projlib-titlepage} + {2022/04/03} {} + {Commands for rendering the title page} + +\keys_define:nn { projlib-titlepage } + { + , unknown .code:n = {} + } +\ProcessKeysOptions { projlib-titlepage } + +\RequirePackage { projlib-paper } + +\RequirePackage { tikz } +\ExplSyntaxOff +\usetikzlibrary { calc } +\ExplSyntaxOn + +\tl_new:N \l_projlib_titlepage_logo_tl +\tl_new:N \l_projlib_titlepage_title_tl +\tl_new:N \l_projlib_titlepage_subtitle_tl +\tl_new:N \l_projlib_titlepage_author_tl +\tl_new:N \l_projlib_titlepage_date_tl +\tl_new:N \l_projlib_titlepage_style_tl + +\NewDocumentCommand \ProjLibTitlePage { O{} m } + { + \keys_set:nn { projlib-titlepage-config } { #1 } + \projlib_titlepage_render:n { #2 } + } +\ProvideDocumentCommand \TitlePage { O{} m } + { + \ProjLibTitlePage [ #1 ] { #2 } + } + +\cs_new_protected:Nn \projlib_titlepage_set_color:nn + { + \colorlet { titlepage- #1 } { #2 } + } + +\keys_define:nn { projlib-titlepage-config } + { + , logo .tl_set:N = \l_projlib_titlepage_logo_tl + , logo .initial:n = { \scalebox { 2 } { \ProjLib } } + , title .tl_set:N = \l_projlib_titlepage_title_tl + , subtitle .tl_set:N = \l_projlib_titlepage_subtitle_tl + , author .tl_set:N = \l_projlib_titlepage_author_tl + , date .tl_set:N = \l_projlib_titlepage_date_tl + , style .tl_set:N = \l_projlib_titlepage_style_tl + , style .initial:n = { default } + , color .code:n = { + \keyval_parse:nnn + { \use_none:n } + { \projlib_titlepage_set_color:nn } + { #1 } + } + , unknown .code:n = {} + } + +\colorlet { titlepage-main } { blue!50!cyan!50!black } +\colorlet { titlepage-back } { blue!50!cyan!10!yellow!30 } + +\cs_new_protected:Nn \projlib_titlepage_render:n + { + \keys_set:nn { projlib-titlepage-config } { #1 } + \begin { titlepage } + \cs_if_exist_use:c { projlib_titlepage_render_with_style_ \l_projlib_titlepage_style_tl : } + \end { titlepage } + \setcounter { page } { 0 } + } + +\cs_new_protected:Nn \projlib_titlepage_render_with_style_default: + { + \begin{tikzpicture}[overlay,remember~picture] + \fill [color=titlepage-main] ($(current~page.south~west)$) rectangle ($(current~page.north~east)+(0,-.3\paperheight)$); + \fill [color=titlepage-back] ($(current~page.south~west)$) rectangle ($(current~page.north~west)+(.125\paperwidth,-.3\paperheight)$); + \fill [color=titlepage-main] ($(current~page.north~west)$) rectangle ($(current~page.north~west)+(.125\paperwidth,-.3\paperheight)$); + \fill [color=titlepage-back] ($(current~page.north~east)$) rectangle ($(current~page.north~west)+(.125\paperwidth,-.3\paperheight)$); + \node[text~width=.3\paperwidth,text~height=.2\paperheight] at ($(current~page.north~west)+(.32\paperwidth,-.17\paperheight)$) { \l_projlib_titlepage_logo_tl }; + \node[text~width=.4\paperwidth,text~height=.3\paperheight,scale=2.5] at ($(current~page.north~west)+(.67\paperwidth,-.15\paperheight)$) {\textcolor{titlepage-back}{\sffamily\textsc{ \l_projlib_titlepage_title_tl }\\[.5em]\footnotesize{ \l_projlib_titlepage_subtitle_tl }}}; + \node[text~width=.3\paperwidth,text~height=.3\paperheight] at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) {\color{titlepage-back}\begin{flushright}\fontsize{16pt}{0pt}\selectfont\textsc{ \l_projlib_titlepage_author_tl }\\[1em]\fontsize{12pt}{0pt}\selectfont \l_projlib_titlepage_date_tl \end{flushright} }; + \end{tikzpicture} + } + +\cs_new_protected:Nn \projlib_titlepage_render_with_style_simple: + { + \begin{tikzpicture}[overlay,remember~picture] + \fill[color=titlepage-main] ($(current~page.south~west)$) rectangle ($(current~page.north~east)+(0,-.3\paperheight)$); + \node[text~width=.3\paperwidth,text~height=.2\paperheight] at ($(current~page.north~west)+(.28\paperwidth,-.15\paperheight)$) { \l_projlib_titlepage_logo_tl }; + \node[text~width=.4\paperwidth,text~height=.3\paperheight,scale=2.5] at ($(current~page.north~west)+(.63\paperwidth,-.15\paperheight)$) {\textcolor{paper}{\sffamily\textsc{ \l_projlib_titlepage_title_tl }\\[.5em]\footnotesize{ \l_projlib_titlepage_subtitle_tl }}}; + \node[text~width=.3\paperwidth,text~height=.3\paperheight] at ($(current~page.south)+(.2\paperwidth,.3\paperheight)$) {\color{paper}\begin{flushright}\fontsize{16pt}{0pt}\selectfont\textsc{ \l_projlib_titlepage_author_tl }\\[1em]\fontsize{12pt}{0pt}\selectfont \l_projlib_titlepage_date_tl \end{flushright} }; + \end{tikzpicture} + } + +\endinput +%% +%% End of file `projlib-titlepage.sty'. |