I've just found Latex recently & have fallen in love with its precision. As a maths teacher I am looking to set up various general routines that I can just copy & paste into the tests that I write.
I wanted to write a general routine for making isometric dotty paper where I could simply define the size & spacing using some opening definitions & a scale command. After stumbling around for an elegant solution I ended up doing this, which works, but I wondered if anyone could advise me as to a nicer way to do it. Is it possible to define the \innerx and \innery with reference to the \outerx - 1 & \outery - 1?
This is my script
Code: Select all
\begin{tikzpicture} [scale=0.75]
\def\outery{20}
\def\outerx{10}
\def\innerx{9}
\def\innery{19}
\def\costhirty{0.8660254cm}
\def\twocosthirty{1.732050808}
\foreach [evaluate=\a using (\twocosthirty*\b)] \b in {0,1,...,\outerx}
\foreach \c in {0,1,...,\outery}
\filldraw (\a,\c) circle (0.05cm) ;
\foreach [evaluate=\d using (\twocosthirty*\e)] \e in {0,1,...,\innerx}
\foreach \f in {0,1,...,\innery}
\filldraw [xshift=\costhirty,yshift=0.5cm] (\d,\f) circle (0.05cm) ;
\end{tikzpicture}