diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-19 22:23:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-19 22:23:54 +0000 |
commit | 3d10e4db332aa2b5b393b71cc1ec778aacd41046 (patch) | |
tree | 377c6677e3ec5495fc56b2ff964b1fd8f0ccfcb0 /Master/texmf-dist | |
parent | 9f85d0a8471c373b5f08275607bc6ffae1e0b700 (diff) |
skdoc (19jul13)
git-svn-id: svn://tug.org/texlive/trunk@31242 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/skdoc/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/skdoc/skdoc.pdf | bin | 178123 -> 244791 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/skdoc/skdoc.dtx | 84 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/skdoc/skdoc.cls | 71 |
4 files changed, 107 insertions, 50 deletions
diff --git a/Master/texmf-dist/doc/latex/skdoc/README b/Master/texmf-dist/doc/latex/skdoc/README index c1a5c43bd2c..387ecd5bea9 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.3a of the skdoc document class. It is designed to +This is version 1.3b 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 4217655a1d9..2fd28819611 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 afd57482a03..08dd5dd0416 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.3a}{skdoc documentation class} + {2013/05/24}{1.3b}{skdoc documentation class} %</class> % %<*driver> @@ -132,13 +132,14 @@ % {}{\small\pagemark} % \pagestyle{skdoc-class} % -% \version{1.3a} +% \version{1.3b} % \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}} % \changes{1.2}{Use \pkg{l3prg} booleans instead of toggles} % \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} % % \package[ctan=skdoc,vcs=https://github.com/urdh/skdoc]{skdoc} % \repository{https://github.com/urdh/skdoc} @@ -756,7 +757,7 @@ % These packages are basic low-level things that we use to declare % commands, work with strings and so on. % \begin{macrocode} -\RequirePackage{etoolbox,xstring,xparse,atbegshi,kvoptions,pdftexcmds} +\RequirePackage{etoolbox,xstring,xparse,atbegshi,kvoptions,pdftexcmds,everyhook} % \end{macrocode} % Now, higher-level packages we use in our definitions. % \begin{macrocode} @@ -774,7 +775,7 @@ \RequirePackage[english=british]{csquotes} \RequirePackage[font=small,labelfont=bf,textfont=it]{caption} \RequirePackage{scrpage2,PTSerif} -\usepackage[scaled=1.03]{inconsolata} +\usepackage{sourcecodepro} \RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} \RequirePackage[babel]{microtype} % \end{macrocode} @@ -839,6 +840,15 @@ \bool_gset_false:N\g__skdoc_in_implementation_bool % \end{macrocode} % \end{macro} +% \begin{macro}{\g__skdoc_negative_space_bool} +% This boolean keeps track of the negative spacing added by description +% environments, allowing \env{MacroCode} to offset it if it follows the +% start of these environments directly. Bit of a hack, really. +% \begin{macrocode} +\bool_new:N\g__skdoc_negative_space_bool +\bool_gset_false:N\g__skdoc_negative_space_bool +% \end{macrocode} +% \end{macro} % % Finally, we define a helpful conditional based on the last two % booleans. It decides wether code in \cs{skdoc@verbatim} is typeset @@ -1434,9 +1444,11 @@ % \begin{environment}{MacroCode}[1] % {The key of the file being described} % \changes{1.1}{Minor changes due to syntax highlighting} +% \changes{1.3b}{Offset negative spacing from the description environments} % \begin{macrocode} \DeclareDocumentEnvironment{MacroCode}{m}{ \__skdoc_if_print_code:T{ + \bool_if:NT\g__skdoc_negative_space_bool{\vspace{\baselineskip}} \vspace{.2\baselineskip} \bool_if:NF\g__skdoc_use_minted_bool{\par\noindent} } @@ -2002,7 +2014,7 @@ % \cs{macro@impl@args} will read} % \begin{macrocode} \DeclareDocumentEnvironment{macro}{smo}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@macro!{\expandafter\@gobble\string#2} \@macroname{#2}% \IfBooleanTF{#1}{ @@ -2030,7 +2042,7 @@ % \cs{macro@impl@args} will read} % \begin{macrocode} \DeclareDocumentEnvironment{environment}{smo}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@environment!{#2} \@environmentname{#2}% \IfBooleanTF{#1}{ @@ -2057,7 +2069,7 @@ % {Values this key-value option can take} % \begin{macrocode} \DeclareDocumentEnvironment{option}{smg}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@option!{#2} \@optionname{#2}% \IfBooleanTF{#1}{}{ @@ -2081,7 +2093,7 @@ % {Name of the \hologo{BibTeX} entry type being implemented} % \begin{macrocode} \DeclareDocumentEnvironment{bibentry}{sm}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@bibentry!{\expandafter\@gobble\string#2} \@bibentryname{#2}% \IfBooleanTF{#1}{}{ @@ -2099,7 +2111,7 @@ % {Name of the theme being implemented} % \begin{macrocode} \DeclareDocumentEnvironment{theme}{sm}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@theme!{#2} \@themename{#2}% \IfBooleanTF{#1}{}{ @@ -2220,14 +2232,26 @@ % \end{macrocode} % \end{macro*} % \begin{macro*}{\macro@impl@endargs} +% \changes{1.3b}{Conditionally don't add space if another environment follows} % \begin{macrocode} \def\macro@impl@endargs{ - \endgroup\par + \endgroup + \peek_meaning_ignore_spaces:NTF\begin + { + \vspace{-\baselineskip} + \bool_gset_true:N\g__skdoc_negative_space_bool + \PushPreHook{par}{ + \bool_gset_false:N\g__skdoc_negative_space_bool + \PopPreHook{par} + } + } + {\par\medskip}% } % \end{macrocode} % \end{macro*} % \begin{macro*}{\macro@impl@argline@noarg}[1] % {The line to print instead of an argument line} +% \changes{1.3b}{Conditionally don't add space if another environment follows} % This last macro is a replacement used when there are no arguments % or if the implementation is an option or something like that. It % behaves pretty much like \cs{macro@impl@args}, but with only one @@ -2235,7 +2259,17 @@ % \begin{macrocode} \def\macro@impl@argline@noarg#1{% \vspace*{-\baselineskip} - \par\noindent{#1\strut}\par\medskip% + \par\noindent{#1\strut} + \peek_meaning_ignore_spaces:NTF\begin + { + \vspace{-\baselineskip} + \bool_gset_true:N\g__skdoc_negative_space_bool + \PushPreHook{par}{ + \bool_gset_false:N\g__skdoc_negative_space_bool + \PopPreHook{par} + } + } + {\par\medskip}% } % \end{macrocode} % \end{macro*} @@ -2319,9 +2353,9 @@ % {The name of the macro being indexed, without backslash} % \begin{macrocode} \DeclareDocumentCommand\index@macro{st!m}{ - \def\skdoc@temp{#3} + \def\skdoc@temp{#3-macro} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{#3}{\cs*{#3}} + \@index@{#3-macro}{\cs*{#3}} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -2343,9 +2377,9 @@ % {The name of the environment being indexed} % \begin{macrocode} \DeclareDocumentCommand\index@environment{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-env} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\env*{\string#3}~(environment)} + \@index@{\string#3-env}{\env*{\string#3}~(environment)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -2367,9 +2401,9 @@ % {The name of the option being indexed} % \begin{macrocode} \DeclareDocumentCommand\index@option{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-opt} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\opt*{\string#3}~(option)} + \@index@{\string#3-opt}{\opt*{\string#3}~(option)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -2392,9 +2426,9 @@ % being indexed, without initial \texttt{@} sign} % \begin{macrocode} \DeclareDocumentCommand\index@bibentry{st!m}{ - \def\skdoc@temp{#3} + \def\skdoc@temp{#3-bib} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{#3}{\bib*{#3}~(\hologoRobust{BibTeX}~entry~type)} + \@index@{#3-bib}{\bib*{#3}~(\hologoRobust{BibTeX}~entry~type)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -2416,9 +2450,9 @@ % {The name of the theme being indexed} % \begin{macrocode} \DeclareDocumentCommand\index@theme{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-theme} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\thm*{\string#3}~(theme)} + \@index@{\string#3-theme}{\thm*{\string#3}~(theme)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -2440,9 +2474,9 @@ % {The name of the package being indexed} % \begin{macrocode} \DeclareDocumentCommand\index@package{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-pkg} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\pkg*{\string#3}~(package)} + \@index@{\string#3-pkg}{\pkg*{\string#3}~(package)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -2464,9 +2498,9 @@ % {The name of the file being indexed} % \begin{macrocode} \DeclareDocumentCommand\index@file{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-file} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\file*{\string#3}~(file)} + \@index@{\string#3-file}{\file*{\string#3}~(file)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ diff --git a/Master/texmf-dist/tex/latex/skdoc/skdoc.cls b/Master/texmf-dist/tex/latex/skdoc/skdoc.cls index a03f7990f41..d65f36b624c 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.3a}{skdoc documentation class} + {2013/05/24}{1.3b}{skdoc documentation class} \PassOptionsToPackage{log-declarations=false}{xparse} \LoadClass[ DIV7, headings=big, @@ -35,7 +35,7 @@ bibliography=totocnumbered, index=totoc ]{scrartcl} -\RequirePackage{etoolbox,xstring,xparse,atbegshi,kvoptions,pdftexcmds} +\RequirePackage{etoolbox,xstring,xparse,atbegshi,kvoptions,pdftexcmds,everyhook} \RequirePackage{verbatim,needspace,marginnote,calc,hyperref,multicol,hologo} \RequirePackage[nomain,xindy,numberedsection,order=letter, sanitize={description=false,sort=false}]{glossaries} @@ -44,7 +44,7 @@ \RequirePackage[english=british]{csquotes} \RequirePackage[font=small,labelfont=bf,textfont=it]{caption} \RequirePackage{scrpage2,PTSerif} -\usepackage[scaled=1.03]{inconsolata} +\usepackage{sourcecodepro} \RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} \RequirePackage[babel]{microtype} \msg_new:nnn{skdoc}{key-exists}{File~key~"#1"~already~declared!} @@ -66,6 +66,8 @@ \bool_gset_true:N\g__skdoc_with_implementation_bool \bool_new:N\g__skdoc_in_implementation_bool \bool_gset_false:N\g__skdoc_in_implementation_bool +\bool_new:N\g__skdoc_negative_space_bool +\bool_gset_false:N\g__skdoc_negative_space_bool \prg_new_conditional:Nnn\__skdoc_if_print_code:{p,T,F,TF}{ \bool_if:nTF{ \g__skdoc_in_implementation_bool && @@ -438,6 +440,7 @@ } \DeclareDocumentEnvironment{MacroCode}{m}{ \__skdoc_if_print_code:T{ + \bool_if:NT\g__skdoc_negative_space_bool{\vspace{\baselineskip}} \vspace{.2\baselineskip} \bool_if:NF\g__skdoc_use_minted_bool{\par\noindent} } @@ -714,7 +717,7 @@ \vspace*{\c__skdoc_example_margin_dim}\par } \DeclareDocumentEnvironment{macro}{smo}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@macro!{\expandafter\@gobble\string#2} \@macroname{#2}% \IfBooleanTF{#1}{ @@ -734,7 +737,7 @@ \IfBooleanTF{#1}{}{\@esphack} } \DeclareDocumentEnvironment{environment}{smo}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@environment!{#2} \@environmentname{#2}% \IfBooleanTF{#1}{ @@ -754,7 +757,7 @@ \IfBooleanTF{#1}{}{\@esphack} } \DeclareDocumentEnvironment{option}{smg}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@option!{#2} \@optionname{#2}% \IfBooleanTF{#1}{}{ @@ -772,7 +775,7 @@ \IfBooleanTF{#1}{}{\@esphack} } \DeclareDocumentEnvironment{bibentry}{sm}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@bibentry!{\expandafter\@gobble\string#2} \@bibentryname{#2}% \IfBooleanTF{#1}{}{ @@ -784,7 +787,7 @@ \IfBooleanTF{#1}{}{\@esphack} } \DeclareDocumentEnvironment{theme}{sm}{% - \@bsphack + \IfBooleanTF{#1}{}{\@bsphack} \index@theme!{#2} \@themename{#2}% \IfBooleanTF{#1}{}{ @@ -843,11 +846,31 @@ \fi } \def\macro@impl@endargs{ - \endgroup\par + \endgroup + \peek_meaning_ignore_spaces:NTF\begin + { + \vspace{-\baselineskip} + \bool_gset_true:N\g__skdoc_negative_space_bool + \PushPreHook{par}{ + \bool_gset_false:N\g__skdoc_negative_space_bool + \PopPreHook{par} + } + } + {\par\medskip}% } \def\macro@impl@argline@noarg#1{% \vspace*{-\baselineskip} - \par\noindent{#1\strut}\par\medskip% + \par\noindent{#1\strut} + \peek_meaning_ignore_spaces:NTF\begin + { + \vspace{-\baselineskip} + \bool_gset_true:N\g__skdoc_negative_space_bool + \PushPreHook{par}{ + \bool_gset_false:N\g__skdoc_negative_space_bool + \PopPreHook{par} + } + } + {\par\medskip}% } \prg_new_conditional:Nnn\__skdoc_if_do_index:{p,T,F,TF}{ \bool_if:nTF{ @@ -873,9 +896,9 @@ } } \DeclareDocumentCommand\index@macro{st!m}{ - \def\skdoc@temp{#3} + \def\skdoc@temp{#3-macro} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{#3}{\cs*{#3}} + \@index@{#3-macro}{\cs*{#3}} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -890,9 +913,9 @@ } } \DeclareDocumentCommand\index@environment{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-env} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\env*{\string#3}~(environment)} + \@index@{\string#3-env}{\env*{\string#3}~(environment)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -907,9 +930,9 @@ } } \DeclareDocumentCommand\index@option{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-opt} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\opt*{\string#3}~(option)} + \@index@{\string#3-opt}{\opt*{\string#3}~(option)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -924,9 +947,9 @@ } } \DeclareDocumentCommand\index@bibentry{st!m}{ - \def\skdoc@temp{#3} + \def\skdoc@temp{#3-bib} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{#3}{\bib*{#3}~(\hologoRobust{BibTeX}~entry~type)} + \@index@{#3-bib}{\bib*{#3}~(\hologoRobust{BibTeX}~entry~type)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -941,9 +964,9 @@ } } \DeclareDocumentCommand\index@theme{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-theme} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\thm*{\string#3}~(theme)} + \@index@{\string#3-theme}{\thm*{\string#3}~(theme)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -958,9 +981,9 @@ } } \DeclareDocumentCommand\index@package{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-pkg} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\pkg*{\string#3}~(package)} + \@index@{\string#3-pkg}{\pkg*{\string#3}~(package)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ @@ -975,9 +998,9 @@ } } \DeclareDocumentCommand\index@file{st!m}{ - \def\skdoc@temp{\string#3} + \def\skdoc@temp{\string#3-file} \ifglsentryexists{index-\skdoc@temp}{}{ - \@index@{\string#3}{\file*{\string#3}~(file)} + \@index@{\string#3-file}{\file*{\string#3}~(file)} } \__skdoc_if_do_index:T{ \IfBooleanTF{#2}{ |