diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/nostarch/nostarch.cls | 625 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nostarch/nshyper.sty | 2 |
2 files changed, 525 insertions, 102 deletions
diff --git a/Master/texmf-dist/tex/latex/nostarch/nostarch.cls b/Master/texmf-dist/tex/latex/nostarch/nostarch.cls index 2bfbe9cb046..fdb987796db 100644 --- a/Master/texmf-dist/tex/latex/nostarch/nostarch.cls +++ b/Master/texmf-dist/tex/latex/nostarch/nostarch.cls @@ -37,11 +37,15 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{nostarch} -[2008/06/06 v1.3 Typesetting books for No Starch Press] +[2023/03/30 v2.0 Typesetting books for No Starch Press] \newif\ifnostarch@cfonts \nostarch@cfontstrue \DeclareOption{cfonts}{\nostarch@cfontstrue} \DeclareOption{nocfonts}{\nostarch@cfontsfalse} +\newif\ifnostarch@fontsdir +\nostarch@fontsdirtrue +\DeclareOption{fontsdir}{\nostarch@fontsdirtrue} +\DeclareOption{nofontsdir}{\nostarch@fontsdirfalse} \long\def\nostarch@size@warning#1{% \ClassWarning{nostarch}{Size-changing option #1 will not be honored}}% @@ -58,22 +62,148 @@ Configuration file nostarch.cfg is not found}} \ProcessOptions\relax \LoadClass[10pt]{book} -\RequirePackage{ifpdf, fancyhdr, fancyvrb, booktabs, graphicx, - listings, caption, makeidx, upquote} +\RequirePackage[table]{xcolor} +\RequirePackage{iftex, ifpdf, fancyhdr, fancyvrb, booktabs, graphicx, + listings, caption, makeidx, upquote, pifont, + textcomp, xcolor, lmodern, nameref, float, amssymb, etoolbox, + setspace, marginnote} +\RequirePackage[framemethod=TikZ]{mdframed} +\RequirePackage{soul} +\RequirePackage[T1]{fontenc} +\RequirePackage{ragged2e} \RequirePackage{ragged2e} \setlength\RaggedRightParindent{\parindent} \RaggedRight \def\@nschapterpreamble{} +\ifnostarch@fontsdir + \def\nostarch@fontspath#1{Path=fonts/#1/,} +\else + \def\nostarch@fontspath#1{Path,} +\fi \ifnostarch@cfonts - \RequirePackage{nbaskerv}% - \RequirePackage{futurans}% - \RequirePackage[scaled=0.85]{thsmc}% - \RequirePackage{dogma}% - \newcommand{\dgdefault}{fdg}% + \ifpdftex + \ClassWarning{nostarch}{Commercial fonts usually require xelatex engine} + \RequirePackage{nbaskerv}% + \RequirePackage{futurans}% + \RequirePackage[scaled=0.85]{thsmc}% + \RequirePackage{dogma}% + \newcommand{\dogma}{\fontfamily{fdg}\selectfont}% + \else %XeTeX or LuaTeX + \RequirePackage{fontspec} + \newfontface\dogma[ + \nostarch@fontspath{dogma} + UprightFont=dogmab01.ttf, + Ligatures=TeX + ]{dogma} % Font used for chapter titles + + \newfontface\timesnewroman[ + \nostarch@fontspath{tnr} + UprightFont=times.ttf, + BoldFont=timesbd.ttf, + ItalicFont=timesi.ttf, + BoldItalicFont=timesbi.ttf, + Ligatures=TeX + ]{timesnewroman} + + \newfontface\futurabook[ + \nostarch@fontspath{futurans} + UprightFont=FuturB37.ttf, + BoldFont=FuturH79.ttf, + ItalicFont=FutuBO08.ttf, + BoldItalicFont=FutCBO63.ttf, + Ligatures=TeX + ]{futurabook} + + \newfontface\futuraheavy[ + \nostarch@fontspath{futurans} + UprightFont=FuturH79.ttf, + Ligatures=TeX + ]{futuraheavy} + + \newfontface\futuraboldc[ + \nostarch@fontspath{futurans} + UprightFont=futucb18.ttf, + Ligatures=TeX + ]{futuraboldc} + + \newfontface\futuraboldcoblique[ + \nostarch@fontspath{futurans} + UprightFont=FutCBO63.ttf, + Ligatures=TeX + ]{futuraboldcoblique} + + \newfontface\futuraoblique[ + \nostarch@fontspath{futurans} + UprightFont=FutuBO08.ttf, + Ligatures=TeX + ]{futuraoblique} + + \setmainfont{nbaskerv}[ + \nostarch@fontspath{nbaskerv} + UprightFont=NewBaskervilleEF-Roman.ttf, + BoldFont=NewBaskervilleEF-Bold.ttf, + ItalicFont=NewBaskervilleEF-RomanIta.ttf, + BoldItalicFont=NewBaskervilleEF-BoldIta.ttf, + Ligatures=TeX] + + \setmonofont[Scale=0.85, + \nostarch@fontspath{thsmc} + UprightFont=ThSMCP25.ttf, + BoldFont=ThSMCB02.ttf, + ItalicFont=ThSMCI29.ttf, + BoldItalicFont=TSMCBI56.ttf]{thsmc} + + \setsansfont[ + \nostarch@fontspath{futurans} + UprightFont=futura.ttf, + BoldFont=FuturB41.ttf, + ItalicFont=FutuBO08.ttf, + BoldItalicFont=FutCBO63.ttf, + Ligatures=TeX + ]{futurans} + + \fi \else \newcommand{\dgdefault}{\sfdefault}% \fi +\providecommand{\dogma}{\fontfamily{dgdefault}\selectfont} +\providecommand{\futuraboldc}{\fontfamily{\sfdefault}\fontseries{bc}% + \selectfont} +\providecommand{\futuraboldcoblique}{\fontfamily{\sfdefault}\fontseries{bc}% + \itshape\selectfont} +\providecommand{\futuraheavy}{\fontfamily{\sfdefault}\fontseries{hq}% + \selectfont} +\providecommand{\futurabook}{\fontfamily{\sfdefault}\fontseries{k}% + \selectfont} \normalsize +\newcommand{\wingding}[1]{\ding{\the\numexpr #1 + 181 \relax}} +\newcommand{\codewingding}[1]{\vbox{\llap{\wingding{#1}\hskip 0.5em}}} +\newcommand\menuarrow{\raisebox{.2ex}{\small $\blacktriangleright$}} +\newcommand{\bettertilde}{\raisebox{-1ex}{\textasciitilde}} +\newcommand{\slashslash}{% + \raisebox{.53ex}{% + \scalebox{.5}{% + \rotatebox[origin=c]{18}{$\mathbf{/}$}% + }% + }% +} +\renewcommand{\neq}{\mathrel + {% + \vphantom{=}% + \ooalign{\kern.05em\smash{\slashslash}\hidewidth\cr$=$\cr}% + }% +} + +\newcommand\keycap[1]{\fauxschelper#1 \relax\relax} +\def\fauxschelper#1 #2\relax{% + \fauxschelphelp#1\relax\relax% + \if\relax#2\relax\else\ \fauxschelper#2\relax\fi% +} +\def\Hscale{.83}\def\Vscale{.72}\def\Cscale{1.00} +\def\fauxschelphelp#1#2\relax{% + \ifnum`#1>``\ifnum`#1<`\{\scalebox{\Hscale}[\Vscale]{\uppercase{#1}}\else% + \scalebox{\Cscale}[1]{#1}\fi\else\scalebox{\Cscale}[1]{#1}\fi% + \ifx\relax#2\relax\else\fauxschelphelp#2\relax\fi} \setlength{\paperheight}{9.25in} \setlength{\paperwidth}{7in} \ifpdf\relax @@ -107,6 +237,10 @@ \widowpenalty=10000 \clubpenalty=10000 \raggedbottom +\sodef\sochapter{}{.150em}{.5em}{1em} +\sodef\sotitle{}{.125em}{.5em}{1em} +\sodef\sobox{}{.075em}{.5em}{1em} +\sodef\sonote{}{.200em}{.5em}{1em} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} \pagestyle{fancy} @@ -114,15 +248,15 @@ \rhead{} \chead{} \fancyhfoffset[L]{1in} -\fancyfoot[RO]{\fontfamily{\sfdefault}\fontsize{6pt}{6pt}% +\fancyfoot[RO]{\sffamily \fontsize{6pt}{6pt}% \fontseries{lq}\selectfont\rightmark% - \hspace{2em}\fontseries{bc}\fontsize{9pt}{6pt}\selectfont\thepage} + \hspace{2em} \futuraboldc \fontsize{9pt}{6pt}\selectfont\thepage} \fancyfoot[LO]{} \fancyfoot[CO]{} -\fancyfoot[LE]{\fontfamily{\sfdefault}\fontseries{bc}\fontsize{9pt}{6pt}% - \selectfont\thepage\hspace{2em}% - \fontseries{lq}\fontsize{6pt}{6pt}\selectfont% - \leftmark} +\fancyfoot[LE]{\futuraboldc \fontsize{9pt}{6pt}% + \selectfont\thepage% + \fontseries{lq}\sffamily \fontsize{6pt}{6pt}\selectfont% + \hspace{2em}\leftmark} \fancyfoot[RE]{} \fancyfoot[CE]{} \newcommand{\subtitle}[1]{\gdef\@subtitle{#1}} @@ -135,12 +269,11 @@ \clearpage {\pagestyle{empty}\cleardoublepage}% \thispagestyle{empty}% - \null\vskip1.025in% + \null%\vskip1.025in% \leavevmode\noindent\hspace{1.66in}% \begin{minipage}[t]{2.5625in}% \flushright - \fontfamily{\sfdefault}\fontseries{b}% - \fontsize{12\p@}{13\p@}\selectfont + \sffamily\bfseries\fontsize{12\p@}{13\p@}\selectfont \MakeUppercase{\@title}% \end{minipage}} \def\maketitle{% @@ -155,18 +288,18 @@ \item\relax \centering \null\vskip0.855in% - {\fontfamily{\dgdefault}\fontseries{bk}\fontsize{36\p@}{37\p@}\selectfont - \MakeUppercase{\@title}\par}% + {\dogma \fontsize{36\p@}{37\p@}\selectfont + \MakeUppercase{\sotitle{\@title}}\par}% \if\@subtitle\@empty\relax\else {\null\vskip25\p@% - \fontfamily{\dgdefault}\fontseries{bq}\fontsize{24\p@}{25\p@}\selectfont + \dogma \fontsize{24\p@}{25\p@}\selectfont \@subtitle\par}% \fi - \vspace{1.7in}% + \vspace{2.15in}% \vspace{-\baselineskip}% - {\fontfamily{\sfdefault}\fontseries{hq}\fontsize{18\p@}{22\p@}\selectfont + {\futuraheavy\fontsize{18\p@}{22\p@}\selectfont by \@author\par}% - \vspace{0.45in}% + \vspace{12\p@}% \vspace{\baselineskip}% \if\@nostarchlogo\@empty\relax\else \includegraphics[height=1.08in]{\@nostarchlogo}\par @@ -195,16 +328,24 @@ \parindent\z@\parfillskip\@flushglue\parskip\z@skip}{\par\vskip8pt\relax} \newenvironment{dedicationpage}{% \clearpage - {\pagestyle{empty}\cleardoublepage}% + \bgroup + \list{}{\leftmargin-1in\rightmargin\z@\labelwidth\z@% + \labelsep\z@\listparindent\z@\parsep8\p@\itemsep\z@% + \topsep\z@\partopsep\z@}% + \item\relax \thispagestyle{empty}% \null\vskip1.175in% - \centering\normalfont}{\clearpage} -\def\briefcontentsname{Brief Contents} + \centering\normalfont}{% + \endlist + \egroup + \clearpage} +\def\briefcontentsname{{Brief Contents}} \def\contentsname{Contents in Detail}% \AtBeginDocument{\@ifpackageloaded{babel}{% \addto\captionsenglish{% \renewcommand{\contentsname}% {Contents in Detail}}}{}} +\newcommand{\apptoc}{\renewcommand{\chaptername}{Appendix}} \newcommand\brieftableofcontents{% \clearpage {\pagestyle{empty}\cleardoublepage}% @@ -217,8 +358,8 @@ \topsep\z@\partopsep\z@}% \item\relax {\centering - \fontfamily{\dgdefault}\fontseries{bs}\fontsize{16\p@}{18\p@}\selectfont - \MakeUppercase{\briefcontentsname}\par}\vskip40pt% + \dogma\fontsize{16\p@}{18\p@}\selectfont + \MakeUppercase{\sochapter{Brief Contents}}\par}\vskip40pt% \@starttoc{tbc}% \endlist \egroup} @@ -234,8 +375,8 @@ \topsep\z@\partopsep\z@}% \item\relax {\centering - \fontfamily{\dgdefault}\fontseries{bs}\fontsize{16\p@}{18\p@}\selectfont - \MakeUppercase{\contentsname}\par}\vskip18pt% + \dogma\fontsize{16\p@}{18\p@}\selectfont + \MakeUppercase{\sochapter{Contents in Detail}}\par}\vskip18pt% \@starttoc{toc}% \endlist \egroup} @@ -248,7 +389,7 @@ \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth {\leavevmode - \fontfamily{\sfdefault}\fontseries{bq}\fontsize{12\p@}{14\p@}\selectfont + \sffamily\bfseries\fontsize{12\p@}{14\p@}\selectfont #1}\par \nobreak \global\@nobreaktrue @@ -264,27 +405,35 @@ \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \leavevmode - \fontfamily{\sfdefault}\fontseries{bq}\fontsize{10\p@}{12\p@}\selectfont - #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \sffamily \bfseries \fontsize{10\p@}{12\p@}\selectfont{#1}% + \nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par \vskip4\p@\penalty\@highpenalty \endgroup \fi} \newlength{\sectionnumberwidth} \settowidth{\sectionnumberwidth}{% - \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont + \futurabook\fontsize{9\p@}{11\p@}\selectfont + 99.99} +\newlength{\boldsectionnumberwidth} +\settowidth{\boldsectionnumberwidth}{% + \futuraheavy\fontsize{9\p@}{11\p@}\selectfont 99.99} \newlength{\subsectionnumberwidth} \settowidth{\subsectionnumberwidth}{% - \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont + \futurabook\fontsize{9\p@}{11\p@}\selectfont 99.99.99} \renewcommand{\l@section}[2]{\@dottedtocline{1}{\z@}{% \sectionnumberwidth}{% - \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{% - \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#2}} + \futurabook\fontsize{9\p@}{11\p@}\selectfont#1}{% + \futurabook\fontsize{9\p@}{11\p@}\selectfont#2}} \renewcommand{\l@subsection}[2]{\@dottedtocline{2}{0.5in}% {\subsectionnumberwidth}{% - \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{% - \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#2}} + \futurabook\fontsize{9\p@}{11\p@}\selectfont#1}{% + \futurabook\fontsize{9\p@}{11\p@}\selectfont#2}} +\newcommand*\l@boldsection[2]{{\bfseries\@dottedtocline{1}{\z@}{% + \boldsectionnumberwidth}{% + \futuraheavy\fontsize{9\p@}{11\p@}\selectfont#1}{% + \futuraheavy\fontsize{9\p@}{11\p@}\selectfont#2}}} \newcommand*\l@bpart[2]{% \ifnum \c@tocdepth >-2\relax \addpenalty{-\@highpenalty}% @@ -293,13 +442,14 @@ \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth {\leavevmode - \fontfamily{\sfdefault}\fontseries{h}\fontsize{9\p@}{14\p@}\selectfont + \futuraheavy\fontsize{9\p@}{14\p@}\selectfont #1}\par\vskip7\p@% \nobreak \global\@nobreaktrue \everypar{\global\@nobreakfalse\everypar{}}% \endgroup \fi} +\renewcommand{\@pnumwidth}{17pt} \newcommand*\l@bchapter[2]{% \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% @@ -308,7 +458,7 @@ \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \leavevmode - \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{14\p@}\selectfont + \futurabook\fontsize{9\p@}{14\p@}\selectfont #1\nobreak\leaders\hbox{$\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill @@ -329,6 +479,7 @@ \def\sectionmark#1{}% \newif\if@firstpara \@firstparafalse +\newcommand{\turnoffbigpara}{\@firstparafalse} \def\@chapterart{} \def\secdef#1#2{\@ifstar{\@dblarg{#2}}{\@dblarg{#1}}} \renewcommand\part{% @@ -345,29 +496,29 @@ \refstepcounter{part}% \addcontentsline{toc}{part}{\MakeUppercase{\partname} \thepart\protect\linebreak\penalty\@highpenalty\MakeUppercase{#1}}% - \addcontentsline{tbc}{bpart}{\MakeUppercase{\partname~\thepart: #1}}% + \addcontentsline{tbc}{bpart}{\MakeUppercase{\partname~\thepart: \futuraheavy #1}}% \else \addcontentsline{toc}{part}{\MakeUppercase{#1}}% - \addcontentsline{tbc}{bpart}{\MakeUppercase{#1}}% + \addcontentsline{tbc}{bpart}{\MakeUppercase{\futuraheavy #1}}% \fi {\centering \interlinepenalty \@M \normalfont \ifnum \c@secnumdepth >-2\relax - \fontfamily{\sfdefault}\fontsize{80pt}{80pt}\fontseries{bc}\selectfont + \futuraboldc\fontsize{80pt}{80pt}\selectfont \MakeUppercase{\partname\nobreakspace\thepart}% \par \vskip 0.45in% \fi - \fontfamily{\dgdefault}\fontsize{16pt}{16pt}\fontseries{br}\selectfont - \MakeUppercase{#2}\par}% + \dogma \fontsize{16pt}{16pt}\selectfont + \MakeUppercase{\sochapter{#2}}\par}% \@endpart} \def\@spart[#1]#2{% \addcontentsline{toc}{part}{\MakeUppercase{#1}}% \addcontentsline{tbc}{bpart}{\MakeUppercase{#1}}% {\centering - \fontfamily{\dgdefault}\fontsize{16pt}{16pt}\fontseries{br}\selectfont - \MakeUppercase{#2}\par}% + \dogma \fontsize{16pt}{16pt}\selectfont + \MakeUppercase{\sochapter{#2}}\par}% \@endpart} \def\@endpart{% \@afterindentfalse @@ -396,7 +547,7 @@ \addcontentsline{tbc}{bchapter}{% \chaptername~\thechapter:~#1}% {\centering - \fontfamily{\sfdefault}\fontseries{bc}\fontsize{120pt}{120pt} + \futuraboldc\fontsize{120pt}{120pt} \selectfont \thechapter\par\nobreak\vskip27pt}% \else @@ -406,19 +557,20 @@ \markboth{#1}{#1}% \fi {\centering - \fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont - \MakeUppercase{#2}\par}\nobreak\vskip25pt\relax% + \dogma\fontsize{16pt}{18pt}\selectfont + \MakeUppercase{\sochapter{#2}}\par}\nobreak\vskip25pt\relax% \@firstparatrue \@afterheading}% \def\@schapter[#1]#2{% \vspace*{2.747in} {\centering + \phantomsection \addcontentsline{toc}{chapter}{% \MakeUppercase{#1}}% \addcontentsline{tbc}{bchapter}{#1}% \markboth{#1}{#1}% - {\fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont - \MakeUppercase{#2}\par}}\nobreak\vskip25pt\relax% + {\fontsize{16pt}{18pt}\selectfont + \MakeUppercase{\dogma \sochapter{#2}}\par}}\nobreak\vskip25pt\relax% \@firstparatrue \@afterheading}% \def\@afterheading{% @@ -452,19 +604,55 @@ \normalsize\selectfont \fi \@firstparafalse}}% +\def\chapterwithquote{% + \clearpage + {\pagestyle{empty}\cleardoublepage}% + \everypar{}% + \thispagestyle{empty}% + \global\@topnum\z@ + \@afterindentfalse + \gdef\@chapterart{}% + \secdef\@chapterwithquote\@schapter} +\def\@chapterwithquote[#1]#2#3#4{% + \vspace*{0.622in} + \ifnum \c@secnumdepth > \m@ne + \refstepcounter{chapter}% + \typeout{Chapter:\thechapter\space\@currentlabel}% + \markboth{\@chapapp~\thechapter}{#1}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}{\thechapter% + \protect\linebreak\penalty\@highpenalty + \MakeUppercase{#1}}% + \addcontentsline{tbc}{bchapter}{% + \chaptername~\thechapter:~#1}% + {\centering + \futuraboldc\fontsize{120pt}{120pt} + \selectfont + \thechapter\par\nobreak\vskip27pt}% + \else + \addcontentsline{toc}{chapter}{% + \MakeUppercase{#1}}% + \addcontentsline{tbc}{bchapter}{#1}% + \markboth{#1}{#1}% + \fi + {\centering + \dogma\fontsize{16pt}{18pt}\selectfont + \MakeUppercase{\sochapter{#2}}\par\vspace{.1in}\normalfont\fontsize{9pt}{11pt}\selectfont\textit{#3}\par\textit{\textemdash#4}\par}\nobreak\vskip25pt\relax% + \@firstparatrue + \@afterheading}% \newcommand{\chapterart}[1]{\gdef\@chapterart{#1}}% \newcommand{\chapterartfile}[1]{\gdef\@chapterart{% \includegraphics[width=1.264in]{#1}}}% \renewcommand{\section}{\everypar{}% \@startsection{section}{1}{-0.75in}{16pt}{6pt}{% - \fontfamily{\sfdefault}\fontseries{b}\fontsize{12pt}{16pt}\selectfont}}% + \sffamily \bfseries \fontsize{12pt}{16pt}\selectfont}}% \renewcommand{\subsection}{\everypar{}% \@startsection{subsection}{2}{0pt}{14pt}{4pt}{% - \fontfamily{\sfdefault}\fontshape{it}% - \fontseries{bc}\fontsize{12pt}{17pt}\selectfont}}% + \futuraboldcoblique + \fontsize{12pt}{17pt}\selectfont}}% \renewcommand{\subsubsection}{\everypar{}% \@startsection{subsubsection}{3}{0pt}{10pt}{2pt}{% - \fontfamily{\sfdefault}\fontseries{bp}\fontsize{10pt}{14pt}% + \futuraboldc \fontsize{10pt}{14pt}% \selectfont}}% \setlength{\leftmargin}{0.25in} \setlength{\leftmargini}{0.25in} @@ -473,7 +661,7 @@ \setlength{\leftmarginiv}{0.25in} \setlength{\rightmargin}{0pt} \def\@listi{\leftmargin\leftmargini - \labelwidth\leftmargin\relax + \labelwidth\leftmargini\relax \advance\labelwidth-\labelsep\relax \parsep0\p@\relax \topsep6\p@\relax @@ -527,6 +715,10 @@ \csname label\@enumctr\endcsname {\usecounter\@enumctr\def\makelabel##1{##1}}% \fi} +\renewenvironment{description}% + {\list{}{\labelwidth=0pt \leftmargin=18pt + \let\makelabel\descriptionlabel}} + {\endlist} \renewenvironment{quotation}{% \list{}{\listparindent\parindent\relax \itemindent\listparindent\relax @@ -540,9 +732,8 @@ \leftmargin0.5in\relax}% \item\fontsize{9pt}{11pt}\selectfont}{\endlist} \newenvironment{note}{% - \list{\makebox[0pt][r]{\fontfamily{% - \dgdefault}\fontseries{b}\fontsize{9pt}{11pt}\selectfont - NOTE\hspace{2em}}}{\listparindent0pt\relax + \list{\makebox[0pt][r]{\dogma \fontsize{7.5pt}{12pt} + \colorbox{black}{\textcolor{white}{\sonote{NOTE}}}\hspace{2em}}}{\listparindent0pt\relax \topsep9\p@\relax \itemindent0\p@\relax \rightmargin0\p@\relax @@ -550,6 +741,14 @@ \labelwidth0\p@\relax \labelsep0\p@}% \item\itshape}{\vspace{-3pt}\endlist} +\newenvironment{plainlist}{% + \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textbf{##1}} % Add em space to description label + \begin{description}% + }{% + \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textbf{##1 \quad}} % Add em space to description label + \end{description}% +} + \renewcommand\footnoterule{% \kern6\p@ \hrule height 0.25pt depth 0pt width 1in @@ -567,35 +766,83 @@ \@makefntext{% \rule\z@{13.5pt}\ignorespaces#1}% \color@endgroup}}% -\setlength{\skip\footins}{16\p@ \@plus 4\p@ \@minus 0\p@} +\setlength{\skip\footins}{20\p@ \@plus 4\p@ \@minus 0\p@} \renewcommand\@makefntext[1]{% - \parindent 0\p@% - \RaggedRightParindent0\p@% - \noindent - \@makefnmark\space#1} +\@thefnmark.~#1} \renewcommand \thefigure {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@figure} \renewcommand \thetable {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@table} -\renewcommand \thelstlisting - {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@lstlisting} -\DeclareCaptionFormat{nostarchfigfmt}{\fontfamily{\sfdefault}% - \fontshape{it}\fontsize{8.5pt}{9pt}\fontseries{k}\selectfont\unskip#1#2#3} -\DeclareCaptionFormat{nostarchtabfmt}{\fontfamily{\sfdefault}% - \fontshape{rm}\fontsize{8.5pt}{9pt}\fontseries{h}\selectfont\unskip#1#2% - \fontseries{k}\selectfont#3} -\captionsetup[figure]{format=nostarchfigfmt,singlelinecheck=off, - aboveskip=8pt,belowskip=8pt} -\captionsetup[lstlisting]{format=nostarchfigfmt,singlelinecheck=off, - aboveskip=8pt,belowskip=8pt} -\captionsetup[table]{format=nostarchtabfmt,singlelinecheck=off, - aboveskip=0pt,belowskip=4pt} +\AtBeginDocument{% + \renewcommand \thelstlisting + {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@lstlisting}% +} +\lstset{ + frame = lines, + showstringspaces=false, + tabsize=4, + title=\lstname, + numbers = none, + caption={}, + literate={\ }{{\ }}1{"}{\textquotedbl}1, + escapeinside={(@}{@)}, + captionpos=b, + basicstyle=\ttfamily, + columns=fullflexible, + moredelim=[is][\bfseries]{***}{***}, + moredelim=[is][\itshape]{___}{___}, + moredelim=[is][\bfseries\itshape]{&&&}{&&&}, + aboveskip=8pt, +} +\lstnewenvironment + {codewide}[1][] + { + \renewcommand{\codewingding}[1] + {\ding{\the\numexpr ##1 + 181 \relax}} + \captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off, + aboveskip=4pt, belowskip=-12pt, margin=-70pt} + \lstset{ + frame = lines, + showstringspaces=false, + tabsize=4, + title=\lstname, + numbers = none, + literate={\ }{{\ }}1{"}{\textquotedbl}1, + escapeinside={(@}{@)}, + captionpos=b, + caption={}, + basicstyle=\ttfamily, + columns=fullflexible, + moredelim=[is][\bfseries]{***}{***}, + moredelim=[is][\itshape]{___}{___}, + moredelim=[is][\bfseries\itshape]{&&&}{&&&}, + xleftmargin=-70pt, + aboveskip=8pt, + #1 + }} + { + \renewcommand{\codewingding}[1] + {\vbox{\llap{\wingding{#1}\hskip 0.5em}}} + \captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off, + aboveskip=4pt, belowskip=0pt, margin=0pt}} +\DeclareCaptionFont{nostarchfigfont}{\sffamily \itshape \fontsize{8.5pt}{9pt}\selectfont} +\DeclareCaptionFont{nostarchtabfont}{\futurabook \fontsize{9pt}{9pt}\selectfont} +\captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off, + aboveskip=8pt,belowskip=-8pt} +\captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off, + aboveskip=4pt, belowskip=0pt} +\captionsetup[table]{font=nostarchtabfont,singlelinecheck=off, + aboveskip=0pt,belowskip=4pt, labelfont=bf} +\newcommand{\captionlst}[1]{{\ttfamily \itshape \fontsize{10pt}{9pt}\selectfont #1}} +\newcommand{\boxlst}[1]{{\ttfamily \fontsize{10pt}{9pt}\selectfont #1}} +\newcommand{\tablelst}[1]{{\ttfamily \fontsize{10pt}{9pt}\selectfont #1}} \def\tbfont{% - \fontfamily{\sfdefault}\fontseries{k}\fontsize{8pt}{10pt}\selectfont} + \futurabook\fontsize{8.5pt}{10pt}\selectfont} \def\thfont{% - \fontfamily{\sfdefault}\fontseries{h}\fontsize{8pt}{10pt}\selectfont} + \futuraheavy\fontsize{9pt}{10pt}\selectfont} +\AtBeginEnvironment{tabular}{\tbfont} \heavyrulewidth=3\p@ -\lightrulewidth=1.5\p@ +\lightrulewidth=1\p@ \cmidrulewidth=1.5\p@ \def\bottomrule{\noalign{\ifnum0=`}\fi \@aboverulesep=\aboverulesep @@ -606,11 +853,185 @@ \belowbottomsep=0.65pt \aboverulesep=0.7ex \abovetopsep=0.65pt -\DefineVerbatimEnvironment{Code}{Verbatim}{frame=lines,framerule=0.25pt} +\newenvironment{tablewide}[1][] + { + \captionsetup[table]{font=nostarchtabfont,singlelinecheck=off, + aboveskip=0pt,belowskip=4pt, labelfont=bf, margin=-70pt} + \begin{table}[#1] + } + { + \end{table} + \captionsetup[table]{font=nostarchtabfont,singlelinecheck=off, + aboveskip=0pt,belowskip=4pt, labelfont=bf, margin=0pt} + } +\newenvironment{tabularwide}[1] + { + \hspace*{-72pt} + \begin{tabular}{#1} + } + { + \end{tabular} + } + \newenvironment{figurewide}[1][] + { + \captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off, + aboveskip=8pt,belowskip=-8pt, margin=-70pt} + \begin{figure}[#1] + \hspace*{-70pt} + } + { + \end{figure} + \captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off, + aboveskip=8pt,belowskip=-8pt} + } +\DefineVerbatimEnvironment{Code}{Verbatim}{frame=lines,framerule=0.25pt, commandchars=\\\{\}} \FV@AddToHook\FV@ListParameterHook{\vspace{-6pt}} \VerbatimFootnotes -\lstset{captionpos=b} -\lstset{basicstyle=\ttfamily,columns=fullflexible} +\definecolor{nspgray}{cmyk}{0, 0, 0, 0.1} +\mdfdefinestyle{nspbox}{% + linecolor=black, + outerlinewidth=1pt, + roundcorner=5pt, + innertopmargin=\baselineskip, + innerbottommargin=\baselineskip, + innerrightmargin=18pt, + innerleftmargin=18pt, + backgroundcolor=nspgray, + } + +\mdfdefinestyle{custombox}{% + linecolor=black, + outerlinewidth=1pt, + roundcorner=5pt, + innertopmargin=\baselineskip, + innerbottommargin=\baselineskip, + innerrightmargin=18pt, + innerleftmargin=18pt, + } +\newenvironment{nspbox}[1] +{\begin{mdframed}[style=nspbox] + \begin{center} + {\dogma \fontsize{9pt}{15pt} \MakeUppercase{\sobox{#1}}} + \end{center} + \begin{flushright} + \begin{flushleft} + \parskip=.5\baselineskip + \tbfont +} +{\end{flushleft}\end{flushright} +\end{mdframed}} +\newenvironment{nspboxcontinued} +{\begin{mdframed}[style=nspbox] + \begin{flushright} + \begin{flushleft} + \parskip=.5\baselineskip + \tbfont +} +{ +\end{flushleft} +\end{flushright} +\end{mdframed}} +\newenvironment{custombox}[1] +{\begin{mdframed}[style=custombox] + \begin{center} + {\dogma \fontsize{9pt}{15pt} \MakeUppercase{\sobox{#1}}} + \end{center} + \begin{flushright} + \begin{flushleft} + \parskip=.5\baselineskip + \tbfont +} +{\end{flushleft}\end{flushright} +\end{mdframed}} + +\newenvironment{customboxcontinued} +{\begin{mdframed}[style=custombox] + \begin{flushright} + \begin{flushleft} + \parskip=.5\baselineskip + \tbfont +} +{ +\end{flushleft} +\end{flushright} +\end{mdframed}} + +\newcommand{\continued}[0]{% + {\begin{flushright}% + \emph{(continued)}% + \end{flushright}}% +} +\newcounter{project} +\stepcounter{project} +\newcommand{\projecthead}[1]{ + \vspace{16pt}% + \noindent% + \hspace{-.75in}% + \addcontentsline{toc}{boldsection}{Project~\#\theproject: #1}% + {\sffamily\bfseries\fontsize{12pt}{16pt}\selectfont + \colorbox{black}{\textcolor{white}{Project~\#\theproject: #1}}}% + \vspace{6pt}% + \@afterindentfalse\@afterheading% + \refstepcounter{project}% +} +\renewcommand*{\marginfont}{\sffamily\itshape\fontsize{8.5}{10}\selectfont} +\renewcommand*{\marginnotevadjust}{-\baselineskip} +\newcommand{\marginwingding}[1]{{\fontsize{10pt}{12pt}\selectfont \wingding{#1}}} +\long\def\@mn@@@marginnote[#1]#2[#3]{% + \begingroup + \ifmmode\mn@strut\let\@tempa\mn@vadjust\else + \if@inlabel\leavevmode\fi + \ifhmode\mn@strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi + \fi + \@tempa{% + \vbox to\z@{% + \vss + \@mn@margintest + \if@reversemargin\if@tempswa + \@tempswafalse + \else + \@tempswatrue + \fi\fi + + \llap{% + \vbox to\z@{\kern\marginnotevadjust\kern #3 + \vbox to\z@{% + \hsize\marginparwidth + \linewidth\hsize + \kern-\parskip + %\mn@parboxrestore + \marginfont\raggedleftmarginnote\strut\hspace{\z@}% + \ignorespaces#1\endgraf + \vss + }% + \vss + }% + \if@mn@verbose + \PackageInfo{marginnote}{xpos seems to be \@mn@currxpos}% + \fi + \begingroup + \ifx\@mn@currxpos\relax\else\ifx\@mn@currpos\@empty\else + \kern\@mn@currxpos + \fi\fi + \ifx\@mn@currpage\relax + \let\@mn@currpage\@ne + \fi + \if@twoside\ifodd\@mn@currpage\relax + \kern-\oddsidemargin + \else + \kern-\evensidemargin + \fi + \else + \kern-\oddsidemargin + \fi + \kern-1in + \endgroup + \kern\marginparsep + }% + }% + }% + \endgroup +} \AtBeginDocument{ \def\bibsection{% \clearpage @@ -625,9 +1046,9 @@ \addcontentsline{toc}{chapter}{\MakeUppercase{\bibname}}% \addcontentsline{tbc}{bchapter}{\bibname}% {\centering - {\fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont - \MakeUppercase{\bibname}\par}}\nobreak\vskip25pt\relax% - \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}}% + {\dogma\fontsize{16pt}{20pt}\selectfont + \MakeUppercase{\sochapter{\bibname}}\par}}\nobreak\vskip25pt\relax% + \@mkboth{\bibname}{\bibname}}}% \renewenvironment{thebibliography}[1]{% \bibsection \list{\@biblabel{\@arabic\c@enumiv}}% @@ -646,6 +1067,7 @@ {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% \endlist} +\newcommand{\term}[1]{\emph{#1}\index{#1}} \renewenvironment{theindex}{% \clearpage {\pagestyle{empty}\cleardoublepage}% @@ -665,12 +1087,12 @@ \addcontentsline{toc}{chapter}{\MakeUppercase{\indexname}}% \addcontentsline{tbc}{bchapter}{\indexname}% {\centering - {\fontfamily{\dgdefault}\fontseries{br}% + {\dogma% \fontsize{16pt}{20pt}\selectfont - \MakeUppercase{\indexname}\par}}% + \MakeUppercase{\sochapter{\indexname}}\par}}% \nobreak\vskip25pt\relax]% - \@mkboth{\MakeUppercase\indexname}% - {\MakeUppercase\indexname}% + \@mkboth{\indexname}% + {\indexname}% \parindent\z@ \parskip\z@ \@plus .3\p@\relax \columnseprule \z@ @@ -683,7 +1105,7 @@ \renewcommand\subitem{\@idxitem \hspace*{0.15in}} \renewcommand\subsubitem{\@idxitem \hspace*{0.3in}} \renewcommand\indexspace{\par \vskip 14\p@\relax} -\newcommand\indexgroup[1]{{\fontfamily{\sfdefault}% +\newcommand\indexgroup[1]{{\futuraboldc \fontseries{bc}\fontsize{11\p@}{13\p@}\selectfont#1}\par\vskip4\p@} \def\updatesname{Updates} \newcommand\updatespage{% @@ -695,9 +1117,9 @@ \gdef\@chapterart{}% \vspace*{1.875in}% {\centering - \fontfamily{\dgdefault}\fontseries{br}% + \dogma% \fontsize{16pt}{20pt}\selectfont - \MakeUppercase{\updatesname}\par\nobreak\vskip40\p@}% + \MakeUppercase{\sochapter{\updatesname}}\par\nobreak\vskip40\p@}% \@nobreaktrue \everypar{% \if@nobreak @@ -714,10 +1136,10 @@ \global\@topnum\z@ \gdef\@chapterart{}% \vspace*{0.875in}% - {\centering - \fontfamily{\dgdefault}\fontseries{br}% - \fontsize{16pt}{20pt}\selectfont - \MakeUppercase{\colophonname}\par\nobreak\vskip40\p@}% + %{\centering + %\dogma% + % \fontsize{16pt}{20pt}\selectfont + %\MakeUppercase{\sochapter{\colophonname}}\par\nobreak\vskip40\p@}% \@nobreaktrue \everypar{% \if@nobreak @@ -729,9 +1151,10 @@ \everypar{}% \fi}\par The fonts used in \emph{\@title} are New Baskerville, Futura, The - Sans Mono Condensed and Dogma. The book was typeset with + Sans Mono Condensed, and Dogma. The book was typeset with \LaTeXe{} package - \texttt{nostarch} by Boris Veytsman + \texttt{nostarch} by Boris Veytsman with many additions by Alex + Freed and other members of the \emph{No Starch Press} team \emph{(\csname ver@nostarch.cls\endcsname).}\par} \endinput %% diff --git a/Master/texmf-dist/tex/latex/nostarch/nshyper.sty b/Master/texmf-dist/tex/latex/nostarch/nshyper.sty index 8f32f4b9339..5083017652e 100644 --- a/Master/texmf-dist/tex/latex/nostarch/nshyper.sty +++ b/Master/texmf-dist/tex/latex/nostarch/nshyper.sty @@ -36,7 +36,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \ProvidesPackage{nshyper} -[2008/06/06 v1.3 Typesetting books for No Starch Press] +[2023/03/30 v2.0 Typesetting books for No Starch Press] \RequirePackage[breaklinks,colorlinks,linkcolor=black, citecolor=black,pagecolor=black,urlcolor=black,hyperindex, bookmarks=false]{hyperref} |