A pedant is an annoying person who is focused on minor details and book knowledge rather than ordinary common sense. In war, it can be dangerous to have a pedant as commander — he'll insist on textbook maneuvers instead of adapting to circumstances on the ground.
This word was borrowed from French pédant or Italian pedante "teacher, schoolmaster," but its ultimate origin is unknown. One theory is that the original meaning of Italian pedante was "foot soldier," associated with the Italian word pedagogo "teacher" because teachers are always on their feet. Another theory is that Italian pedante was formed from the root of Greek paideuein "to teach," which happens to be the source of English pedagogue "teacher." In fact, a pedagogue is a pedantic teacher.