As a counter-annecdote: when I was taking a course in Fourier theory, the professor teaching the course was in the process of writing his own textbook on the subject. Each week or so we got a printed copy of the appropriate chapter. He had been working on it for a while, and it was more or less complete: with huge numbers of embedded mathematics (including lengthy derivations), graphs produced in Matlab, all properly typeset using LaTeX. It was a fantastic "text" (although not exactly in book form), and better than the actual assigned text. It cost us, the students, nothing (other than the costs of being a grad student, monetary and otherwise).
Just for the heck of it, I did some searching to see if he ever got it published. It's available for
pre-order now (more than a decade since I took the course). I guess it'll be the required text now, and retails north of $100, but at least it will be
good.