summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/nostarch
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-06-11 13:43:39 +0000
committerKarl Berry <karl@freefriends.org>2008-06-11 13:43:39 +0000
commitb09c424184745e1400fb9fd0978a0622ae94b8a4 (patch)
treeb992d3ff95617e4b13c093d1cce11029f3ab6109 /Master/texmf-dist/source/latex/nostarch
parente470e032d162d488eb329c579dcf4d042883b898 (diff)
nostarch 1.3 (10jun08)
git-svn-id: svn://tug.org/texlive/trunk@8674 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/nostarch')
-rw-r--r--Master/texmf-dist/source/latex/nostarch/Makefile9
-rw-r--r--Master/texmf-dist/source/latex/nostarch/nostarch.dtx211
2 files changed, 170 insertions, 50 deletions
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}