summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/rgltxdoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-12 23:08:55 +0000
committerKarl Berry <karl@freefriends.org>2019-01-12 23:08:55 +0000
commitc165ac30d7928856afc4e2bb88e987bf2e9f40b5 (patch)
tree8c02923486c17a5baaa88b546b137488b9cd1a38 /Master/texmf-dist/tex/latex/rgltxdoc
parent22f798b763d55c24eab8107dc76d4f200ca3ccf3 (diff)
rgltxdoc (12jan19)
git-svn-id: svn://tug.org/texlive/trunk@49684 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/rgltxdoc')
-rw-r--r--Master/texmf-dist/tex/latex/rgltxdoc/rgltxdoc.sty168
1 files changed, 168 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/rgltxdoc/rgltxdoc.sty b/Master/texmf-dist/tex/latex/rgltxdoc/rgltxdoc.sty
new file mode 100644
index 00000000000..d750caa078d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/rgltxdoc/rgltxdoc.sty
@@ -0,0 +1,168 @@
+%%
+%% This is file `rgltxdoc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% rgltxdoc.dtx (with options: `package')
+%%
+%% Copyright (C) 2018-2019 by Richard Grewe <r-g+tex@posteo.net>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.2 of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of LaTeX version
+%% 1999/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{rgltxdoc}
+ [2019/01/05 v1 Common documentation code used for Richard Grewe's packages]
+\RequirePackage{ifluatex}
+\RequirePackage{etoolbox}
+\ifbool{luatex}{
+ \RequirePackage[utf8]{luainputenc}
+ \RequirePackage{polyglossia}
+ \setmainlanguage[variant=american]{english}
+}{
+ \RequirePackage[utf8]{inputenc}
+ \RequirePackage[english]{babel}
+}
+\RequirePackage[a4paper,twoside=false]{geometry}
+\RequirePackage[DIV=9,BCOR=2.25cm]{typearea}
+\ifbool{luatex}{
+ \RequirePackage{fontspec}
+ \setmainfont[SmallCapsFont={* Caps}]{Latin Modern Roman}
+ \setsansfont{Latin Modern Sans}
+ \setmonofont[Scale=MatchLowercase,
+ SmallCapsFont={Latin Modern Mono Caps}]
+ {Latin Modern Mono Light}
+}{
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage[lighttt]{lmodern}
+ \bgroup\setbox\z@\hbox{\ttfamily ignore}\egroup
+ \DeclareFontShape{T1}{lmtt}{m}{it}{<->sub*lmtt/m/sl}{}
+}
+\RequirePackage{microtype}
+\RequirePackage{csquotes}
+\MakeOuterQuote{"}
+\RequirePackage{enumitem}
+\RequirePackage[columns=2]{idxlayout}
+\RequirePackage{varioref}
+\RequirePackage{hypdoc}
+\RequirePackage[capitalise,noabbrev,nameinlink]{cleveref}
+\RequirePackage{doc}
+\newcommand\NewNiceDescription[4]{%
+ \expandafter\newcommand\csname NiceDescribe#1\endcsname{%
+ \csname NiceDescribe#1s\endcsname{1}}%
+ \expandafter\newcommand\csname NiceDescribe#1s\endcsname{%
+ \rgltxdoc@Desc
+ {\csuse{rgltxdoc@@efmt@#1}}
+ {\csuse{rgltxdoc@@afmt@#1}}
+ {#4}}%
+ \csdef{rgltxdoc@@efmt@#1}##1{#2}%
+ \csdef{rgltxdoc@@afmt@#1}##1{#3}}
+\NewNiceDescription{Macro}{\string#1}{#1}{\SpecialUsageIndex}
+\NewNiceDescription{Env}
+ {\textcolor{gray}{\cs{begin}}\cmarg{#1}\\
+ \textcolor{gray}{\cs{end}}\cmarg{#1}}
+ {#1}{\SpecialEnvIndex}
+\NewNiceDescription{Counter}{#1}{#1}
+ {\SpecialOtherIndex{counter}{counters}}
+\newcommand\SpecialOtherIndex[3]{\@bsphack
+ \index{#3\actualchar{\protect\ttfamily#3}
+ (#1)\encapchar usage}%
+ \index{#2:\levelchar#3\actualchar
+ {\protect\ttfamily#3}\encapchar usage}\@esphack}
+\RequirePackage{pbox}
+\newcommand\rgltxdoc@Desc{\medskip\par\noindent\rgltxdoc@DescRec}
+\newcommand\rgltxdoc@DescRec[4]{%
+ \@ifnextchar[%]
+ {\rgltxdoc@DescRec@i{#1}{#2}{#3}{#4}}%
+ {\rgltxdoc@DescRec@i{#1}{#2}{#3}{#4}[]}}
+\def\rgltxdoc@DescRec@i#1#2#3#4[#5]#6#7{%
+ \leavevmode\null\hbox to\z@{\hss%
+ \pbox[t]{3\marginparwidth}{\ttfamily #1{#6}}%
+ \ifstrempty{#7}{\quad}{}}%
+ #2{#7}\relax
+ \ifstrempty{#5}%
+ {#3{#6}}%
+ {\forcsvlist{#3}{#5}}%
+ \ifnumgreater{#4}{1}%
+ {\\\rgltxdoc@DescRec{#1}{#2}{#3}{#4-1}}%
+ {\ifstrempty{#7}{}{\smallskip\par\noindent}\ignorespaces}}
+\RequirePackage{keyvaltable}
+\kvtSet{headbg=black!10,rowbg=white..black!5}
+\NewKeyValTable{KeyDesc}{%
+ key: align=l, format=\texttt, head=\textbf{Key};
+ desc: align=X, head=\textbf{Description and Possible Values};
+ default: align=l, format=\texttt, head=\textbf{Default};
+}
+\NewKeyValTable[showhead=false]{ValDesc}{%
+ val: align=l, format=\texttt, head=\textbf{Value};
+ desc: align=X, head=\textbf{Description};
+}
+\NewKeyValTable[showhead=false]{ArgDesc}{%
+ arg: align=l, head=\textbf{Argument};
+ desc: align=X, head=\textbf{Description};
+}
+\newcommand\env[1]{\texttt{#1}}
+\newrobustcmd\pkgname[1]{%
+ \IfFileExists{#1.sty}
+ {\textsf{#1}}
+ {\rgltxdoc@err{Package `#1' not found. Spelling?}}}
+\newcommand\cmarg[1]{\mbox{\texttt{\string{#1\string}}}}
+\newcommand\coarg[1]{\mbox{\texttt{[#1]}}}
+\RequirePackage{hologo}
+\RequirePackage{showexpl}
+\lstset{%
+ gobble=2,
+ frame=trbl,
+ backgroundcolor=\color{black!5!white},
+ explpreset={%
+ numbers=none, columns=flexible, basicstyle=\footnotesize\ttfamily},
+ numbers=none, columns=flexible, basicstyle=\footnotesize\ttfamily,
+ preset={\rgltxdoc@ExampleFix\rgltxdoc@SaveSecs\small\sffamily},
+ overhang=2cm,
+ pos=r,
+ captionpos=b}
+\crefname{lstlisting}{Listing}{Listings}
+\lst@Key{morepreset}\relax{\appto\SX@preset{#1}}
+\newcommand\rgltxdoc@ExampleFix{%
+ \renewcommand\label[2][]{%
+ \global\csletcs{rgltxdoc@@lbl@##2}{@currentlabel}%
+ \ifstrempty{##1}
+ {\csxdef{rgltxdoc@@lbltype@##2}{\rgltxdoc@curlbltype}}
+ {\csgdef{rgltxdoc@@lbltype@##2}{##1}}}%
+ \def\ref##1{\csuse{rgltxdoc@@lbl@##1}}%
+ \def\cref##1{%
+ \csuse{cref@\csuse{rgltxdoc@@lbltype@##1}@name}~\ref{##1}}%
+ \let\marginpar=\rgltxdoc@@marginpar
+}
+\let\rgltxdoc@@marginpar=\marginpar
+\def\rgltxdoc@curlbltype{%
+ \@ifundefined{cref@currentlabel}{}
+ {\expandafter\rgltxdoc@curlbltype@i\cref@currentlabel\@nil}}
+\def\rgltxdoc@curlbltype@i[#1][#2][#3]#4\@nil{#1}
+\newcommand\rgltxdoc@SaveSecs{%
+ \@for\SC:=chapter,section,subsection,subsubsection\do{%
+ \@ifundefined{c@\SC}{}
+ {\csedef{rgltx@@ctr@\SC}{\the\value{\SC}}%
+ \setcounter{\SC}{0}}}}
+\newcommand\rgltxdoc@RestoreSecs{%
+ \@for\SC:=chapter,section,subsection,subsubsection\do{%
+ \@ifundefined{c@\SC}{}
+ {\setcounter{\SC}{\csuse{rgltx@@ctr@\SC}}}}}
+\patchcmd{\SX@resultInput}{\par}{\rgltxdoc@RestoreSecs\par}
+ {}
+ {\rgltxdoc@warn{Could not patch showexpl to reset section counters.}}
+\newcommand\rgltxdoc@err[1]{%
+ \PackageError{rgltxdoc}{#1}{}}
+\newcommand\rgltxdoc@warn[1]{%
+ \PackageWarning{rgltxdoc}{#1}{}}
+\endinput
+%%
+%% End of file `rgltxdoc.sty'.