2

I'm trying to create 5*2 matrix using \psframe. I want to repeat the following code using loops and changing the coordinates. Means just adding into X and Y coordinates and getting the results.

\documentclass[a4paper]{article}
\usepackage{pstricks}
\begin{document}
\psframe(-3,-1)(5.5,3) %frame1
\end{document}
Werner
  • 14,324
  • 7
  • 55
  • 77
Bhavneet
  • 317
  • 1
  • 4
  • 6

2 Answers2

2

It's not a loop in LaTeX but in PSTricks:

\documentclass[a4paper]{article}
\usepackage{pstricks}
\begin{document}
\psframe(-3,-1)(5.5,3) %frame1

\begin{pspicture}(4,4)
\multirput(0,0)(1,0){4}{
    \multirput(0,0)(0,1){3}{
        \psframe(0,-1)(1,1)}
}
\end{pspicture}
\end{document}
harper
  • 13,345
  • 8
  • 56
  • 105
0

PGF has the pgffor package. It can be used independent of PGF so in principal you could use it for PSTricks. In the future, you might look into using PGF/TikZ unless you are bound to PSTricks, it's being actively developed and can do some really amazing things.

Joel Berger
  • 20,180
  • 5
  • 49
  • 104