In The Invisible Hand, by James Hartley (Lodestone Books, Feb. 22, 2017), Sam is stuck at a gray and dismal British boarding school finds himself caught in the story of Macbeth, time-traveling back to medieval Scotland for brief intervals (that usually end up in him being badly damaged or killed, Macbeth not being the most peaceful story to visit. Back in the past, he meets a girl, Leana, and she too is caught in the the time-travel magic, only she moves forward in time to the boarding school.
The episodes of danger in medieval Scotland are vivid and convincing. This is sort of time travel where the traveler fits neatly into a slot, and knows the right thing to say, but though Sam passes as a native just fine, he keeps his own internal point of view. We don't get to see medieval native Leana's point of view as she finds herself at boarding school far in her future, but it's still an interesting narrative, and we do get her perspective back in the past as Macbeth's story plays out.
The time slipping isn't, though, the actual point of the story, merely a symptom of supernatural forces at work.
The magic of Macbeth's three witches spills into ordinary life at boarding school. The ordinary lessons and discomfort that Sam has been learning to put up with become mixed with danger. The school is the repository of an ancient book that can change reality, and Sam needs to find it in order to chart a course that will steer him clear of the darkness of Macbeth's story, giving him and Leana a more hopeful future.
If you are looking for a YA fantasy that is a change from the standard "young magical savior of the realm, possibly in an attractive dress on the cover" sort of thing, and of course if you enjoy Shakespearean riffs, and British boarding school stories, you might well enjoy this one lots. It's not necessarily for every reader--the bouncing between past and present is somewhat abrupt, and Explanations aren't as forthcoming as some of us might like. For instance, if there was a reason why Sam started time-slipping, I didn't pick up on it. But it is a vivid and memorable story, that sticks very nicely in the mind.
It's possible that more answers will be forthcoming. The book is the first part of a series called Shakespeare´s Moon, in which book is set in the same boarding school but focuses on a different Shakespeare play.
Disclaimer: review copy received from the publisher