The Rithmatist by Brandon Sanderson is novel that was published in 2013.
More than anything, Joel wants to be a Rithmatist. Chosen by the Master in a mysterious inception ceremony, Rithmatists have the power to infuse life into two-dimensional figures known as chalklings. Rithmatists are humanity’s only defense against the wild chalklings—merciless creatures that leave mangled corpses in their wake. Having nearly overrun the territory of Nebrask, the wild chalklings now threaten all of the American Isles.
As the son of a lowly chalkmaker at Armedius Academy, Joel can only watch as Rithmatist students learn the magical art that he would do anything to practice. Then students start disappearing—kidnapped from their rooms at night, leaving trails of blood. Assigned to help the professor who is investigating the crimes, Joel and his friend Melody find themselves on the trail of an unexpected discovery, one that will change Rithmatics—and their world—forever.