diff options
author | Karl Berry <karl@freefriends.org> | 2008-06-11 13:43:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-06-11 13:43:39 +0000 |
commit | b09c424184745e1400fb9fd0978a0622ae94b8a4 (patch) | |
tree | b992d3ff95617e4b13c093d1cce11029f3ab6109 | |
parent | e470e032d162d488eb329c579dcf4d042883b898 (diff) |
nostarch 1.3 (10jun08)
git-svn-id: svn://tug.org/texlive/trunk@8674 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/bibtex/bib/nostarch/nostarch.bib | 19 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nostarch/README | 19 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nostarch/nostarch.pdf | bin | 316092 -> 326490 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/nostarch/nssample.pdf | bin | 403728 -> 416315 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/nostarch/nssample.tex | 19 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/nostarch/Makefile | 9 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/nostarch/nostarch.dtx | 211 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nostarch/nostarch.cls | 89 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nostarch/nshyper.sty | 2 |
9 files changed, 279 insertions, 89 deletions
diff --git a/Master/texmf-dist/bibtex/bib/nostarch/nostarch.bib b/Master/texmf-dist/bibtex/bib/nostarch/nostarch.bib index de86d1e6245..f9f13d7d4f5 100644 --- a/Master/texmf-dist/bibtex/bib/nostarch/nostarch.bib +++ b/Master/texmf-dist/bibtex/bib/nostarch/nostarch.bib @@ -161,3 +161,22 @@ year = {1997}, } +@manual{Heinz07:Listings, + author = {Carsten Heinz and Brooks Moses}, + note = + {\url{http://ctan.tug.org/tex-archive/macros/latex/contrib/listings}}, + title = {The \textsf{Listings} Package}, + year = {2007}, +} + + +@manual{Covington03:Upquote, + author = {Michale A. Covington and Frank Mittelback}, + note = + {\url{http://ctan.tug.org/tex-archive/macros/latex/contrib/upquote}}, + title = {Covington's Upright-Quote Modification to Verbatim and + Verb}, + year = {2003}, +} + + diff --git a/Master/texmf-dist/doc/latex/nostarch/README b/Master/texmf-dist/doc/latex/nostarch/README index fdecf967329..7911a0fcb19 100644 --- a/Master/texmf-dist/doc/latex/nostarch/README +++ b/Master/texmf-dist/doc/latex/nostarch/README @@ -1,5 +1,5 @@ LaTeX Style For No Starch Press - Version 1.0 2008/04/07 + Version 1.3 2008/06/06 This is the ``official'' LaTeX style for No Starch Press, http://www.nostarch.com. The class is intended to typeset books for @@ -7,3 +7,20 @@ this publisher---both hard copies and electronic books. The suite provides main class, nostarch.cls, hyperref interface nshyper.sty and MakeIndex style nostarch.ist. + +CHANGES: + +Version 1.1: + + Added interface to listings package + Formatting changes + Some bug fixes + +Version 1.2 + + Formatting changes + +Version 1.3: + + Bug fixes + Added user-settable parameters for the table of contents diff --git a/Master/texmf-dist/doc/latex/nostarch/nostarch.pdf b/Master/texmf-dist/doc/latex/nostarch/nostarch.pdf Binary files differindex d75235ac2ac..47bc20db724 100644 --- a/Master/texmf-dist/doc/latex/nostarch/nostarch.pdf +++ b/Master/texmf-dist/doc/latex/nostarch/nostarch.pdf diff --git a/Master/texmf-dist/doc/latex/nostarch/nssample.pdf b/Master/texmf-dist/doc/latex/nostarch/nssample.pdf Binary files differindex 0675c5557b4..2ce6ca28292 100644 --- a/Master/texmf-dist/doc/latex/nostarch/nssample.pdf +++ b/Master/texmf-dist/doc/latex/nostarch/nssample.pdf diff --git a/Master/texmf-dist/doc/latex/nostarch/nssample.tex b/Master/texmf-dist/doc/latex/nostarch/nssample.tex index 33a4d14a95e..9d56e2676a5 100644 --- a/Master/texmf-dist/doc/latex/nostarch/nssample.tex +++ b/Master/texmf-dist/doc/latex/nostarch/nssample.tex @@ -4,6 +4,7 @@ elei-fend no-num-my li-be-ro} \usepackage{natbib} \usepackage{nshyper} +\lstset{fancyvrb=true} \makeindex \begin{document} @@ -176,9 +177,8 @@ Pellentesque cursus luctus mauris\footnote{\lipsum[3]}. \lipsum[36-38] - \chapter{Proin vel urna} - +\label{chap:proin} \chapterartfile{100euroit}\index{euro, coin!Italy}\index{Italian euro|see{euro}} @@ -301,6 +301,20 @@ main( ) { \index{*/@\texttt{*/} (comment end)} \index{;@\texttt{;} (semicolon)} + +\begin{lstlisting}[language=Lisp, frame=single, float, + caption={[Hello, World in Emacs + Lisp]Hello, World in Emacs Lisp% + \index{Lisp|see{programming languages}}% + \index{programming languages!Lisp}\index{Emacs}}] +;;; Hello World in Emacs Lisp. + +(defun hello-world() + "Display the string hello world." + (interactive) + (message "hello world")) +\end{lstlisting} + Integer posuere, metus ac rhoncus auctor, mi tellus scelerisque nunc\index{nunc}, venenatis elementum tortor lorem eu erat. \begin{description} @@ -356,6 +370,7 @@ erat rhoncus consectetuer. Aenean pulvinar erat vitae\index{vita} mi. \lipsum[123-124] \part{Curabitur vitae}\index{vita|(} +\label{part:Curabitur} \chapter[Curabitur vitae lectus]{Curabitur vitae lectus sit amet turpis pretium condimentum} diff --git a/Master/texmf-dist/source/latex/nostarch/Makefile b/Master/texmf-dist/source/latex/nostarch/Makefile index e0f6ff95003..5986ef659d4 100644 --- a/Master/texmf-dist/source/latex/nostarch/Makefile +++ b/Master/texmf-dist/source/latex/nostarch/Makefile @@ -3,7 +3,7 @@ # # This file is in public domain # -# $Id: Makefile,v 1.5 2008-04-04 19:37:03 boris Exp $ +# $Id: Makefile,v 1.6 2008-05-25 18:06:28 boris Exp $ # PACKAGE=nostarch @@ -59,7 +59,10 @@ distclean: clean # Archive for the distribution. Includes typeset documentation # archive: all clean - tar -czvf $(PACKAGE).tgz --exclude '*~' --exclude '*.tgz' --exclude '*.zip' --exclude CVS . + tar -czvf $(PACKAGE).tgz --exclude 'debug*' \ + --exclude '*~' --exclude '*.tgz' --exclude '*.zip' --exclude CVS . + zip: all clean - zip -r $(PACKAGE).zip * -x '*~' -x '*.tgz' -x '*.zip' -x CVS -x 'CVS/*'
\ No newline at end of file + zip -r $(PACKAGE).zip * \ + -x 'debug*' -x '*~' -x '*.tgz' -x '*.zip' -x CVS -x 'CVS/*'
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/nostarch/nostarch.dtx b/Master/texmf-dist/source/latex/nostarch/nostarch.dtx index 2abef5b8f32..1fd2bb02847 100644 --- a/Master/texmf-dist/source/latex/nostarch/nostarch.dtx +++ b/Master/texmf-dist/source/latex/nostarch/nostarch.dtx @@ -1,5 +1,5 @@ % \iffalse -% $Id: nostarch.dtx,v 1.41 2008-04-07 22:02:22 boris Exp $ +% $Id: nostarch.dtx,v 1.49 2008-06-07 03:05:29 boris Exp $ % % Copyright 2008, Boris Veytsman % This work may be distributed and/or modified under the @@ -20,7 +20,7 @@ % derived file nostarch.cls % % \fi -% \CheckSum{1622} +% \CheckSum{0} % % %% \CharacterTable @@ -81,6 +81,8 @@ % \changes{v0.5}{2008/03/19}{Documentation update} % \changes{v0.6}{2008/03/21}{Documentation update} % \changes{v1.0}{2008/04/07}{First public release} +% \changes{v1.1}{2008/05/24}{Added interface to listings package and +% upquote package. Updated documentation} % % %\section{Introduction} @@ -138,13 +140,15 @@ % \progname{futurans}~\cite{FuturansFont}, % \progname{dogma}~\cite{DogmaFont} and % \progname{thsmc}~\cite{ThsmcFont}. -% \item \progname{ifpdf} package~\cite{Oberdiek06:Ifpdf}. -% \item \progname{fancyhdr} package~\cite{Oostrum04:Fancyhdr}. % \item \progname{booktabs} package~\cite{Fear05:Booktabs}. -% \item \progname{graphics} package~\cite{Carlisle05:Graphics}. % \item \progname{caption} package~\cite{Sommerfeldt07:Caption}. +% \item \progname{fancyhdr} package~\cite{Oostrum04:Fancyhdr}. % \item \progname{fancyvrb} package~\cite{VanZandt98:Fancyvrb}. +% \item \progname{graphics} package~\cite{Carlisle05:Graphics}. +% \item \progname{ifpdf} package~\cite{Oberdiek06:Ifpdf}. +% \item \progname{listings} package~\cite{Heinz07:Listings}. % \item \progname{ragged2e} package~\cite{Schroeder03:Ragged2e}. +% \item \progname{upquote} package~\cite{Covington03:Upquote}. % \end{enumerate} % These packages are called internally by |nostarch.cls|; you do not % need to explicitly call them from your document. @@ -313,6 +317,17 @@ % and |\tableofcontents|. % % +% \DescribeMacro{\sectionnumberwidth} +% \DescribeMacro{\subsectionnumberwidth} +% In most books by \emph{No Starch Press} sections and subsections are +% unnumbered. However, sometimes the books use numbered sections or +% subsections. In these cases you may want to adjust the widths left +% for section and subsection numbers in the detailed table of +% contents. They are set by +% |\sectionnumberwidth| and |\subsectionnumberwidth|, and can be +% changed with the usual |\setlength| command. +% +% % Forewords and similar front matter materials are unnumbered % chapters: |\chapter*[Foreword by R. E.~Viewer]{Foreword}|. % @@ -475,9 +490,14 @@ %\subsubsection{Code Fragments} %\label{sec:guide:code} % +% The class provides two facilities for including code fragments in +% the books. +% % \DescribeMacro{Code} -% The class uses \progname{fancyvrb} -% package~\cite{VanZandt98:Fancyvrb}. Long code fragments should be +% For short unformatted code fragments the \progname{fancyvrb} +% package~\cite{VanZandt98:Fancyvrb} facilities are recommended. This +% package is automatically automatically loaded by the class. Long code +% fragments should be % separated by rules; the class defines verbatim-like |Code| % environment, which does exactly this: % \begin{verbatim} @@ -490,6 +510,36 @@ % See the documentation of~\cite{VanZandt98:Fancyvrb} about many % features of this package. % +% For longer code fragments the \progname{listings} +% package~\cite{Heinz07:Listings} is more appropriate. It is also +% automatically loaded. This package provides a number of useful +% features, well describe in its manual. We will briefly mention +% several of them, which might be of interest for the authors of +% \emph{No Starch Press}: +% \begin{enumerate} +% \item Automatic code formatting according to the rules of the chosen +% program language (for example, |\lstset{language=C}| or +% |\lstset{language=Lisp}|). +% \item A rich set of different frames: ruled code with +% |frame=lines|, boxed code with |frame=single| etc. +% \item An option to add captions to the listings (the class +% automatically formats the captions according to the style of +% \emph{No Starch Press}). +% \item An option to make a listing floating. +% \item An option to automatically number code lines. +% \item An option to add list of listings (with the command +% |\lstlistoflistings|). +% \end{enumerate} +% +% To make the code in |\verb| commands and |verbatim|-like +% environments be typeset with the \progname{listings} package, you +% may want to set |fancyvrb=true| in the preamble of your document. +% +% It should be noted that the authors are recommended \emph{not} to +% use |\texttt| or |\tt| for inline code fragments. The proper way to +% add inline code is |\verb| or |\lstinline| from the +% \progname{listings} package. The difference is obvious, for +% example, in quote characters. % % %\subsection{Back Matter} @@ -594,7 +644,7 @@ %<class>\ProvidesClass{nostarch} %<nshyper>\ProvidesPackage{nshyper} %<*!ist> -[2008/04/07 v1.0 Typesetting books for No Starch Press] +[2008/06/06 v1.3 Typesetting books for No Starch Press] %</!ist> % \end{macrocode} % @@ -677,7 +727,7 @@ % A bunch of packages: % \begin{macrocode} \RequirePackage{ifpdf, fancyhdr, fancyvrb, booktabs, graphicx, - caption, makeidx} + listings, caption, makeidx, upquote} % \end{macrocode} % % We do not want the option |document| with \progname{ragged2e}: this @@ -764,6 +814,7 @@ % \begin{macro}{\topmargin} % \changes{v0.2}{2008/03/03}{Moved down} % \changes{v0.7}{2008/04/04}{Changed dimensions} +% \changes{v1.1}{2008/05/24}{Made shorter} % The top margin is 0.625''. We use fake headers of 12pt: % \begin{macrocode} \setlength\topmargin{0.625in} @@ -776,7 +827,7 @@ % running head and foot. % \begin{macrocode} \setlength\textheight{8in} -\addtolength{\textheight}{-0.14in} +\addtolength{\textheight}{-0.207in} % \end{macrocode} % Now we take care of the first line height: % \begin{macrocode} @@ -1096,6 +1147,7 @@ % \changes{v0.5}{2008/03/19}{Introduced macro} % \changes{v0.7}{2008/04/04}{Changed dimensions} % \changes{v0.8}{2008/04/07}{Changed dimensions} +% \changes{v1.1}{2008/05/24}{Added toc name to the verso footers} % This is the new macro: % \begin{macrocode} \newcommand\brieftableofcontents{% @@ -1103,7 +1155,7 @@ {\pagestyle{empty}\cleardoublepage}% \bgroup \thispagestyle{empty}% - \markboth{}{\briefcontentsname}% + \markboth{\briefcontentsname}{\briefcontentsname}% \null\vskip0.925in% \list{}{\leftmargin-1.0in\rightmargin0.4in\labelwidth\z@% \labelsep\z@\listparindent\z@\parsep\z@\itemsep\z@% @@ -1122,6 +1174,8 @@ % \changes{v0.5}{2008/03/19}{Changed LaTeX default} % \changes{v0.7}{2008/04/04}{Changed dimensions} % \changes{v0.8}{2008/04/07}{Changed dimensions} +% \changes{v1.1}{2008/05/24}{Added toc name to the verso footers} +% \changes{v1.2}{2008/06/01}{Added toc name to the verso footers} % This is the new macro: % \begin{macrocode} \renewcommand\tableofcontents{% @@ -1129,7 +1183,7 @@ {\pagestyle{empty}\cleardoublepage}% \bgroup \thispagestyle{empty}% - \markboth{}{\contentsname}% + \markboth{\contentsname}{\contentsname}% \null\vskip0.175in% \list{}{\leftmargin-1.0in\rightmargin0.6in\labelwidth\z@% \labelsep\z@\listparindent\z@\parsep\z@\itemsep\z@% @@ -1197,27 +1251,56 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\sectionnumberwidth} +% \changes{v1.3}{2008/06/06}{Introduced the length} +% The number width for sections. Normally the width of |99.99| +% \begin{macrocode} +\newlength{\sectionnumberwidth} +\settowidth{\sectionnumberwidth}{% + \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont + 99.99} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\subsectionnumberwidth} +% \changes{v1.3}{2008/06/06}{Introduced the length} +% The number width for subsections. Normally the width of +% |99.99.99| +% \begin{macrocode} +\newlength{\subsectionnumberwidth} +\settowidth{\subsectionnumberwidth}{% + \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont + 99.99.99} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\l@section} % \changes{v0.5}{2008/03/19}{Changed LaTeX default} +% \changes{v1.3}{2008/06/06}{Made number width user settable} % This is how we typeset sections in the table of contents % \begin{macrocode} -\renewcommand{\l@section}[2]{\@dottedtocline{1}{\z@}{0.25in}{% -\fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{% -\fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#2}} +\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}} % \end{macrocode} % \end{macro} % % \begin{macro}{\l@subsection} % \changes{v0.5}{2008/03/19}{Changed LaTeX default} +% \changes{v1.1}{2008/05/24}{Changed numwidth} +% \changes{v1.2}{2008/06/01}{Changed numwidth again} +% \changes{v1.3}{2008/06/06}{Made number width user settable} % This is how we typeset subsections in the table of contents % \begin{macrocode} -\renewcommand{\l@subsection}[2]{\@dottedtocline{2}{0.5in}{0.25in}{% -\fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{% -\fontfamily{\sfdefault}\fontseries{k}\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}} % \end{macrocode} % \end{macro} % % +% % \begin{macro}{\l@bpart} % \changes{v0.6}{2008/03/21}{Introduced macro} % There is a special formatting of parts in the brief table of @@ -1447,33 +1530,37 @@ % \begin{macro}{\@chapter} % \changes{v0.2}{2008/03/04}{Moved up} % \changes{v0.6}{2008/03/21}{Reverted to standard interface} +% \changes{v1.3}{2008/06/06}{Corrected a stupid mistake: put +% refstepcounter out of a group} % The actual work is done by |\@chapter| macro. % \begin{macrocode} \def\@chapter[#1]#2{% \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 - \ifnum \c@secnumdepth > \m@ne - \refstepcounter{chapter}% - \markboth{\@chapapp~\thechapter}{#1}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}{\thechapter% - \protect\linebreak\penalty\@highpenalty - \MakeUppercase{#1}}% - \addcontentsline{tbc}{bchapter}{% - \chaptername~\thechapter:~#1}% - {\fontfamily{\sfdefault}\fontseries{bc}\fontsize{120pt}{120pt} - \selectfont - \thechapter\par\nobreak\vskip27pt}% - \else - \addcontentsline{toc}{chapter}{% - \MakeUppercase{#1}}% - \addcontentsline{tbc}{bchapter}{#1}% - \markboth{#1}{#1}% - \fi - {\fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont - \MakeUppercase{#2}\par}}\nobreak\vskip25pt\relax% - \@firstparatrue - \@afterheading}% + \fontfamily{\sfdefault}\fontseries{bc}\fontsize{120pt}{120pt} + \selectfont + \thechapter\par\nobreak\vskip27pt}% + \else + \addcontentsline{toc}{chapter}{% + \MakeUppercase{#1}}% + \addcontentsline{tbc}{bchapter}{#1}% + \markboth{#1}{#1}% + \fi + {\centering + \fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont + \MakeUppercase{#2}\par}\nobreak\vskip25pt\relax% + \@firstparatrue + \@afterheading}% % \end{macrocode} % \end{macro} % @@ -1774,13 +1861,14 @@ %\label{sec:footnotes} % % \begin{macro}{\footnoterule} -% \changes{v0.3}{2008/03/11}{Increased kern} +% \changes{v0.3}{2008/03/11}{Increased kern above the rule} +% \changes{v1.1}{2008/06/01}{Increased kern below the rule} % We want one inch by 0.25 footnote rule: % \begin{macrocode} \renewcommand\footnoterule{% \kern6\p@ \hrule height 0.25pt depth 0pt width 1in - \kern0\p@} + \kern2\p@} % \end{macrocode} % \end{macro} % @@ -1817,18 +1905,20 @@ % % % \begin{macro}{\@makefntext} +% \changes{v1.1}{2008/05/24}{Added space between footnote mark and +% footnote text} % We do not indent the footnotes: % \begin{macrocode} \renewcommand\@makefntext[1]{% \parindent 0\p@% \RaggedRightParindent0\p@% \noindent - \@makefnmark#1} + \@makefnmark\space#1} % \end{macrocode} % \end{macro} % % -%\subsection{Tables and Figures} +%\subsection{Tables, Figures and Listings} %\label{sec:tbl_fig} % % \begin{macro}{\thefigure} @@ -1847,9 +1937,17 @@ {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@table} % \end{macrocode} % \end{macro} +% \begin{macro}{\thelistings} +% And the same for listings: +% \begin{macrocode} +\renewcommand \thelstlisting + {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@lstlisting} +% \end{macrocode} +% \end{macro} +% % % \begin{macro}{nostarchfigfmt} -% This is our captions format for figures +% This is our captions format for figures and listings % \changes{v0.3}{2008/03/11}{Added style} % \begin{macrocode} \DeclareCaptionFormat{nostarchfigfmt}{\fontfamily{\sfdefault}% @@ -1868,10 +1966,12 @@ % % % -% The figure and table styles: +% The figure, listing and and table styles: % \begin{macrocode} \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} % \end{macrocode} @@ -1936,7 +2036,7 @@ % % % -%\subsection{Verbatim Customization} +%\subsection{Verbatim and Listings Customization} %\label{sec:verbatim} % % \begin{macro}{Code} @@ -1946,6 +2046,7 @@ % \end{macrocode} % \end{macro} % +% % \begin{macro}{\FV@ListParameterHook} % The skip before code is too large for us % \begin{macrocode} @@ -1953,6 +2054,22 @@ % \end{macrocode} % \end{macro} % +% We also enable verbatim footnotes. +% \begin{macrocode} +\VerbatimFootnotes +% \end{macrocode} +% +% We set up captions with \progname{captions}: +% \begin{macrocode} +\lstset{captionpos=b} +% \end{macrocode} +% +% And make the code to be in typewriter font: +% \begin{macrocode} +\lstset{basicstyle=\ttfamily,columns=fullflexible} +% \end{macrocode} +% +% % %\subsection{Bibliography} %\label{sec:biblio} diff --git a/Master/texmf-dist/tex/latex/nostarch/nostarch.cls b/Master/texmf-dist/tex/latex/nostarch/nostarch.cls index 93ba27d9b3f..2bfbe9cb046 100644 --- a/Master/texmf-dist/tex/latex/nostarch/nostarch.cls +++ b/Master/texmf-dist/tex/latex/nostarch/nostarch.cls @@ -37,7 +37,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{nostarch} -[2008/04/07 v1.0 Typesetting books for No Starch Press] +[2008/06/06 v1.3 Typesetting books for No Starch Press] \newif\ifnostarch@cfonts \nostarch@cfontstrue \DeclareOption{cfonts}{\nostarch@cfontstrue} @@ -59,7 +59,7 @@ \ProcessOptions\relax \LoadClass[10pt]{book} \RequirePackage{ifpdf, fancyhdr, fancyvrb, booktabs, graphicx, - caption, makeidx} + listings, caption, makeidx, upquote} \RequirePackage{ragged2e} \setlength\RaggedRightParindent{\parindent} \RaggedRight @@ -86,7 +86,7 @@ \addtolength\topmargin{-1in} \addtolength\topmargin{-12pt} \setlength\textheight{8in} -\addtolength{\textheight}{-0.14in} +\addtolength{\textheight}{-0.207in} \addtolength\textheight{\topskip} \setlength\evensidemargin{0.687in} \addtolength{\evensidemargin}{-1in} @@ -210,7 +210,7 @@ {\pagestyle{empty}\cleardoublepage}% \bgroup \thispagestyle{empty}% - \markboth{}{\briefcontentsname}% + \markboth{\briefcontentsname}{\briefcontentsname}% \null\vskip0.925in% \list{}{\leftmargin-1.0in\rightmargin0.4in\labelwidth\z@% \labelsep\z@\listparindent\z@\parsep\z@\itemsep\z@% @@ -227,7 +227,7 @@ {\pagestyle{empty}\cleardoublepage}% \bgroup \thispagestyle{empty}% - \markboth{}{\contentsname}% + \markboth{\contentsname}{\contentsname}% \null\vskip0.175in% \list{}{\leftmargin-1.0in\rightmargin0.6in\labelwidth\z@% \labelsep\z@\listparindent\z@\parsep\z@\itemsep\z@% @@ -269,12 +269,22 @@ \vskip4\p@\penalty\@highpenalty \endgroup \fi} -\renewcommand{\l@section}[2]{\@dottedtocline{1}{\z@}{0.25in}{% -\fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{% -\fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#2}} -\renewcommand{\l@subsection}[2]{\@dottedtocline{2}{0.5in}{0.25in}{% -\fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{% -\fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#2}} +\newlength{\sectionnumberwidth} +\settowidth{\sectionnumberwidth}{% + \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont + 99.99} +\newlength{\subsectionnumberwidth} +\settowidth{\subsectionnumberwidth}{% + \fontfamily{\sfdefault}\fontseries{k}\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}} +\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}} \newcommand*\l@bpart[2]{% \ifnum \c@tocdepth >-2\relax \addpenalty{-\@highpenalty}% @@ -375,29 +385,31 @@ \secdef\@chapter\@schapter} \def\@chapter[#1]#2{% \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 - \ifnum \c@secnumdepth > \m@ne - \refstepcounter{chapter}% - \markboth{\@chapapp~\thechapter}{#1}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}{\thechapter% - \protect\linebreak\penalty\@highpenalty - \MakeUppercase{#1}}% - \addcontentsline{tbc}{bchapter}{% - \chaptername~\thechapter:~#1}% - {\fontfamily{\sfdefault}\fontseries{bc}\fontsize{120pt}{120pt} - \selectfont - \thechapter\par\nobreak\vskip27pt}% - \else - \addcontentsline{toc}{chapter}{% - \MakeUppercase{#1}}% - \addcontentsline{tbc}{bchapter}{#1}% - \markboth{#1}{#1}% - \fi - {\fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont - \MakeUppercase{#2}\par}}\nobreak\vskip25pt\relax% - \@firstparatrue - \@afterheading}% + \fontfamily{\sfdefault}\fontseries{bc}\fontsize{120pt}{120pt} + \selectfont + \thechapter\par\nobreak\vskip27pt}% + \else + \addcontentsline{toc}{chapter}{% + \MakeUppercase{#1}}% + \addcontentsline{tbc}{bchapter}{#1}% + \markboth{#1}{#1}% + \fi + {\centering + \fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont + \MakeUppercase{#2}\par}\nobreak\vskip25pt\relax% + \@firstparatrue + \@afterheading}% \def\@schapter[#1]#2{% \vspace*{2.747in} {\centering @@ -541,7 +553,7 @@ \renewcommand\footnoterule{% \kern6\p@ \hrule height 0.25pt depth 0pt width 1in - \kern0\p@} + \kern2\p@} \long\def\@footnotetext#1{\insert\footins{% \reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty @@ -560,11 +572,13 @@ \parindent 0\p@% \RaggedRightParindent0\p@% \noindent - \@makefnmark#1} + \@makefnmark\space#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}% @@ -572,6 +586,8 @@ \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} \def\tbfont{% @@ -592,6 +608,9 @@ \abovetopsep=0.65pt \DefineVerbatimEnvironment{Code}{Verbatim}{frame=lines,framerule=0.25pt} \FV@AddToHook\FV@ListParameterHook{\vspace{-6pt}} +\VerbatimFootnotes +\lstset{captionpos=b} +\lstset{basicstyle=\ttfamily,columns=fullflexible} \AtBeginDocument{ \def\bibsection{% \clearpage diff --git a/Master/texmf-dist/tex/latex/nostarch/nshyper.sty b/Master/texmf-dist/tex/latex/nostarch/nshyper.sty index 05170592637..8f32f4b9339 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/04/07 v1.0 Typesetting books for No Starch Press] +[2008/06/06 v1.3 Typesetting books for No Starch Press] \RequirePackage[breaklinks,colorlinks,linkcolor=black, citecolor=black,pagecolor=black,urlcolor=black,hyperindex, bookmarks=false]{hyperref} |