2

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
3

How about this:

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.