summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/yb-book
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-05-23 03:00:46 +0000
committerNorbert Preining <norbert@preining.info>2023-05-23 03:00:46 +0000
commitd470efdd8b7b603d5d048f896fa1dce095a3e245 (patch)
tree9ef898fa049e63d1e6afe68840871c19ca41df08 /macros/latex/contrib/yb-book
parentaaab1b0cf810d8f8df45d972eb51da24a0114047 (diff)
CTAN sync 202305230300
Diffstat (limited to 'macros/latex/contrib/yb-book')
-rw-r--r--macros/latex/contrib/yb-book/DEPENDS.txt2
-rw-r--r--macros/latex/contrib/yb-book/yb-book.dtx107
-rw-r--r--macros/latex/contrib/yb-book/yb-book.pdfbin283982 -> 284729 bytes
3 files changed, 57 insertions, 52 deletions
diff --git a/macros/latex/contrib/yb-book/DEPENDS.txt b/macros/latex/contrib/yb-book/DEPENDS.txt
index caa266e1d2..6d00722666 100644
--- a/macros/latex/contrib/yb-book/DEPENDS.txt
+++ b/macros/latex/contrib/yb-book/DEPENDS.txt
@@ -1,5 +1,7 @@
hard pgf
+hard pgfopts
hard xkeyval
+hard textpos
hard geometry
hard anyfontsize
hard chngcntr
diff --git a/macros/latex/contrib/yb-book/yb-book.dtx b/macros/latex/contrib/yb-book/yb-book.dtx
index 49953412a4..105aec54c1 100644
--- a/macros/latex/contrib/yb-book/yb-book.dtx
+++ b/macros/latex/contrib/yb-book/yb-book.dtx
@@ -50,7 +50,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{yb-book}
%<*class>
-[19.05.20230 0.2.1 YB Branded Book Style]
+[22.05.20230 0.3.0 YB Branded Book Style]
%</class>
%<*driver>
\documentclass{ltxdoc}
@@ -245,28 +245,27 @@ Hello, world!
% \changes{v0.1.0}{2022/01/09}{Initial version}
% \changes{v0.2.0}{2022/10/02}{Started using l3build}
-% First, we use |xkeyval| package for package options parsing:
+% First, we parse package options:
+% \changes{v0.3.0}{2023/05/22}{The \texttt{pgfopts} package is now used to parse package options.}
% \begin{macrocode}
-\RequirePackage{xkeyval}
-\makeatletter
-\newif\ifyb@draft
-\DeclareOptionX{draft}{\yb@drafttrue}
-\newif\ifyb@compact
-\DeclareOptionX{compact}{\yb@compacttrue}
-\newif\ifyb@manuscript
-\DeclareOptionX{manuscript}{\yb@manuscripttrue}
-\ProcessOptionsX
-\makeatother
+\RequirePackage{pgfopts}
+\pgfkeys{
+ /yb/.cd,
+ draft/.store in=\yb@draft,
+ compact/.store in=\yb@compact,
+ manuscript/.store in=\yb@manuscript,
+}
+\ProcessPgfPackageOptions{/yb}
% \end{macrocode}
% Then, depending on the options like |draft| and |manuscript|, we preset
% options of the class |book| and then load it:
% \begin{macrocode}
-\makeatletter\ifyb@draft
+\makeatletter\ifdefined\yb@draft
\PassOptionsToClass{11pt}{book}
\PassOptionsToClass{oneside}{book}
\else
- \ifyb@manuscript
+ \ifdefined\yb@manuscript
\PassOptionsToClass{12pt}{book}
\PassOptionsToClass{oneside}{book}
\else
@@ -283,10 +282,10 @@ Hello, world!
\RequirePackage{geometry}
\geometry{paperwidth=6in, paperheight=9in, bindingoffset=0.25in,
left=0.75in, right=0.75in, top=0.75in, bottom=1.25in}
-\makeatletter\ifyb@draft
+\makeatletter\ifdefined\yb@draft
\geometry{a4paper, margin=1in, left=1.5in}
\else
- \ifyb@manuscript
+ \ifdefined\yb@manuscript
\geometry{a4paper, margin=1.2in}
\fi
\fi\makeatother
@@ -336,9 +335,9 @@ Hello, world!
% \begin{macrocode}
\RequirePackage{setspace}
\setstretch{1.2}
- \makeatletter\ifyb@draft\setstretch{1.1}\fi\makeatother
- \makeatletter\ifyb@compact\setstretch{1.0}\fi\makeatother
- \makeatletter\ifyb@manuscript\setstretch{1.1}\fi\makeatother
+ \makeatletter\ifdefined\yb@draft\setstretch{1.1}\fi\makeatother
+ \makeatletter\ifdefined\yb@compact\setstretch{1.0}\fi\makeatother
+ \makeatletter\ifdefined\yb@manuscript\setstretch{1.1}\fi\makeatother
% \end{macrocode}
% \end{macro}
@@ -384,7 +383,7 @@ Hello, world!
% \begin{macro}{microtype}
% Then, we include |microtype| for better rendering:
% \begin{macrocode}
-\makeatletter\ifyb@draft\else
+\makeatletter\ifdefined\yb@draft\else
\RequirePackage[letterspace=-50]{microtype}
\fi\makeatother
% \end{macrocode}
@@ -393,7 +392,7 @@ Hello, world!
% \begin{macro}{libertine}
% Then, we include |libertine|, for a good looking font:
% \begin{macrocode}
-\makeatletter\ifyb@manuscript
+\makeatletter\ifdefined\yb@manuscript
\RequirePackage[tt=false,type1=true]{libertine}
\fi\makeatother
% \end{macrocode}
@@ -404,14 +403,14 @@ Hello, world!
% \begin{macrocode}
\makeatletter
\let\yb@oldsection\section
-\ifyb@draft
+\ifdefined\yb@draft
\RequirePackage[medium]{titlesec}
\else
\RequirePackage[raggedright]{titlesec}
\titlespacing{\section}{0in}{6pt}{6pt}[1in]
\renewcommand\section{\newpage\yb@oldsection}
\fi
-\ifyb@compact
+\ifdefined\yb@compact
\renewcommand\section{\vspace{2em}\yb@oldsection}
\fi
\makeatother
@@ -420,29 +419,33 @@ Hello, world!
% Then, if it's a |draft|, we put a watermark comment:
% \begin{macrocode}
-\makeatletter\ifyb@draft
-\RequirePackage{fancyhdr}
-\pagestyle{fancy}
-\renewcommand\headrulewidth{0pt}
-\renewcommand\footrulewidth{0pt}
-\fancyhf{}
-\fancyhead[L,C,LO,CO]{}
-\fancyhead[R,RO]{
- \begin{textblock}{4}(11.5,1)
- \tikz \node [color=gray, rotate=270,font=\ttfamily\scriptsize, text width=5in] at (0,0) {
- Copyright \textcopyright{} \the\year{} by \theauthor{}.
- All rights reserved. No part of the contents of
- this book may be reproduced or transmitted in any
- form or by any means without the written permission
- of the publisher. This particular manuscript is
- printed for \textbf{\thereviewer{}} and may be used only
- for one-time review. The manuscript has to be destroyed
- after the review.
- }
- \end{textblock}
-}
-\fancyfoot[C,CO]{\small\ttfamily
- page \#\thepage{} of \pageref{LastPage}}
+\makeatletter\ifdefined\yb@draft
+ \RequirePackage[absolute]{textpos}
+ \TPGrid{16}{16}
+ \RequirePackage{fancyhdr}
+ \pagestyle{fancy}
+ \renewcommand\headrulewidth{0pt}
+ \renewcommand\footrulewidth{0pt}
+ \setlength{\headheight}{16pt}
+ \fancyhf{}
+ \fancyhead[L,C,LO,CO]{}
+ \fancyhead[R,RO]{
+ \begin{textblock}{4}(11.5,1)
+ \tikz \node [color=gray, rotate=270,
+ font=\ttfamily\scriptsize, text width=5in] at (0,0) {
+ Copyright \textcopyright{} \the\year{} by \theauthor{}.
+ All rights reserved. No part of the contents of
+ this book may be reproduced or transmitted in any
+ form or by any means without the written permission
+ of the publisher. This particular manuscript is
+ printed for \textbf{\thereviewer{}} and may be used only
+ for one-time review. The manuscript has to be destroyed
+ after the review.
+ };
+ \end{textblock}
+ }
+ \fancyfoot[C,CO,CE]{\small\ttfamily
+ page \#\thepage{} of \pageref{LastPage}}
\fi\makeatother
% \end{macrocode}
@@ -472,7 +475,7 @@ Hello, world!
% Then, we define |\ybPrintTitlePage| command:
% \begin{macrocode}
\makeatletter\newcommand\ybPrintTitlePage{
- \ifyb@draft\else
+ \ifdefined\yb@draft\else
\begin{titlepage}
\ttfamily
\vspace*{\fill}
@@ -502,8 +505,8 @@ Hello, world!
% Then, we define |ybPrintTOC| command to print table of contents:
% \begin{macrocode}
\makeatletter\newcommand\ybPrintTOC{
- \ifyb@draft\else
- \ifyb@compact\else\cleardoublepage\fi
+ \ifdefined\yb@draft\else
+ \ifdefined\yb@compact\else\cleardoublepage\fi
{\setstretch{0.7}\tableofcontents}
\fi
}\makeatother
@@ -518,7 +521,7 @@ Hello, world!
\makeindex
\indexsetup{othercode={\hyphenpenalty=10000}}
\makeatletter\newcommand\ybPrintIndex[1][Index]{
- \ifyb@draft\else
+ \ifdefined\yb@draft\else
\cleardoublepage
{
\setstretch{1.0}
@@ -568,7 +571,7 @@ Hello, world!
``#1''\\\raggedleft---#2 #3%
\fi%
}
- \ifyb@draft%
+ \ifdefined\yb@draft%
\begin{wrapfigure}{r}{0.4\textwidth}%
\begin{mdframed}[style=quoteodd]%
\yb@body%
@@ -610,7 +613,7 @@ Hello, world!
\makeatletter\newcommand\ybPrintBibliography{%
\AtNextBibliography{\small}%
\raggedright%
- \ifyb@manuscript%
+ \ifdefined\yb@manuscript%
\setlength\bibitemsep{0pt}%
\newpage%
\begin{multicols}{2}
diff --git a/macros/latex/contrib/yb-book/yb-book.pdf b/macros/latex/contrib/yb-book/yb-book.pdf
index e12566d90c..75d400f858 100644
--- a/macros/latex/contrib/yb-book/yb-book.pdf
+++ b/macros/latex/contrib/yb-book/yb-book.pdf
Binary files differ