Almost 50 years ago, a Scottish art school student named Alasdair Gray convinced his father to let him spend the summer writing fiction instead of getting a job. That story swelled into Lanark, one of the most remarkable unsung novels of the last century. Unsung, at least, in the U.S., which didn’t have much time for Scottish writers until recently, when Booker Prize winner James Kelman broke the ice a wee bit, leaving room for rogues like Irvine Welsh and Alan Warner to sneak through.

Anthony Burgess has called Gray “the greatest Scottish novelist since Sir Walter Scott.” He’s Glasgow’s own Joyce, Kafka, and Pynchon rolled into one. Lanark‘s plot sometimes resembles a madcap fusion of Portrait of the Artist and The Trial and V.—the tender tale of a young man coming of age in an arbitrary world, forging his way through a haze of conspiracies. Gray careens recklessly through his narratives, birthing characters only to befuddle them, snapping off bits of literary genres so he can have his wicked, silly way with them. His most straightforward novel, Poor Things (originally published in 1992 and reissued this year by Dalkey Archive), is a virtuoso pastiche of Frankenstein, while 1994’s A History Maker less successfully mucks around with science fiction.

As befits a classic, the Scottish publisher Canongate has just reissued Lanark in a beautiful box set (a single-volume paperback is also available), adorned by Gray’s own illustrations. It’s a deliciously strange epic, this “Life in Four Books.” Not that the four books are in normal order: The first volume starts with Book 3, and the epilogue falls well before the end. In between, Gray creates a puzzle by interlocking two life stories: that of Lanark, an amnesiac living in the town of Unthank, and Duncan Thaw, a boy raised in bleak post-war Glasgow.

Every mundane detail in Unthank resonates with symbolism: The sun rarely shines, faceless corporations control the city’s politics, and citizens suffer from ailments like “dragonhide,” which transforms mental repression into physical armor. In this dystopic hinterland, Lanark hangs out with a bohemian gang, becomes a writer, and falls in love with Rima, who masks her emotions with contempt. Lonely and despairing, Lanark ends up at “the institute,” a truly Kafkaesque underground hospital that converts hopeless human beings into fuel and food (the latter appetizingly dubbed “Enigma de Filet Congales”).

Trapped inside Lanark’s adventure is the story of Duncan Thaw. Thaw’s reality is more recognizable to the reader than Lanark’s sci-fi surroundings, but mid-20th-century Glasgow bears striking similarities to Unthank. Air raid shelters, tenements, and murky skies hem in Thaw’s childhood. The city, Gray writes, “was a gloomy huge labyrinth he would take years to find a way through.” A budding artist and dreamer, Thaw scavenges for happiness, fixating on radiant local girls. But he is repulsed by his own sexual desires and—thanks to his asthma, eczema, and awkwardness—the lasses are repulsed by him.

Gradually he comes to see life as “a succession of dull habits in which he did what was asked automatically. . . . His energy had withdrawn into imaginary worlds and he had none to waste on reality.” Thaw’s scenarios blend fantastic creatures, sex, war, and socialist principles, much like Gray’s own fiction and nonfiction (he once wrote a polemic called Why Scots Should Rule Scotland). Eventually Thaw funnels his feelings into an epic church mural and shuts out the world: “Often a line of words sounded in his head: clean bleak exact austere rigorous implacable. Sometimes he whispered these words as though they were a tune his body moved to.” He has hardened into a misanthrope.

Lanark makes a fascinating alter ego for Thaw. Both are paralyzed by yearning and self-doubt, searching desperately for a foothold in the world. But Lanark is a bumbling character in search of an author. (He actually meets his maker at one point, when the narrator steps in to tip him off to his impending end.) Thaw, by contrast, is rendered with exquisite tenderness, very much the portrait of Gray as a young working-class boy.

Lanark‘s structure isn’t difficult once you get the hang of it. It has an improvisatory feel, a shifting lattice that lets Gray’s thoughts on painting, politics, love, and philosophy range freely. The book’s postmodern touches feel closer in spirit to Laurence Sterne than to Robert Coover. Meta-jokes flare up regularly: When Lanark meets the narrator, the author reassures him, “Please don’t feel embarrassed. This isn’t an unprecedented situation. Vonnegut has it in Breakfast of Champions and Jehovah in the books of Job and Jonah.” Gray ultimately breaks into a playful “Index of Plagiarisms” spanning 15 pages, in which the erudite author doffs his cap to hundreds of influences, with mini-commentaries on Milton and Freud, Shakespeare and Poe.

The index hints at another project that Gray worked on for decades, The Book of Prefaces (finally published a few years ago by Bloomsbury), in which he anthologized classic prefaces from the last 14 centuries, accompanied by mini-essays on each writer. As a self-educated lad, Gray fed on books as voraciously as on food, so it’s no surprise that literature looms large in this novel. When a young Duncan Thaw decides that somewhere there lies a key to all his woes—”asthma, homework, shyness before Kate Caldwell, fear of atomic war”—he searches for it at the public library. Gray surely did the same.

He couches his trenchant political commentary in humor, which mostly works well, despite the occasional clumsy rant. Gray’s heroes drift through the world, failing to grasp the political reality around them. When a priest begs Lanark to spread word of the evils committed at the institute, he says, “I’ll certainly denounce it in conversation . . . but I won’t have time to work against it. I’ll be working to earn a living.” The priest replies sadly that society “profits those who own it, and nowadays many sections are owned by gentle, powerless people who don’t know they are cannibals and wouldn’t believe if you told them.” Sounds a lot like today’s stock-owning populace.

It took Gray nearly 25 years to finish Lanark, which explains the book’s rough, layered texture. Thaw’s chapters (many of them written when he was in his late teens and twenties) vividly re-create the wild jags of youthful exhilaration and despair; Lanark’s sections suggest the perspective and hard-earned wisdom of late adulthood. Every page reveals the flushed intensity of our heroes’ struggles. And when the final curtain drops, they must leave the narrative just like the rest of us, not knowing how the story will end.