Use the noun martinet to describe someone who is a stickler when it comes to following rules, such as the teacher who won't accept homework if it is written in a color other than blue.
Pronounce martinet with the accent on the last syllable: "mar-ti-NET." Jean Martinet, the man for whom the word was coined, would insist you say his name correctly. He was a legendary drillmaster for the French army during the reign of Louis XIV. In 1779, a hundred years after Martinet's death, martinet came to mean any officer who was as strict and demanding in adhering to the rules as Martinet himself.