start fancythm package

This commit is contained in:
Maximilian Keßler 2022-01-23 14:08:17 +01:00
parent ffff696fa3
commit 02356e81d7
3 changed files with 153 additions and 0 deletions

View File

@ -0,0 +1,21 @@
sty: clean-sty
pdflatex fancythm.ins
all: clean pdf sty
pdf:
pdflatex fancythm.dtx
makeindex -s gind.ist fancythm.idx
pdflatex fancythm.dtx
clean: clean-sty
latexmk -c fancythm.dtx
rm -f fancythm.hd
rm -f fancythm.glo
rm -f fancythm.pdf
clean-sty:
rm -f fancythm.sty
rm -f fancythm.tdo
.PHONY: pdf clean

View File

@ -0,0 +1,128 @@
% \iffalse meta-comment
%
%% File: fancytm.dtx
%
% Copyright (C) 2022 Maximilian Keßler
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in the file
%
% https://www.latex-project.org/lppl.txt
%
% -----------------------------------------------------------------------
%<package>\ProvidesExplPackage{fancythm}{2022/01/17}{0.0.1}{Grouped theorems.}
%
%<*driver>
\documentclass[full,kernel]{l3doc}
\usepackage{mkessler-todo}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \title{^^A
% The \pkg{fancythm} package^^A
% }
%
% \author{^^A
% Maximilian Keßler
% }
%
% \date{Released 2022-01-12}
%
% \maketitle
%
% \begin{documentation}
% \end{documentation}
%
%
% \begin{implementation}
%
% \section{\pkg{fancythm} implementation}
%
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
% \begin{macrocode}
%<@@=fancythm>
% \end{macrocode}
%
%
%
% \begin{macrocode}
\cs_set_eq:NN \arabic:n \arabic
\cs_set_eq:NN \counter_new:n \newcounter
\cs_set_eq:NN \counter_within:nn \counterwithin
\cs_new:Npn \counter_new:nn #1 #2
{
\counter_new:n { #1 }
\counter_within:nn { #1 } { #2 }
}
\cs_set_eq:Nc \counter_alias:nn { @counteralias } % this is from thmtools
\cs_set_eq:Nc \counter_undefined_error:n { @nocounterr }
\cs_new:Npn \counter_if_exist_p:n #1
{
\cs_if_exist_p:c { c@ #1 }
}
\cs_new:Npn \counter_if_exist:nT #1
{
\cs_if_exist:cT { c@ #1 }
}
\cs_new:Npn \counter_if_exist:nF #1
{
\cs_if_exist:cF { c@ #1 }
}
\cs_new:Npn \counter_if_exist:nTF #1
{
\cs_if_exist:cTF { c@ #1 }
}
\cs_new:Npn \counter_ensure_exist:n #1
{
\counter_if_exist:nF { #1 }
{
\counter_undefined_error:n { #1 }
}
}
\cs_new:Npn \counter_the:n #1
{
\use:c { the #1 }
}
\cs_new:Npn \counter_set_the:nn #1 #2
{
\counter_ensure_exist:n { #1 }
\exp_args:Nc \renewcommand { the #1 } { #2 }
}
\cs_new:Npn \counter_sub:nn #1 #2
{
\counter_within:nn { #1 } { #2 }
\counter_set_the:nn { #1 }
{
\counter_the:n { #2 } . \arabic:n { #1 }
}
}
\cs_new:Npn \@@_counter_sub_if_exist:n #1
{
\counter_if_exist:nT { #1 }
{
\counter_sub:nn { in #1 } { #1 }
}
}
% \end{macrocode}
%
%
%
% \begin{macrocode}
%</package>
% \end{macrocode}
%
% \end{implementation}
%
%
%
% \newpage

View File

@ -0,0 +1,4 @@
\input docstrip.tex
\keepsilent
\generate{\file{fancythm.sty}{\from{fancythm.dtx}{package}}}
\end