考虑下面的代码:
\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}
我在网上查过了,没有找到任何东西,所以希望你能帮忙。
答案1
这个怎么样:
\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}