Consider an octagon $O$ with opposite edges identified. Lemma 3.2.4 of (1) (subscription link) claims that the affine automorphism group of $O$ is generated by $D_8$ and the shear $\sigma$ such that, if $O$ is drawn in the plane with a pair of edges parallel to each axis, $\sigma$ acts by Dehn twists on the horizontal cylinders. However, I don't see any way for these elements to generate the shear in the $\pi/8$ direction which acts by Dehn twists in the corresponding cylinders.

Note that the map $f\to Df$ which extracts the linear part is an isomorphism for $\mathrm{Aff}(O)$. The linear parts of the elements of $D_8$ are standard, while the linear part of $\sigma$ is $$\begin{pmatrix} 1 & 2+2\sqrt2\\ 0 & 1\end{pmatrix}$$ and that of the other shear is $$\begin{pmatrix} \cos\frac{\pi}{8} & \sin\frac{\pi}{8}\\ -\sin\frac{\pi}{8} & \cos\frac{\pi}{8}\end{pmatrix}^{-1} \begin{pmatrix} 1 & 2+2\sqrt2\\ 0 & 1\end{pmatrix} \begin{pmatrix} \cos\frac{\pi}{8} & \sin\frac{\pi}{8}\\ -\sin\frac{\pi}{8} & \cos\frac{\pi}{8}\end{pmatrix}$$ Note that the rotations by $\pi/8$ are not in $D_8$. Experimentally I haven't been able to express this in terms of the linear parts of $D_8$ and $\sigma$, but I'm not familiar with any algorithm for deciding the word problem in f.g. subgroups of $GL(2,\mathbb R)$.

The proof of Lemma 3.2.4 references pages 185-6 of (2) (Google books link). This states that if $O'$ is the surface obtained by gluing two octagons along opposite parallel edges, the image of $\mathrm{Aff}^+(O')\to PGL(2,\mathbb R)$ is generated by a rotation by $\pi/4$ and the image of $\sigma$. Exploiting the double cover $O'\to O$ we see that this implies the same result for $O$. However, (2) refrences section 7 of (3) (subscription link), which appears to use a rotation by $\pi/8$ rather than $\pi/4$ (specifically, the rotation by $\frac{2\pi}{\epsilon n}$ where here $\epsilon=2,n=8$).

Is this indeed an error, or do $D_8$ and $\sigma$ actually generate $\mathrm{Aff}(0)$? If they do, what is an expression for the shear in the $\pi/8$ direction?

John Smillie, Corinna Ulcigrai: Beyond Sturmian sequences: coding linear trajectories in the regular octagon, Proceedings of the London Mathematical Society, 102(2) (2011), pp. 291-340.

C. J. Earle and F. P. Gardiner, Teichmuller disks and Veech’s F-structures, Contemporary Mathematics (American Mathematical Society, Providence, RI, 1997) 165–189.

W. A. Veech, ‘Teichmuller curves in moduli space, Eisenstein series and an application to triangular billiards’, Invent. Math. 97 (1989) 553–583.