Skip to content

Commit

Permalink
#23 draft renamed to authordraft
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 23, 2024
1 parent 7121e37 commit c9f4987
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions yb-book.dtx
Expand Up @@ -127,7 +127,7 @@ Hello, world!
% printing on paper for review purposes.
% \end{macro}

% \begin{macro}{draft}
% \begin{macro}{authordraft}
% When it's a draft for reviewers (the page size is A4)
% and you want to have a watermark and a compact form of the content. This
% option goes together with |\thereviewer{}| command, which you may redefine,
Expand All @@ -137,7 +137,7 @@ Hello, world!
%<*verb>
%\fi
\begin{verbatim}
\documentclass[draft]{yb-book}
\documentclass[authordraft]{yb-book}
\renewcommand*\thereviewer{Walter Sobchak}
\begin{document}
Hello, world!
Expand Down Expand Up @@ -251,17 +251,17 @@ Hello, world!
\RequirePackage{pgfopts}
\pgfkeys{
/yb/.cd,
draft/.store in=\yb@draft,
authordraft/.store in=\yb@authordraft,
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
% Then, depending on the options like |authordraft| and |manuscript|, we preset
% options of the class |book| and then load it:
% \begin{macrocode}
\makeatletter\ifdefined\yb@draft
\makeatletter\ifdefined\yb@authordraft
\PassOptionsToClass{11pt}{book}
\PassOptionsToClass{oneside}{book}
\else
Expand All @@ -282,7 +282,7 @@ 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\ifdefined\yb@draft
\makeatletter\ifdefined\yb@authordraft
\geometry{a4paper, margin=1in, left=1.5in}
\else
\ifdefined\yb@manuscript
Expand Down Expand Up @@ -335,7 +335,7 @@ Hello, world!
% \begin{macrocode}
\RequirePackage{setspace}
\setstretch{1.2}
\makeatletter\ifdefined\yb@draft\setstretch{1.1}\fi\makeatother
\makeatletter\ifdefined\yb@authordraft\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}
Expand Down Expand Up @@ -383,7 +383,7 @@ Hello, world!
% \begin{macro}{microtype}
% Then, we include |microtype| for better rendering:
% \begin{macrocode}
\makeatletter\ifdefined\yb@draft\else
\makeatletter\ifdefined\yb@authordraft\else
\RequirePackage[letterspace=-50]{microtype}
\fi\makeatother
% \end{macrocode}
Expand All @@ -403,7 +403,7 @@ Hello, world!
% \begin{macrocode}
\makeatletter
\let\yb@oldsection\section
\ifdefined\yb@draft
\ifdefined\yb@authordraft
\RequirePackage[medium]{titlesec}
\else
\RequirePackage[raggedright]{titlesec}
Expand All @@ -417,9 +417,9 @@ Hello, world!
% \end{macrocode}
% \end{macro}

% Then, if it's a |draft|, we put a watermark comment:
% Then, if it's a |authordraft|, we put a watermark comment:
% \begin{macrocode}
\makeatletter\ifdefined\yb@draft
\makeatletter\ifdefined\yb@authordraft
\RequirePackage[absolute]{textpos}
\TPGrid{16}{16}
\RequirePackage{fancyhdr}
Expand Down Expand Up @@ -475,7 +475,7 @@ Hello, world!
% Then, we define |\ybPrintTitlePage| command:
% \begin{macrocode}
\makeatletter\newcommand\ybPrintTitlePage{
\ifdefined\yb@draft\else
\ifdefined\yb@authordraft\else
\begin{titlepage}
\ttfamily
\vspace*{\fill}
Expand Down Expand Up @@ -505,7 +505,7 @@ Hello, world!
% Then, we define |ybPrintTOC| command to print table of contents:
% \begin{macrocode}
\makeatletter\newcommand\ybPrintTOC{
\ifdefined\yb@draft\else
\ifdefined\yb@authordraft\else
\ifdefined\yb@compact\else\cleardoublepage\fi
{\setstretch{0.7}\tableofcontents}
\fi
Expand All @@ -521,7 +521,7 @@ Hello, world!
\makeindex
\indexsetup{othercode={\hyphenpenalty=10000}}
\makeatletter\newcommand\ybPrintIndex[1][Index]{
\ifdefined\yb@draft\else
\ifdefined\yb@authordraft\else
\cleardoublepage
{
\setstretch{1.0}
Expand Down Expand Up @@ -571,7 +571,7 @@ Hello, world!
``#1''\\\raggedleft---#2 #3%
\fi%
}
\ifdefined\yb@draft%
\ifdefined\yb@authordraft%
\begin{wrapfigure}{r}{0.4\textwidth}%
\begin{mdframed}[style=quoteodd]%
\yb@body%
Expand Down

0 comments on commit c9f4987

Please sign in to comment.