File: forloop.plt

package info (click to toggle)
tralics 2.14.4-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 17,152 kB
  • ctags: 8,260
  • sloc: cpp: 49,403; xml: 18,145; sh: 140; makefile: 118
file content (37 lines) | stat: -rw-r--r-- 920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
%%%%%  -*- latex -*-

%% $Id: forloop.plt,v 2.1 2009/01/15 18:10:58 grimm Exp $
%% TRALICS, copyright (C) INRIA/apics (Jose' Grimm) 2008
%% Licensed under the CeCILL free software license 
%% (See the file COPYING in the main directory for details)
% Original code by nsetzer (C) LGPL


\ProvidesPackage{forloop}  [2008/01/10 v1.0 For Loops for LaTeX]
\RequirePackage{ifthen}



\newcommand{\forloop}[5][1]{%
  \setcounter{#2}{#3}%
  \ifthenelse{#4}
  {#5\addtocounter{#2}{#1}\forloop[#1]{#2}{\value{#2}}{#4}{#5}}
  {}}

% Original code 
% \newcommand{\forLoop}[5][1]{%
%   \setcounter{#4}{#2}%
%   \ifthenelse{ \value{#4}<#3 }
%   {#5\addtocounter{#4}{#1}\forLoop[#1]{\value{#4}}{#3}{#4}{#5}}
%   {\ifthenelse{\value{#4}=#3}
%     {#5}
%     {}}}

\newcommand{\forLoop}[5][1]{%
  \setcounter{#4}{#2}%
  \ifthenelse{\not  \value{#4}>#3 }
  {#5\addtocounter{#4}{#1}\forLoop[#1]{\value{#4}}{#3}{#4}{#5}}
  {}}


\endinput