# How to output text value of counter in for loop

Consider following code:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{forloop}

\begin{document}

\newcounter{i}
\forloop{i}{0}{\value{i} < 3}
{
% trying to get the text of the counter i i.e. 0 1 2
% I tried the following and doesn't seem to work
$\value{i}$
$\text\value{i}$
}

\end{document}


I've looked online and couldn't find anything so hope you can help.

• Welcome to TeX.sx! I'm not sure I understand correctly what you mean with “text value”. It seems like you're looking for \arabic{i} – clemens Aug 11 '15 at 10:19

\documentclass{article}
\usepackage{forloop}

\begin{document}

\newcounter{i}
\forloop{i}{1}{\value{i} < 4}
{
$\thei$
}

\forloop{i}{1}{\value{i} < 4}
{
\roman{i}
}

\end{document}