Using the \int_step_function
To use \int_step_function:nnnN
here, you would first need some way to convert the integer to a dimension for the radius. Much easier here is to use \dim_step_function:nnnN
, since you need a dimension.
To use \dim_step_function:nnnN
you need to make \draw_path_circle:nn { 0 , 0 }{ <radius> }
into a single (one-token, or N
-type) macro that takes the <radius>
as argument, so
\cs_new_protected:Npn \mathicon_circle_origin:n #1
{ \draw_path_circle:nn { 0 , 0 } {#1} }
then use as
% \dim_step_function:nnnN { begin } { step } { end } \function
\dim_step_function:nnnN { 0.5ex } { 0.25ex } { 1.0ex } \mathicon_circle_origin:n
Though if it's a one off, you can also use the inline
version:
% \dim_step_inline:nnnn { begin } { step } { end } { inline function }
\dim_step_inline:nnnn { 0.5ex } { 0.25ex } { 1.0ex } { \draw_path_circle:nn { 0 , 0 } {#1} }
Here's the full code:
\documentclass[letterpaper]{article}
\usepackage{l3draw}
\ExplSyntaxOn
\NewDocumentCommand{\miconcentric}{ O{0.08ex} }
{
\mathicon_concentric_circles:n {#1}
}
\cs_new_protected:Nn \mathicon_concentric_circles:n
{
\draw_begin:
\draw_linewidth:n { #1 }
% This
\dim_step_inline:nnnn { 0.5ex } { 0.25ex } { 1.0ex }
{ \draw_path_circle:nn { 0 , 0 } {##1} }
% or this and the definition below
% \dim_step_function:nnnN { 0.5ex } { 0.25ex } { 1.0ex }
% \mathicon_circle_origin:n
%
\draw_path_use_clear:n { stroke }
\draw_end:
}
\cs_new_protected:Npn \mathicon_circle_origin:n #1
{ \draw_path_circle:nn { 0 , 0 } {#1} }
\ExplSyntaxOff
\begin{document}
Sample \miconcentric
\end{document}
In this special case where the dimensions are integral multiples of a base one, namely 0.25ex
, with \int_step_inline:nnn
it's easy:
\documentclass[letterpaper]{article}
\usepackage{l3draw}
\ExplSyntaxOn
\NewDocumentCommand{\miconcentric}{ O{0.08ex} }
{
\mathicon_concentric_circles:n { #1 }
}
\cs_new_protected:Nn \mathicon_concentric_circles:n
{
\draw_begin:
\draw_linewidth:n { #1 }
\int_step_inline:nnn { 2 } { 4 }
{
\draw_path_circle:nn { 0 , 0 } { 0.25ex * ##1 }
}
\draw_path_use_clear:n { stroke }
\draw_end:
}
\ExplSyntaxOff
\begin{document}
Sample \miconcentric
\medskip
\LARGE
Sample \miconcentric[0.1pt]
\end{document}