pgfplots icon indicating copy to clipboard operation
pgfplots copied to clipboard

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

Open hansonchar opened this issue 1 year ago • 2 comments

Fixes a bug in the example on Loops over list of items provided under Section 2.6.2 of TeX-programming-notes.tex.

How to locally build TeX-programming-notes.pdf from source

Pre-requisite

wget https://mirrors.ctan.org/macros/latex/contrib/acrotex.zip
unzip arotex.zip
DEST=$(kpsewhich -var-value TEXMFHOME)/tex/latex
mkdir -p $DEST
mv acrotex $DEST/
cd $DEST/acrotex

# Entering Ctrl-D whenever stuck
for i in $(ls *.ins); do
    lualatex $i
done

Build the pdf

git clone [email protected]:hansonchar/pgfplots.git
cd pgfplots/doc/latex/pgfplots
git checkout -b Section2.6.2-infiniteloop origin/Section2.6.2-infiniteloop
# Enter 'X' when error out for the first time
make notes

# Second time should generate the pdf without a TOC
make notes

# Third time to generate the final TeX-programming-notes.pdf
make notes

hansonchar avatar Jul 11 '24 05:07 hansonchar

This fix fails if the item iterated over starts with two identical tokens. Example: \listingloop\x in{aa}{...}. It seems to me the "proper" fix is to remove the \par in the definition of \listingloopENDMARKER, ie.

\def\listingloopENDMARKER{\listingloopENDMARKER}

plante3 avatar Jul 11 '24 07:07 plante3

This fix fails if the item iterated over starts with two identical tokens. Example: \listingloop\x in{aa}{...}. It seems to me the "proper" fix is to remove the \par in the definition of \listingloopENDMARKER, ie.

\def\listingloopENDMARKER{\listingloopENDMARKER}

Thanks! Will make the changes as you suggested.

hansonchar avatar Jul 11 '24 15:07 hansonchar