%%
%% This is file `classpack.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% classpack.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright © 1998-2024 by Silmaril Consultants
%% 
%% This file was generated from an XML master source.
%% Amendments and corrections should be notified to the
%% maintainer for inclusion in future versions.
%% 
\NeedsTeXFormat{LaTeX2e}[2015/01/01]
\ProvidesPackage{classpack}[2024/02/21 v1.28
  Package code for supporting ClassPack documentation]
%%
%% The _classpack_ macros and settings
%%
%% Packages required for the package
%%
%% Sets the Google NoTo typeface as the default.
\RequirePackage{noto}%
%% Provide for running headers and footers.
\RequirePackage{fancyhdr}%
%% Some \LaTeX{} kernel commands for general use, but in the case of ClassPack, particularly ltx@ifpackageloaded.
\RequirePackage{ltxcmds}%
\ifdefined\IfPackageLoaded\relax
  \else\newcommand{\IfPackageLoaded}[3]{%
    \ltx@ifpackageloaded{#1}{#2}{#3}}\fi
%% Creates paragraphs separated by white-space with no indentation.
\RequirePackage{parskip}%
%% Provide for graphics (PNG, JPG, or PDF format (only) for pdflatex; EPS format (only) for standard \LaTeX{}); and for reflection and rotation features.
\RequirePackage{graphicx}%
%% Adds more flexibility to marginal notes.
\RequirePackage[fulladjust,quiet]{marginnote}%
%%
%% ******************************************************************
%%
%% Index settings
%%
%% The _doctex_ package uses a default three-column index for the documentation, which is too narrow for most purposes. We therefore make the index in two columns, and space them slightly farther apart. We test first for the existence of the counter, in case this gets used in a document other than a `.dtx` file. No such test is needed for `columnsep` because it is defined in the LaTeX kernel.
\@ifundefined{c@IndexColumns}{}{\setcounter{IndexColumns}{2}}
\setlength{\columnsep}{3pc}
%%
%% ******************************************************************
%%
%% Annotation settings
%%
%% The _doc_ and _docx_ packages use the `\MacroFont` command for the annotated code. We redefine it here to add the colour DarkBlue (from the **`svgnames`** option to the _xcolor_ package).
\def\MacroFont{%\fontencoding\encodingdefault
  \ttfamily\fontseries{m}\fontshape\updefault
  \small\selectfont\color{DarkBlue}}
%%
%% Where an annotation occurs inside an indented container like a list, provide for some additional indentation.
\newlength{\CPKannotationindent}
\setlength{\CPKannotationindent}{0pt}
%%
%% This allows alignment of the current annotation name (from `xreflabel`) as a reminder in a marginal note in a fake subheading implemented by a `bridgehead` element. Again, no at-sign for a user-mode command.
\newcommand{\CPKrunningecho}[1]{\leavevmode
  \marginnote[\sloppy\raggedleft\color{Grey}%
              \hspace{0pt}\LabelFont{#1}]%
             {\sloppy\raggedright\color{Grey}%
              \hspace{0pt}\LabelFont{#1}}%
}
\let\marginfont\ttfamily
%%
%% ******************************************************************
%%
%% Table of Contents
%%
%% Documentation can sometimes have more than nine subdivisions in sections, subsections, etc, and over 99 pages; and the default widths in the ToC are too narrow for this, so we widen the space for the subsection number by 0.4em:
\renewcommand*\l@subsection{%
  \@dottedtocline{2}{1.5em}{2.7em}}% was {2}{3.8em}{3.2em}
%%
%% Similarly we increase the subsection number space by 0.4em, and its margin, so they align:
\renewcommand*\l@subsubsection{%
  \@dottedtocline{3}{4.2em}{3.6em}}% was {3}{7.0em}{4.1em}
%%
%% And lastly, the numbered paragraph and numbered subparagraph number spaces:
\renewcommand*\l@paragraph{%
  \@dottedtocline{4}{7.8em}{4.5em}}% was {4}{10em}{5em}
\renewcommand*\l@subparagraph{%
  \@dottedtocline{5}{12.2em}{5em}}% was {5}{12em}{6em}
%%
%% The page number width is set to 3em instead of 1.55em:
\renewcommand{\@pnumwidth}{3em}
%%
%% And the right margin space goes up from 2.55em to 3em; the addition of 1fil makes the section titles typeset raggedright, so that hyphenation will not occur.
\renewcommand{\@tocrmarg}{4em plus1fil}
%%
%% ******************************************************************
%%
%% Lower-level sectioning
%%
%% The `\subsubsection` command is used in bridgehead mode, so needs less space above and below.
\renewcommand\subsubsection{%
  \@startsection{subsubsection}{3}{\z@}%
    {-1ex\@plus -.25ex \@minus -.25ex}%
    {1ex \@plus .25ex}%
    {\sffamily\normalsize\bfseries}}
%%
%% ******************************************************************
%%
%% Appendix settings
%%
%% Change the way the appendix command works so that appendixes get section-type styling in documentation.
\renewcommand\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \gdef\thesection{\@Alph\c@section}}
%%
%% ******************************************************************
%%
%% TeX and other logos
%%
%% TeX and LaTeX are defined in the LaTeX kernel, but most of the others are not. The following definitions are taken from the _ltugboat_ package, used for typesetting the TUGboat journal.
%%
%% Con\TeX t{} is a typography and typesetting system meant to provide users easy and consistent access to advanced typographical control (Hagen, 2001).
\def\ConTeXt{C\kern-.0333emon\-\kern-.0667em\TeX
  \kern-.0333emt}
%%
%% Borrow the reflection code from TUGboat.
\def\tubreflect#1{%
  \@ifundefined{reflectbox}{%
    \PackageError{classpack}%
      {A graphics package must be loaded for \string\XeTeX}%
      {Add the graphicx package to your Preamble}%
  }{% otherwise OK
    \ifdim \fontdimen1\font>0pt
      \raise 1.75ex \hbox{\kern.1em
        \rotatebox{180}{#1}}\kern-.1em
    \else
      \reflectbox{#1}%
    \fi
  }%
}
%%
%% Borrow the method of hiding the height from TUGboat as well.
\def\tubhideheight#1{\setbox0=\hbox{#1}%
  \ht0=0pt \dp0=0pt \box0 }
%%
%% Start by defining the first part of XeTeX and XeLaTeX.
\DeclareRobustCommand\Xe[1]{\leavevmode
  \tubhideheight{\hbox{X%
    \setbox0=\hbox{\TeX}\setbox1=\hbox{E}%
    \lower\dp0\hbox{\raise\dp1\hbox{%
      \kern-.125em\tubreflect{E}}}%
    \kern-.1667em #1}}}
\def\XeTeX{\Xe\TeX}
%%
%% Define XeLaTeX using the existing macros.
\def\XeLaTeX{\Xe{\,\LaTeX}}
%%
%% Define the LyX logo.
\def\LyX{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX}
%%
%% Define a new small caps for use in BiBTeX, and an error message to go with it (from the _ltugboat_ package).
\DeclareRobustCommand\SMC{%
  \ifx\@currsize\normalsize\small\else
   \ifx\@currsize\small\footnotesize\else
    \ifx\@currsize\footnotesize\scriptsize\else
     \ifx\@currsize\large\normalsize\else
      \ifx\@currsize\Large\large\else
       \ifx\@currsize\LARGE\Large\else
        \ifx\@currsize\scriptsize\tiny\else
         \ifx\@currsize\tiny\tiny\else
          \ifx\@currsize\huge\LARGE\else
           \ifx\@currsize\Huge\huge\else
            \small\SMC@unknown@warning
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
}
\newcommand\SMC@unknown@warning{\PackageError{classpack}%
  {\string\SMC: can't find small caps for nonstandard
  text font size command -- using \string\small}%
  {Check the font size or scaling for \the\@currsize}}
\newcommand\textSMC[1]{{\SMC #1}}
%%
%% Finally, define BiBTeX in various forms.
    \def\Bib{%
  \ifdim \fontdimen1\font>0pt
     B{\SMC\SMC IB}%
  \else
     \textsc{Bib}%
  \fi
}
\def\BibTeX{\Bib\kern-.08em \TeX}
\let\BiBTeX\BibTeX
\let\BIBTeX\BibTeX
%%
%% ******************************************************************
%%
%% Formatting additions
%%
%% Define a strut that adjusts to the size of type, for use in spacing table headers and footers.
\newcommand{\CPKvstrut}{\vrule height1.2em
                        depth.6667ex width0pt}
%%
%% Define a macro to format an arrow between documentary menu items. Probably no longer needed now that the _menukeys_ package is available
\def\CPKmenusep{\thinspace$\rightarrow$\thinspace
                \allowbreak}
%%
%% Also a strut to precede paragraph cells\dots{}
\newcommand{\CPKprestrut}{\vrule height1em width0pt}
%%
%% \dots{}and one to follow them.
\newcommand{\CPKpoststrut}{\vrule depth.5ex width0pt}
%%
%% Give the `\hline` command an optional thickness (height) argument.
\def\hline{\noalign{\ifnum0=`}\fi
  \@ifnextchar[{\@@hline}{\@@hline[\arrayrulewidth]}}
\def\@@hline[#1]{\hrule \@height#1 \futurelet
  \reserved@a\@xhline}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\@ifundefined{c@IndexColumns}{}{\setcounter{IndexColumns}{2}}
\setlength{\columnsep}{3pc}
%%
%% Measurement of table width, to allow for notes (see `figtab2latex.xsl`).
\newlength{\CPKtabwid}
%%
%% Define a counter for left-hang notes.
\newcounter{CPKfnote}
%%
%% Define a left-hang note to protrude into the left space beside a table cell with an italic number.
\newcommand{\fnote}{%
  \stepcounter{CPKfnote}\llap{%
    \footnotesize\textsuperscript{%
      \itshape\alph{CPKfnote}\upshape)}\thinspace}}
%%
%% Add some hyphenation oddities.
\hyphenation{ele-ment ele-ments attri-bute attri-butes
  docu-ment docu-ments docu-men-tation primi-tive
  primi-tives name-space name-spaces helico-pter}
%%
%% This has been replaced by the _enumitem_ package as specified in `prepost.xml`.
%%
%% Add the counter to enable the use of `coref` list counters in generated code.
\newcounter{CPKcoref}
%%
%% An `\endinput` command is automatically appended to this file.

\endinput
%%
%% End of file `classpack.sty'.
