1
저는 LaTex에서 루프를 만들려고하지만, 처음으로 만 출력됩니다. 여기 내가 무슨 일을하는지 요지가 있지만 루프가 제대로 작동하지 않습니다.라텍스의 루프가 작동하지 않습니다.
\documentclass[12pt]{article}
%%% FOR LOOP CODE
\usepackage{ifthen}
\newcommand{\forLoop}[5][1]{%
\setcounter{#4}{#2} %
\ifthenelse{ \value{#4}<#3 }%
{%
#5 %
\addtocounter{#4}{#1} %
\forLoop[#1]{\value{#4}}{#3}{#4}{#5} %
}%
{%
#5 %
}%
}%
%% END FOR LOOP CODE
\begin{document}
Practice loop
\newcounter{index}
\section{Example 1}
\forLoop[2]{1}{5}{index}
{
This is inside the for loop: iteration \theindex\\
}
\end{document}