When Amy Rose Capetta started writing her young adult novel “Echo After Echo,” she wasn’t sure if it would be embraced by the publishing industry.

Though she had already published two books, “Echo After Echo” was different: The mystery, set on Broadway in New York, features a romance between two teenage girls. As she searched for a publisher, Capetta, 34, said she was never explicitly told to tone down her characters’ sexuality, but she did wonder if editors who said they were “not able to connect” with the characters were really saying that the same-sex relationship might not appeal to straight readers.

“I wrote ‘Echo After Echo’ in breathless fear that I was tanking the career I’d been dreaming of and working toward,” she said. “That story took three years, which is a long time to be breathless.”

Yet instead of diminishing her career, “Echo After Echo,” which was published in 2017, did the opposite. It was a Junior Library Guild selection and established Capetta, who identifies as queer, as an LGBTQ young adult author. She’s scheduled to have three books published in 2019.

jimmy patterson

The market for YA books featuring protagonists who identify as LGBTQ is growing, as publishers and authors tap a rising demand among young readers for a broader diversity of characters and storylines.

Publishers including Simon & Schuster and Alfred A. Knopf said they do not track the number of YA books with LGBTQ protagonists, but they have observed an increase in the genre over the last few years.

“In years past, you would see a concentration of distribution in the institutional and education markets, as well as independent stores,” Justin Chanda, vice president and publisher of Simon & Schuster Books for Young Readers, wrote in an emailed statement. “Today, there are many, many books featuring LGBTQ+ characters being published in various genres that are being carried in large numbers by all accounts.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Some of those books — including works by Amber Smith, Christina Lauren and Tim Federle — have become best-sellers. Benjamin Alire Sáenz’s 2012 book “Aristotle and Dante Discover the Secrets of the Universe” — a story about two Mexican-American boys navigating family relationships, race and sexuality — has been one of the Simon & Schuster’s best-selling backlist titles for the past several years, Chanda said.

In 2011, Malinda Lo, author of “Ash” and several other YA novels, began tracking such books with LGBTQ protagonists published by mainstream publishers. She counted 79 such books in 2016, the last year she collected data, up from about 32 in 2012.

While LGBTQ stories are reaching a wider audience of young readers, there’s still work to be done to make them more inclusive and diverse, authors said.

“Most of the YA books out there are about closeted teens — and cis white boys at that,” said Adam Silvera, author of “They Both Die at the End,” who identifies as gay. “Coming-out stories always have value, but I want to see more queer characters in genre fiction,” including crime, fantasy, romance, science fiction and historical fiction.

According to Lo’s research, less than half of the YA books with LGBTQ protagonists from mainstream publishers in 2016 were genre fiction.

Caleb Roehrig, author of YA thrillers and mysteries, believes coming-out stories “will always be important,” but he said that genre fiction opens up a different set of possibilities for young LGBTQ readers.

“I want stories about gays in space and trans people solving mysteries,” Roehrig said. “And we also need more books exploring the intersectionality of identities.”

Feiwel and Friends

Roehrig, 41, recalled reading genre fiction as a teenager in which the queer characters were portrayed as murder victims or villains. One tale that is seared into his memory was a book about a group of gay men who raped young girls. He seeks to portray gay men as the heroes of their own stories and said he’s “gotten a lot of emails from a lot of gay men in particular who are fans of thrillers and horror fiction, but who haven’t had positive representation within those genres.”

Another limitation of LGBTQ YA stories is an issue that plagues the book industry at large: its authors’ and characters’ lack of racial diversity. In 2017 and 2018, only 18 young adult books were written by LGBTQ authors of color, according to studies by the Cooperative Children's Book Center at the University of Wisconsin-Madison.

“Young people of color, like their white LGBTQ peers, need their experiences represented in books,” Caroline Tung Richmond, a YA author and program director of We Need Diverse Books, a group that advocates for literature that reflects young readers, wrote in an emailed statement.

This need is why Gabby Rivera doesn’t shy away from discussing her background in her work. She described her novel “Juliet Takes a Breath,” winner of the 2017 Silver IPPY award for best LGBTQ fiction, as “an offering to communities that have helped me survive and thrive: my family, the Bronx, Latina writers, queer folks, sweaty awkward nerds, people of color, brown baby dykes, and so on.”

Transgender, intersex and asexual readers also have a difficult time finding books that represent them. According to Lo, 81 percent of LGBTQ YA fiction in 2016 featured a cisgender boy or girl as the main character.

Erica Cameron, author of the “Assassins” and “The Dream War Sagas” series, identifies as asexual and said she’s never seen herself fully represented in a book.

Though she has written about marginalized sexual orientations, and said her “most queer series received the most attention,” she has also faced questions about her choices.

“Once a copy editor decided to question the asexuality of one of my characters,” Cameron, 33, told NBC News. “‘Wouldn’t the character being bisexual be more of a likely choice? Is it really realistic that a character at 15 would decide to be asexual?’”

Spencer Hill Press

Each new crop of books has the opportunity to push the boundaries of what’s familiar and accepted, authors said.

“I don’t know if my novels could have been published 10 years ago,” Roehrig said. “But the work isn’t done until every reader has a shelf full of titles that reflect them.”

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM.