[pstricks] lua code
Herbert Voss
Herbert.Voss at fu-berlin.de
Mon May 20 09:33:56 CEST 2024
Hello all,
an example with using Luacode and PSTricks. Needs a run with lualatex.
\documentclass{article}
\usepackage{pstricks}
\usepackage{multido}
\usepackage{luacode}
\newpsstyle{gridstyle}{gridlabels=0,subgriddiv=1,gridwidth=6pt,gridcolor=gray,}
\def\QDisk(#1,#2){\qdisk(#1,#2){8.242pt}
\rput(#1,#2){\directlua{tex.print(getChar())}}}
\begin{luacode*}
letterNo = 0
function getChar()
letterNo = letterNo % 26 + 1
return string.char(64+letterNo)
end
\end{luacode*}
\begin{document}
\begin{pspicture}(8,8)
\psframe*(8,8)
\psgrid[style=gridstyle]
\psset{linecolor=white}
\multido{\ia=1+1}{7}{%
\multido{\ib=1+1}{7}{\QDisk(\ia,\ib)}}
\end{pspicture}
\end{document}
Herbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto 2024-05-20 um 09.29.43.png
Type: image/png
Size: 64684 bytes
Desc: not available
URL: <https://tug.org/pipermail/pstricks/attachments/20240520/743b0da9/attachment-0001.png>
More information about the PSTricks
mailing list.