Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/latex/pgfplots/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-07-10 Hanson Char <[email protected]>

Fix infinite loop in the example on Loops over list of items provided
under Section 2.6.2 of TeX-programming-notes.tex

2021-12-27 Christian Feuersaenger <[email protected]>

fix linux file read permissions of some new lua files in TDS zip
Expand Down
8 changes: 4 additions & 4 deletions doc/latex/pgfplots/TeX-programming-notes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ \subsubsection{Loops over list of items}
Looping over a list of items is very similar, only we will need |\ifx| in place of |\ifnum| and we need some end marker instead of the threshold value. However, how do we specify the list itself? Let's make some comma-separated list, e.\,g. |{a,b,c,d}| and call the end marker |\listingloopENDMARKER|.

\begin{codeexample}[]
\def\listingloopENDMARKER{\par \listingloopENDMARKER}
\def\listingloopENDMARKER{\listingloopENDMARKER}
\long\def\listingloop#1in#2#3{%
\looppicker{#1}{#3}#2,\listingloopENDMARKER,%
}%
Expand All @@ -933,10 +933,10 @@ \subsubsection{Loops over list of items}
#2%
\def\next{\looppicker{#1}{#2}}%
\fi
\next
\next%
Copy link
Author

@hansonchar hansonchar Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note I needed to append % here so make notes won't get into an infinite loop. Basically a hack to get around what seems to be a flaw of the existing build system.

}%
\listingloop\x in{a,b,c,,d,e}{%
The current item is `\x'
\listingloop\x in{aa, b,c ,,d,e}{%
Copy link
Author

@hansonchar hansonchar Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the test cases to have a wider range of coverage of what otherwise could have gone wrong without being noticed.

The current item is `\x'\par
}
\end{codeexample}

Expand Down