# Does LaTeX have a built-in scripting language?

Say I want to draw a simple graph in LaTeX.

I'm interested to know if you can write a for loop or something to create things like lines or squares programmatically in LaTeX.

-

TikZ is a powerful graphic package. It's a front end for the pgf package and can be used for programming drawings such as graphs. for loops a easy with TikZ.

Have a look at

If you would like to program more in general, you may consider to use LuaTeX, which allows using Lua as scripting language.

-

You can can also use the bundle pstricks:

\documentclass{article}
\begin{document}
\begin{pspicture}(5,5)
\psaxes{->}(0,0)(0,-5)(5,5)
\multido{\iA=-3+1}{7}{%
\psplot[algebraic,linecolor=red,yMaxValue=4]{0}{4}{\iA*x}
}
\end{pspicture}
\end{document}

-