this is for holding javascript data
Deyan Ginev edited section_Handy_LaTeX_Programming_Some__.tex
almost 9 years ago
Commit id: 3a6860adb5af8531269d04767c2bdf73b0fb3d6c
deletions | additions
diff --git a/section_Handy_LaTeX_Programming_Some__.tex b/section_Handy_LaTeX_Programming_Some__.tex
index a4bf546..5c783b0 100644
--- a/section_Handy_LaTeX_Programming_Some__.tex
+++ b/section_Handy_LaTeX_Programming_Some__.tex
...
\begin{lstlisting}
\newcounter{a}
\newcounter{b}
\newcounter{ab} \newcount\ab
\newtoks\allrows
\newcommand\addrow[3]{%
...
\setcounter{b}{0}
{\loop \ifnum\theb<10
\stepcounter{b}
\setcounter{ab}{\numexpr\thea*\theb\relax}%
\addrow{$\thea$}{$\theb$}{$\theab$} \ab=\thea
\multiply\ab by \theb
\addrow{$\thea$}{$\theb$}{$\the\ab$}
\repeat}
\expandafter\global\expandafter\allrows\expandafter{\the\allrows\hline}
\repeat
...
\end{tabular}
\end{lstlisting}
% Actual multiplication table implementation:
\newcounter{a}
\newcounter{b}
\newcounter{ab} \newcount\ab
\newtoks\allrows
\newcommand\addrow[3]{%
...
\setcounter{b}{0}
{\loop \ifnum\theb<10
\stepcounter{b}
\setcounter{ab}{\numexpr\thea*\theb\relax}%
\addrow{$\thea$}{$\theb$}{$\theab$} \ab=\thea
\multiply\ab by \theb
\addrow{$\thea$}{$\theb$}{$\the\ab$}
\repeat}
\expandafter\global\expandafter\allrows\expandafter{\the\allrows\hline}
\repeat