diff options
author | Karl Berry <karl@freefriends.org> | 2013-09-24 22:35:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-09-24 22:35:02 +0000 |
commit | 020ed552eb79eee0bce0c1f6b8e40d8005d7767a (patch) | |
tree | b68e08ad3696b87e1219446c6929fc9a3ecaf378 | |
parent | 8bf589e665b12fbe605d9e60956d67d8253a364f (diff) |
skdoc (23sep13)
git-svn-id: svn://tug.org/texlive/trunk@31753 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/skdoc/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/skdoc/skdoc.pdf | bin | 244791 -> 245492 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/skdoc/skdoc.dtx | 93 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/skdoc/skdoc.cls | 61 |
4 files changed, 120 insertions, 36 deletions
diff --git a/Master/texmf-dist/doc/latex/skdoc/README b/Master/texmf-dist/doc/latex/skdoc/README index 387ecd5bea9..565b55df4a4 100644 --- a/Master/texmf-dist/doc/latex/skdoc/README +++ b/Master/texmf-dist/doc/latex/skdoc/README @@ -17,7 +17,7 @@ %% This work consists of the files skdoc.dtx %% and the derived filebase skdoc.cls. -This is version 1.3b of the skdoc document class. It is designed to +This is version 1.4 of the skdoc document class. It is designed to generate both documentation and derivative files using only LaTeX, i.e. without using docstrip and ins/dtx files. diff --git a/Master/texmf-dist/doc/latex/skdoc/skdoc.pdf b/Master/texmf-dist/doc/latex/skdoc/skdoc.pdf Binary files differindex 2fd28819611..af8c21458a7 100644 --- a/Master/texmf-dist/doc/latex/skdoc/skdoc.pdf +++ b/Master/texmf-dist/doc/latex/skdoc/skdoc.pdf diff --git a/Master/texmf-dist/source/latex/skdoc/skdoc.dtx b/Master/texmf-dist/source/latex/skdoc/skdoc.dtx index 08dd5dd0416..f193bd64957 100644 --- a/Master/texmf-dist/source/latex/skdoc/skdoc.dtx +++ b/Master/texmf-dist/source/latex/skdoc/skdoc.dtx @@ -73,7 +73,7 @@ %</driver> %<class>\ProvidesExplClass{skdoc} %<*class> - {2013/05/24}{1.3b}{skdoc documentation class} + {2013/09/23}{1.4}{skdoc documentation class} %</class> % %<*driver> @@ -132,7 +132,7 @@ % {}{\small\pagemark} % \pagestyle{skdoc-class} % -% \version{1.3b} +% \version{1.4} % \changes{1.0}{Initial version} % \changes{1.1}{Added support for syntax highlighting using \pkg{minted}} % \changes{1.1a}{Deprecate the use of \pkg{bibtex} in favour of \pkg{biblatex}} @@ -140,6 +140,11 @@ % \changes{1.2b}{Use \pkg{inconsolata}. Don't use \pkg{ascii}} % \changes{1.3}{Allow multiple targets per \env{MacroCode}} % \changes{1.3b}{Use \pkg{sourcecodepro} instead of \pkg{inconsolata}. Fix issue with index entries of different types with same name} +% \changes{1.4}{Added option to control \pkg{babel}. Allow optional default value arguments in \env{macro} and friends. Fix spacing issue in \env{option} and friends} +% \iffalse +%%% Don't forget to update the version number and release date of +%%% the package declaration on line 76! +% \fi % % \package[ctan=skdoc,vcs=https://github.com/urdh/skdoc]{skdoc} % \repository{https://github.com/urdh/skdoc} @@ -220,6 +225,11 @@ % unless the documentation describes a very large package, and the % repeated calls to \texttt{pygmentize} take too long. % +% \Option{babel} +% The \opt{babel} option allows you to specify what languages are loaded +% by the \pkg{babel} package. It is a key-value option, and its content +% is passed as options to the \pkg{babel} \cs*{usepackage} declaration. +% % \subsection{General macros} % The document class defines a number of general macros intended for % use in parts of the document not strictly considered @@ -600,16 +610,16 @@ % improve readability of the implementation code. % % \DescribeEnv[<description>]{macro}{<\textbackslash macro>} -% [<\# of args>]{<arg 1 description>}'...' -% {<arg n description>} +% [<\# of args>]{<arg 1 description>}[<default value>]'...' +% {<arg n description>}[<default value>] % With this environment, the implementation of a macro is described. % Note that as with \cs{DescribeMacro}, \LaTeX3-style macros can not % be used in \meta{\textbackslash macro} without the catcode hack % mentioned earlier. % % \DescribeEnv[<description>]{environment}{<environment>} -% [<\# of args>]{<arg 1 description>}'...' -% {<arg n description>} +% [<\# of args>]{<arg 1 description>}[<default value>]'...' +% {<arg n description>}[<default value>] % This environment describes the implementation of an environment. % % \DescribeEnv[<description>]{option}{<option>} @@ -771,13 +781,15 @@ % \end{macrocode} % The rest is basically just styling. % \begin{macrocode} -\RequirePackage[british]{babel} -\RequirePackage[english=british]{csquotes} -\RequirePackage[font=small,labelfont=bf,textfont=it]{caption} -\RequirePackage{scrpage2,PTSerif} -\usepackage{sourcecodepro} -\RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} -\RequirePackage[babel]{microtype} +\RequirePackage{scrpage2} +\AtEndOfClass{% + \RequirePackage[\skdoc@babel]{babel} + \RequirePackage[english=british]{csquotes} + \RequirePackage[font=small,labelfont=bf,textfont=it]{caption} + \RequirePackage{PTSerif,sourcecodepro} + \RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} + \RequirePackage[babel]{microtype} +} % \end{macrocode} % % \subsection{Error messages} @@ -882,6 +894,7 @@ prefix=skdoc@ } \DeclareStringOption{load}[\jobname] +\DeclareStringOption[british]{babel} \DeclareBoolOption[true]{highlight} \ProcessKeyvalOptions* % \end{macrocode} @@ -2031,7 +2044,7 @@ }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } % \end{macrocode} % \end{environment} @@ -2059,7 +2072,7 @@ }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } % \end{macrocode} % \end{environment} @@ -2073,6 +2086,7 @@ \index@option!{#2} \@optionname{#2}% \IfBooleanTF{#1}{}{ + \vspace{\baselineskip} \PrintEnvImplName{#2} \IfNoValueTF{#3}{ \macro@impl@argline@noarg{(option)} @@ -2084,7 +2098,7 @@ }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } % \end{macrocode} % \end{environment} @@ -2097,12 +2111,13 @@ \index@bibentry!{\expandafter\@gobble\string#2} \@bibentryname{#2}% \IfBooleanTF{#1}{}{ + \vspace{\baselineskip} \PrintEnvImplName{#2} \macro@impl@argline@noarg{(\hologoRobust{BibTeX}~entry~type)} }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } % \end{macrocode} % \end{environment} @@ -2115,12 +2130,13 @@ \index@theme!{#2} \@themename{#2}% \IfBooleanTF{#1}{}{ + \vspace{\baselineskip} \PrintEnvImplName{#2} \macro@impl@argline@noarg{(theme)} }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } % \end{macrocode} % \end{environment} @@ -2231,6 +2247,41 @@ } % \end{macrocode} % \end{macro*} +% \begin{macro*}{\macro@impl@arg@noopt} +% \begin{macrocode} +\def\macro@impl@arg@noopt#1{% + \macro@impl@argline{\the\macro@impl@curarg}{#1} + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +% \end{macrocode} +% \end{macro*} +% \begin{macro*}{\macro@impl@arg@opt} +% \begin{macrocode} +\def\macro@impl@arg@opt#1[#2]{% + \macro@impl@argline{\the\macro@impl@curarg} + {#1\hfill\AndDefault{#1}\vspace{-\baselineskip}} + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +% \end{macrocode} +% \end{macro*} +% \begin{macro*}{\macro@impl@arg} +% \begin{macrocode} +\def\macro@impl@arg#1{% + \advance\macro@impl@curarg by\@ne\relax + \@ifnextchar[%] + {\macro@impl@arg@opt{#1}}% + {\macro@impl@arg@noopt{#1}}% +} +% \end{macrocode} +% \end{macro*} % \begin{macro*}{\macro@impl@endargs} % \changes{1.3b}{Conditionally don't add space if another environment follows} % \begin{macrocode} @@ -3198,8 +3249,10 @@ % Set up microtype properly % \begin{macrocode} \g@addto@macro\@verbatim{\microtypesetup{activate=false}} -\microtypesetup{expansion,kerning,spacing,tracking} -\DisableLigatures{family = tt*} +\AtEndOfClass{% + \microtypesetup{expansion,kerning,spacing,tracking}% + \DisableLigatures{family = tt*}% +} % \end{macrocode} % We also want numbers on the bibliography headings, if we are loading % \pkg{biblatex}. If we happen to be loading \pkg{bibtex}, we issue a diff --git a/Master/texmf-dist/tex/latex/skdoc/skdoc.cls b/Master/texmf-dist/tex/latex/skdoc/skdoc.cls index d65f36b624c..11a38ca6186 100644 --- a/Master/texmf-dist/tex/latex/skdoc/skdoc.cls +++ b/Master/texmf-dist/tex/latex/skdoc/skdoc.cls @@ -26,7 +26,7 @@ %% and the derived filebase skdoc.cls. \RequirePackage{expl3} \ProvidesExplClass{skdoc} - {2013/05/24}{1.3b}{skdoc documentation class} + {2013/09/23}{1.4}{skdoc documentation class} \PassOptionsToPackage{log-declarations=false}{xparse} \LoadClass[ DIV7, headings=big, @@ -40,13 +40,15 @@ \RequirePackage[nomain,xindy,numberedsection,order=letter, sanitize={description=false,sort=false}]{glossaries} \RequirePackage{ydoc-code,ydoc-desc} -\RequirePackage[british]{babel} -\RequirePackage[english=british]{csquotes} -\RequirePackage[font=small,labelfont=bf,textfont=it]{caption} -\RequirePackage{scrpage2,PTSerif} -\usepackage{sourcecodepro} -\RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} -\RequirePackage[babel]{microtype} +\RequirePackage{scrpage2} +\AtEndOfClass{% + \RequirePackage[\skdoc@babel]{babel} + \RequirePackage[english=british]{csquotes} + \RequirePackage[font=small,labelfont=bf,textfont=it]{caption} + \RequirePackage{PTSerif,sourcecodepro} + \RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} + \RequirePackage[babel]{microtype} +} \msg_new:nnn{skdoc}{key-exists}{File~key~"#1"~already~declared!} \msg_new:nnn{skdoc}{key-nexists}{File~key~"#1"~hasn't~been~declared!} \msg_new:nnn{skdoc}{wrote-file}{Writing~things~to~file~"#1".} @@ -83,6 +85,7 @@ prefix=skdoc@ } \DeclareStringOption{load}[\jobname] +\DeclareStringOption[british]{babel} \DeclareBoolOption[true]{highlight} \ProcessKeyvalOptions* \IfStrEq{\skdoc@load}{}{}{% @@ -734,7 +737,7 @@ }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } \DeclareDocumentEnvironment{environment}{smo}{% \IfBooleanTF{#1}{}{\@bsphack} @@ -754,13 +757,14 @@ }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } \DeclareDocumentEnvironment{option}{smg}{% \IfBooleanTF{#1}{}{\@bsphack} \index@option!{#2} \@optionname{#2}% \IfBooleanTF{#1}{}{ + \vspace{\baselineskip} \PrintEnvImplName{#2} \IfNoValueTF{#3}{ \macro@impl@argline@noarg{(option)} @@ -772,31 +776,33 @@ }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } \DeclareDocumentEnvironment{bibentry}{sm}{% \IfBooleanTF{#1}{}{\@bsphack} \index@bibentry!{\expandafter\@gobble\string#2} \@bibentryname{#2}% \IfBooleanTF{#1}{}{ + \vspace{\baselineskip} \PrintEnvImplName{#2} \macro@impl@argline@noarg{(\hologoRobust{BibTeX}~entry~type)} }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } \DeclareDocumentEnvironment{theme}{sm}{% \IfBooleanTF{#1}{}{\@bsphack} \index@theme!{#2} \@themename{#2}% \IfBooleanTF{#1}{}{ + \vspace{\baselineskip} \PrintEnvImplName{#2} \macro@impl@argline@noarg{(theme)} }% }{ \let\skdoc@macroname@key\@empty - \IfBooleanTF{#1}{}{\@esphack} + \IfBooleanTF{#1}{}{\par\@esphack} } \DeclareDocumentEnvironment{macro*}{mo}% {\begin{macro}*{#1}[#2]}{\end{macro}} @@ -845,6 +851,29 @@ \expandafter\macro@impl@endargs \fi } +\def\macro@impl@arg@noopt#1{% + \macro@impl@argline{\the\macro@impl@curarg}{#1} + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +\def\macro@impl@arg@opt#1[#2]{% + \macro@impl@argline{\the\macro@impl@curarg} + {#1\hfill\AndDefault{#1}\vspace{-\baselineskip}} + \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax + \expandafter\macro@impl@arg + \else + \expandafter\macro@impl@endargs + \fi +} +\def\macro@impl@arg#1{% + \advance\macro@impl@curarg by\@ne\relax + \@ifnextchar[%] + {\macro@impl@arg@opt{#1}}% + {\macro@impl@arg@noopt{#1}}% +} \def\macro@impl@endargs{ \endgroup \peek_meaning_ignore_spaces:NTF\begin @@ -1395,8 +1424,10 @@ \csname the#1\endcsname\enskip}% } \g@addto@macro\@verbatim{\microtypesetup{activate=false}} -\microtypesetup{expansion,kerning,spacing,tracking} -\DisableLigatures{family = tt*} +\AtEndOfClass{% + \microtypesetup{expansion,kerning,spacing,tracking}% + \DisableLigatures{family = tt*}% +} \AtBeginDocument{ \ifdefined\defbibheading \defbibheading{bibliography}[\bibname]{\section{#1}} |