summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/yb-book/yb-book.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/yb-book/yb-book.dtx')
-rw-r--r--macros/latex/contrib/yb-book/yb-book.dtx40
1 files changed, 33 insertions, 7 deletions
diff --git a/macros/latex/contrib/yb-book/yb-book.dtx b/macros/latex/contrib/yb-book/yb-book.dtx
index b8fcea6bdc..02695f297a 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>
-[2025/01/05 0.5.1 YB Branded Book Style]
+[2025/01/08 0.6.0 YB Branded Book Style]
%</class>
%<*driver>
\documentclass{ltxdoc}
@@ -253,10 +253,12 @@ Hello, world!
% First, we parse package options:
% \changes{v0.3.0}{2023/05/22}{The \texttt{pgfopts} package is now used to parse package options.}
% \changes{v0.5.0}{2024/01/02}{The \texttt{sparse} package option added, to place every section in a new page.}
+% \changes{v0.6.0}{2025/01/08}{The \texttt{apa} package option added, to enable APA citation style.}
% \begin{macrocode}
\RequirePackage{pgfopts}
\pgfkeys{
/yb/.cd,
+ apa/.store in=\yb@apa,
authordraft/.store in=\yb@authordraft,
compact/.store in=\yb@compact,
manuscript/.store in=\yb@manuscript,
@@ -311,6 +313,11 @@ Hello, world!
% \end{macrocode}
% \end{macro}
+% Then, we load \href{https://ctan.org/pkg/href-ul}{href-ul} to underline links correctly:
+% \begin{macrocode}
+\RequirePackage{href-ul}
+% \end{macrocode}
+
% Then, we load \href{https://ctan.org/pkg/anyfontsize}{anyfontsize} to enable all sizes of fonts:
% \begin{macrocode}
\RequirePackage{anyfontsize}
@@ -407,9 +414,18 @@ Hello, world!
% \begin{macro}{biblatex}
% Then, we configure |biblatex|, for citation management:
% \begin{macrocode}
-\RequirePackage[indexing=cite,style=authoryear,
- natbib=true,maxnames=1,minnames=1,doi=false,
- url=false,isbn=false,isbn=false]{biblatex}
+\PassOptionsToPackage{indexing=cite,
+ natbib=true,maxnames=2,minnames=1,doi=true,
+ url=false,isbn=false,isbn=false}{biblatex}
+\makeatletter
+\ifdefined\yb@apa
+ \PassOptionsToPackage{style=authoryear}{biblatex}
+\else
+ \PassOptionsToPackage{style=numeric}{biblatex}
+\fi
+\makeatother
+\RequirePackage{doi}
+\RequirePackage{biblatex}
\DeclareCiteCommand{\citetitle}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
@@ -476,7 +492,7 @@ Hello, world!
\else
\RequirePackage[raggedright]{titlesec}
\titlespacing{\section}{0in}{6pt}{6pt}[1in]
- \renewcommand\section{\yb@secstart\newpage\yb@oldsection}
+ \renewcommand\section{\yb@secstart\yb@oldsection}
\fi
\ifdefined\yb@compact
\renewcommand\section{\yb@secstart\vspace{2em}\yb@oldsection}
@@ -499,9 +515,19 @@ Hello, world!
\fancyhf{}
\fancyhead[L,C,LO,CO]{}
\fancyhead[R,RO]{
+ \begin{textblock}{16}[0.5,0.5](8,8)%
+ \tikz \node[minimum width=16\TPHorizModule] {%
+ \fontsize{64}{64}\selectfont\bfseries%
+ \rotatebox{45}{
+ \tikz \node
+ [fill=gray!8, font=\ttfamily\color{white}]
+ {it is a draft};%
+ }%
+ };%
+ \end{textblock}%
\begin{textblock}{4}(11.5,1)%
\tikz \node [color=gray, rotate=270,
- font=\ttfamily\scriptsize, text width=5in] at (0,0) {%
+ font=\ttfamily\scriptsize, text width=8in] 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
@@ -513,7 +539,7 @@ Hello, world!
};
\end{textblock}
}
- \fancyfoot[C,CO,CE]{\small\ttfamily%
+ \fancyfoot[C,CO,C]{\small\ttfamily%
page \#\thepage{} of \pageref{LastPage}}
\fi
\makeatother