summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/circledsteps/circledsteps.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/circledsteps/circledsteps.sty')
-rw-r--r--macros/latex/contrib/circledsteps/circledsteps.sty49
1 files changed, 40 insertions, 9 deletions
diff --git a/macros/latex/contrib/circledsteps/circledsteps.sty b/macros/latex/contrib/circledsteps/circledsteps.sty
index f70e179cdf..8949ec71cb 100644
--- a/macros/latex/contrib/circledsteps/circledsteps.sty
+++ b/macros/latex/contrib/circledsteps/circledsteps.sty
@@ -1,6 +1,6 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
-\ProvidesPackage{circledsteps}[2019/06/19 v1.0 Circled steps that you can reference]
+\ProvidesPackage{circledsteps}[2019/11/01 v1.1 Circled steps that you can reference]
% \end{macrocode}
%
% Copyright (c) 2019 Romano Giannetti
@@ -14,12 +14,25 @@
\RequirePackage{pgfkeys} % for the pgfkeys
\pgfkeys{/csteps/inner ysep/.initial=4pt,
/csteps/inner xsep/.initial=4pt,
- /csteps/inner color/.initial=red,
- /csteps/outer color/.initial=blue,
+ /csteps/inner color/.initial=none,
+ /csteps/outer color/.initial=none,
}
+\DeclareOption{redblue}{
+ \tikzset{/csteps/inner color=red, /csteps/outer color=blue}%
+}
+\DeclareOption{legacy}{
+ \tikzset{/csteps/inner color=red, /csteps/outer color=blue}%
+}
+
+% end of options definitions
+\ProcessOptions\relax
+
\newsavebox\csteps@CBox
\newlength\csteps@XLength \newlength\csteps@YLength \newlength\csteps@YDepth \newlength\csteps@tmplen
\def\csteps@CircledParam#1#2{\sbox\csteps@CBox{#2}%
+ \edef\csteps@none{none}%
+ \edef\csteps@outercolor{\pgfkeysvalueof{/csteps/outer color}}%
+ \edef\csteps@innercolor{\pgfkeysvalueof{/csteps/inner color}}%
\csteps@XLength=\wd\csteps@CBox\advance\csteps@XLength by\pgfkeysvalueof{/csteps/inner xsep}\relax
\csteps@tmplen=\pgfkeysvalueof{/csteps/inner ysep}\relax
\csteps@YDepth=\dp\csteps@CBox\advance\csteps@YDepth by 0.5\csteps@tmplen\relax
@@ -29,18 +42,36 @@
\ifdim\csteps@XLength>\csteps@YLength
\makebox[\csteps@XLength]{% X bigger than Y
\makebox(0,\csteps@YLength){%
- \color{\pgfkeysvalueof{/csteps/outer color}}\put(0,0){\oval(\csteps@XLength,\csteps@YLength)}%
+ \ifx\csteps@outercolor\csteps@none\else
+ \color{\csteps@outercolor}%
+ \fi
+ \put(0,0){\oval(\csteps@XLength,\csteps@YLength)}%
}%
\makebox(0,\csteps@YLength){%
- \put(-.5\wd\csteps@CBox,0){\textcolor{\pgfkeysvalueof{/csteps/inner color}}{#2}}%
+ \put(-.5\wd\csteps@CBox,0){%
+ \ifx\csteps@outercolor\csteps@none
+ #2\relax%
+ \else
+ \textcolor{\csteps@innercolor}{#2}%
+ \fi
+ }%
}}%
\else
\makebox[\csteps@YLength]{%
\makebox(0,\csteps@YLength){%
- \color{\pgfkeysvalueof{/csteps/outer color}}\put(0,0){\circle{\csteps@YLength}}%
+ \ifx\csteps@outercolor\csteps@none\else
+ \color{\csteps@outercolor}%
+ \fi
+ \put(0,0){\circle{\csteps@YLength}}%
}%
\makebox(0,\csteps@YLength){%
- \put(-.5\wd\csteps@CBox,0){\textcolor{\pgfkeysvalueof{/csteps/inner color}}{#2}}%
+ \put(-.5\wd\csteps@CBox,0){%
+ \ifx\csteps@outercolor\csteps@none
+ #2\relax%
+ \else
+ \textcolor{\csteps@innercolor}{#2}%
+ \fi
+ }%
}}%
\fi
}%
@@ -52,7 +83,7 @@
\def\CircledTop#1{\csteps@CircledParam{0}{#1}}
\newcommand{\CircledText}[1]{%
\begingroup
- \tikzset{/csteps/inner color=., /csteps/outer color=.}%
+ \tikzset{/csteps/inner color=none, /csteps/outer color=none}%
\Circled{#1}%
\endgroup
}
@@ -66,7 +97,7 @@
\refstepcounter{cstepcnt}%
\Circled{\scriptsize\arabic{cstepcnt}}%
}
-\renewcommand{\thecstepcnt}{\textbf{\arabic{cstepcnt}:}}
+\renewcommand{\thecstepcnt}{\arabic{cstepcnt}}
% \end{macrocode}
%
%