Wolfrolf, hope you won't mind if I say something here, I'm a student.
I don't know if what I am going to say will work with your students, but, at least it worked for my teacher.
He started treating us as if he was one more among us, do you know what I mean? You won't do anything by saying "Hey, you have to pay attention to me, I am the teacher!", this way you will only make things worse. Why don't you leave things clear? Say that you will explain things as much as they need as long as they pay attention, and, to those who just don't pay attention, don't worry, they will with the time, and, if they don't, it will be worse for them, won't it?
After all, they are the ones who need to learn that who need to know certain things at the end of each term, you already know that all.
I think if you say something funny related to what you are explaining will work too, my History teacher used to do that. ![Smile [:)]](/emoticons/emotion-1.gif)