New answers tagged

1

\documentclass[pstricks,border=\dimexpr355pt/113\relax,12pt]{standalone} \usepackage{pst-tools,multido} \def\obj{% \pscircle[linecolor=yellow](.5,.5){12pt} \pscircle[linecolor=cyan](.5,.5){11pt}} \psRegisterList{No}{{0,0},{2,3},{4,4}} \begin{document} \multido{\iA=1+1}{3}{% \begin{pspicture}(8,8) \psframe[dimen=i,linewidth=\dimexpr355pt/...


1

The main problem is that \foreach buries each cycle inside a group. \documentclass[pstricks,border=3,12pt]{standalone} \newcommand\obj{% \pscircle[linecolor=yellow](.5,.5){12pt}% \pscircle[linecolor=cyan](.5,.5){11pt}% } \begin{document} \let\CUMULATIVE\undefined \foreach \k in {0/0,2/3,4/4}{ \xdef\CUMULATIVE{\ifdefined\CUMULATIVE \CUMULATIVE,\fi \k}...


2

Just spitballing here, I don't have a LaTeX installation handy at the moment, but perhaps something along the lines of \newcounter{foo} \foreach \k in {1,2,3}{ \setcounter{foo}{0} \foreach \j in {{(0,0)},{(2,3)},{(4,4)}}{ \stepcounter{foo} \ifnum\value{foo}<\k do stuff with \j \fi } } I offer no guarantees about off by one ...


1

OK, it seems the problem was, that the evaluation in the \foreach statement by default results in a floating point evaluation. So as we need an integer for the page to reference, we can as \foreach to to calculate one by saying int(\x+1) or the complete code: \documentclass[paper=155mm:230mm]{scrartcl} \usepackage[absolute]{textpos} \usepackage{graphicx,...


Top 50 recent answers are included