summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/PJLpaper.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-19 20:01:31 +0000
committerKarl Berry <karl@freefriends.org>2021-05-19 20:01:31 +0000
commit7ab648a536bdf717c5cdd8b1a4914cb3c4b4cee4 (patch)
tree9d0d8e4fdae6586557b5a9d72b0942ec9d7b0818 /Master/texmf-dist/tex/latex/projlib/PJLpaper.sty
parentcc53a2c30201f9ac5454b948e94340a692aa3ebe (diff)
projlib (19may21)
git-svn-id: svn://tug.org/texlive/trunk@59271 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/projlib/PJLpaper.sty')
-rw-r--r--Master/texmf-dist/tex/latex/projlib/PJLpaper.sty95
1 files changed, 95 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/projlib/PJLpaper.sty b/Master/texmf-dist/tex/latex/projlib/PJLpaper.sty
new file mode 100644
index 00000000000..eb7ee9d55bd
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/projlib/PJLpaper.sty
@@ -0,0 +1,95 @@
+%%
+%% This is file `PJLpaper.sty',
+%% generated with the docstrip utility.
+
+%% Copyright (C) 2021 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]
+\ProvidesPackage{PJLpaper}
+ [2021/05/19 Paper style configuration]
+\RequirePackage{kvoptions}
+\RequirePackage{etoolbox}
+\RequirePackage{ifthen}
+
+\SetupKeyvalOptions{%
+ family = @PJLpaper,
+ prefix = @PJLpaper@,
+ setkeys=\kvsetkeys
+}
+
+\DeclareStringOption[normal]{paperstyle}
+\DeclareVoidOption{yellowpaper}{\kvsetkeys{@PJLpaper}{paperstyle=yellow}}
+\DeclareVoidOption{darkpaper}{\kvsetkeys{@PJLpaper}{paperstyle=dark}}
+\DeclareVoidOption{nordpaper}{\kvsetkeys{@PJLpaper}{paperstyle=nord}}
+\DeclareBoolOption[false]{preview}
+
+\ProcessKeyvalOptions*\relax
+
+%%================================
+%% Preview mode
+%%================================
+\ifdefined\PJLnoPreview\else%
+ \if@PJLpaper@preview%
+ \RequirePackage{calc}
+ \AtEndPreamble{%
+ \setlength{\paperwidth}{\textwidth*\real{1.05}}%
+ \setlength{\paperheight}{%
+ (\textheight+\headheight+\headsep+\footskip)*\real{1.05}}%
+ \setlength{\oddsidemargin}{(\paperwidth-\textwidth)/2-1in}%
+ \setlength{\evensidemargin}{(\paperwidth-\textwidth)/2-1in}%
+ \setlength{\topmargin}{(\paperheight-\textheight-\headheight-\headsep-\footskip)/2- 1in}%
+ }
+ \fi
+\fi
+
+%%================================
+%% Paper color
+%%================================
+\RequirePackage{xcolor}
+\definecolor{paper}{RGB}{255,255,255}
+\definecolor{maintext}{RGB}{0,0,0}
+
+\ifthenelse{\equal{\@PJLpaper@paperstyle}{yellow}}
+{
+ \definecolor{paper}{RGB}{247,246,233}
+}
+{\relax}
+
+\ifthenelse{\equal{\@PJLpaper@paperstyle}{dark}}
+{
+ \definecolor{paper}{RGB}{30,30,30}
+ \definecolor{maintext}{RGB}{207,207,207}
+}
+{\relax}
+
+\ifthenelse{\equal{\@PJLpaper@paperstyle}{nord}}
+{
+ \definecolor{paper}{RGB}{46,52,64}
+ \definecolor{maintext}{RGB}{214,220,230}
+}
+{\relax}
+
+\newcommand{\PJLglobalcolor}[1]{%
+ \color{#1}\global\let\default@color\current@color
+}
+
+\pagecolor{paper}
+\PJLglobalcolor{maintext}
+\ifdefined\tcbset%
+ \tcbset{colupper=maintext,collower=maintext}
+\fi
+
+\endinput
+%%
+%% End of file `PJLpaper.sty'.