But Texas students will read that some critics “dismissed the quality of literature produced.”

Here’s another example: Teenagers in both states will learn about the Harlem Renaissance and debates about the movement’s impact on African-American life.

In the same place, the Texas edition of the textbook contains only a blank white space.

Here’s one example: On this annotated Bill of Rights, a California textbook explains that rulings on the Second Amendment have allowed for some gun regulations.

But Texas students will read that some critics “dismissed the quality of literature produced.”

Here’s another example: Teenagers in both states will learn about the Harlem Renaissance and debates about the movement’s impact on African-American life.

In the same place, the Texas edition of the textbook contains only a blank white space.

Here’s one example: On this annotated Bill of Rights, a California textbook explains that rulings on the Second Amendment have allowed for some gun regulations.

Two States. Eight Textbooks. Two American Stories. American history textbooks can differ across the country, in ways that are shaded by partisan politics.

We analyzed some of the most popular social studies textbooks used in California and Texas. Here’s how political divides shape what students learn about the nation’s history.

The textbooks cover the same sweeping story, from the brutality of slavery to the struggle for civil rights. The self-evident truths of the founding documents to the waves of immigration that reshaped the nation.

The books have the same publisher. They credit the same authors. But they are customized for students in different states, and their contents sometimes diverge in ways that reflect the nation’s deepest partisan divides.

Hundreds of differences — some subtle, others extensive — emerged in a New York Times analysis of eight commonly used American history textbooks in California and Texas, two of the nation’s largest markets.

In a country that cannot come to a consensus on fundamental questions — how restricted capitalism should be, whether immigrants are a burden or a boon, to what extent the legacy of slavery continues to shape American life — textbook publishers are caught in the middle. On these questions and others, classroom materials are not only shaded by politics, but are also helping to shape a generation of future voters.

Conservatives have fought for schools to promote patriotism, highlight the influence of Christianity and celebrate the founding fathers. In a September speech, President Trump warned against a “radical left” that wants to “erase American history, crush religious liberty, indoctrinate our students with left-wing ideology.”

The left has pushed for students to encounter history more from the ground up than from the top down, with a focus on the experiences of marginalized groups such as enslaved people, women and Native Americans.

The books The Times analyzed were published in 2016 or later and have been widely adopted for eighth and 11th graders, though publishers declined to share sales figures. Each text has editions for Texas and California, among other states, customized to satisfy policymakers with different priorities.

“At the end of the day, it’s a political process,” said Jesús F. de la Teja, an emeritus professor of history at Texas State University who has worked for the state of Texas and for publishers in reviewing standards and textbooks.

[Thousands of readers have responded to this article. Here is what they had to say.]

The differences between state editions can be traced back to several sources: state social studies standards; state laws; and feedback from panels of appointees that huddle, in Sacramento and Austin hotel conference rooms, to review drafts.

Requests from textbook review panels, submitted in painstaking detail to publishers, show the sometimes granular ways that ideology can influence the writing of history.

A California panel asked the publisher McGraw-Hill to avoid the use of the word “massacre” when describing 19th-century Native American attacks on white people. A Texas panel asked Pearson to point out the number of clergy who signed the Declaration of Independence, and to state that the nation’s founders were inspired by the Protestant Great Awakening.

All the members of the California panel were educators selected by the State Board of Education, whose members were appointed by former Gov. Jerry Brown, a Democrat. The Texas panel, appointed by the Republican-dominated State Board of Education, was made up of educators, parents, business representatives and a Christian pastor and politician.

[In California Today: Dana Goldstein talks about why she picked California and Texas. Read the newsletter here.]

McGraw-Hill, the publisher whose annotated Bill of Rights appears differently in the two states, said it had created the additional wording on the Second Amendment and gun control for the California textbook. A national version of the pages is similar to the Texas edition, which does not call attention to gun rights, the company said in a written statement.

Pearson, the publisher whose Texas textbook raises questions about the quality of Harlem Renaissance literature, said such language “adds more depth and nuance.”

Critical language about nonwhite cultural movements also appears in a Texas book from McGraw-Hill. It is partly a result of debates, in 2010, between conservative and liberal members of the Texas Board of Education over whether state standards should mention cultural movements like hip-hop and country music. Their compromise was to ask teachers and textbook publishers to address “both the positive and negative impacts” of artistic movements.

Texas struck that requirement in 2018, but its most recent textbooks, published in 2016, will reflect it for years to come.

Publishers are eager to please state policymakers of both parties, during a challenging time for the business. Schools are transitioning to digital materials. And with the ease of internet research, many teachers say they prefer to curate their own primary-source materials online.

How Textbooks are Produced 1 Authors, often academics, write a national version of each text. 2 Publishers customize the books for states and large districts to meet local standards, often without input from the original authors. 3 State or district textbook reviewers go over each book and ask publishers for further changes. 4 Publishers revise their books and sell them to districts and schools.

Still, recent textbooks have come a long way from what was published in past decades. Both Texas and California volumes deal more bluntly with the cruelty of the slave trade, eschewing several myths that were common in textbooks for generations: that some slave owners treated enslaved people kindly and that African-Americans were better off enslaved than free. The books also devote more space to the women’s movement and balance the narrative of European immigration with stories of Latino and Asian immigrants.

“American history is not anymore the story of great white men,” said Albert S. Broussard, a history professor at Texas A&M University and an author of both the Texas and California editions of McGraw-Hill’s textbooks.

Here is how the politics of American history play out in California and Texas textbooks, on subjects like race, immigration, gender, sexuality and the economy.

White resistance to black progress is covered differently in the two states. McGraw-Hill, “United States History & Geography: Continuity and Change,” California, P. 505 California notes the suburban dream of the 1950s was inaccessible to many African-Americans. McGraw-Hill, “United States History Since 1877,” Texas, P. 436 Texas does not.

California and Texas textbooks sometimes offer different explanations for white backlash to black advancement after the Civil War, from Reconstruction to housing discrimination in the 20th century.

Southern whites resisted Reconstruction, according to a McGraw-Hill textbook, because they “did not want African-Americans to have more rights.” But the Texas edition offers an additional reason: Reforms cost money, and that meant higher taxes.

Whole paragraphs on redlining and restrictive deeds appear only in the California editions of textbooks, partly as a result of different state standards. Texas’ social studies guidelines do not mention housing discrimination at all.

California Texas Takeaway Texas says that white Southerners opposed Reconstruction because of tax increases as well as racial resentment. California instead includes primary-source quotations from black historical figures about white resistance to civil rights. McGraw-Hill, “United States History & Geography: Growth & Conflict,” California, P. 586; McGraw-Hill, “United States History to 1877,” Texas, P. 555 Both states say that breaches of “racial etiquette” led to lynchings after Reconstruction. But only California, whose edition was written more recently, makes clear that the perpetrators of lynchings also hoped to discourage black political and economic power. HMH, “American History: Reconstruction to the Present,” California, P. 245; HMH, “The Americans: United States History Since 1877,” Texas, P. 288

Nevertheless, Kerry Green, a high school social studies teacher in Sunnyvale, Tex., a small town east of Dallas, said she discussed redlining with her 11th graders, adding it as a counterpoint to lessons about postwar prosperity — the optimistic story of consumerism, television and the Baby Boom that is emphasized by her state’s standards.

Ms. Green said she preferred to assign primary sources that “encourage students to explore history on their own.” But she said she would welcome textbooks that contain more historical documents and a greater diversity of voices and themes from the past.

“The textbook companies are not gearing their textbooks toward teachers; they’re gearing their textbooks toward states,” she said.

On gender and sexuality, California textbooks include history that is not in Texas editions. McGraw-Hill, “United States History & Geography: Growth & Conflict,” California, P. 624 California states that the federal government failed to recognize nonbinary gender identities and female leaders in its early relations with Native Americans. McGraw-Hill, “United States History Since 1877,” Texas, P. 111 Texas does not mention gender roles or gender identity in its discussion of efforts to “Americanize” Native Americans.

In Texas textbooks, mentions of L.G.B.T.Q. issues tend to be restricted to coverage of events in recent decades, such as the Stonewall uprising, the AIDS crisis and debates over marriage rights.

But for recent California editions, publishers wrote thousands of words of new text in response to the FAIR Education Act, a law signed by Governor Brown in 2011. It requires schools to teach the contributions of lesbian, gay, bisexual, transgender and disabled Americans.

Peppered throughout California books are passages on topics like same-sex families under slavery and early sex reassignment surgery in the 1950s — text that does not appear in Texas versions.

California Texas Takeaway California states that enslaved women faced sexual violence from owners and overseers. McGraw-Hill, “United States History & Geography: Growth & Conflict,” California, P. 449; McGraw-Hill, “United States History to 1877,” Texas, P. 443 California mentions the “lavender scare” that targeted thousands of gay men and lesbians. Pearson, “United States History: The Twentieth Century,” California, P. 486; Pearson, “United States History: 1877 to Present," Texas, P. 456. California states that Alfred Kinsey’s research and early sex reassignment surgeries challenged “the postwar ideal” on gender. Pearson, “United States History: The Twentieth Century,” California, P. 498; Pearson, “United States History: 1877 to Present,” Texas, P. 470. Both states focus on women’s fight against discrimination in the workplace. Only California says birth control played a role, by “allowing women to exert greater control over their sexuality and family planning.” McGraw-Hill, “United States History & Geography: Continuity and Change,” California, P. 627; McGraw-Hill, “United States History Since 1877,” Texas, P. 525.

Stephanie Kugler, an eighth-grade history teacher in West Sacramento, Calif., said she had expanded an idea mentioned briefly in her classroom’s textbook, about women who dressed as men to fight in the Civil War and continued to live as men, into an entire lesson on troops who today would be considered transgender. The students read accounts of those soldiers’ lives alongside more traditional sources, such as letters written by a black Union soldier and a Confederate soldier.

Her goal, Ms. Kugler said, was to “make it really authentic” to talk about diversity in the context of each historical period.

While both states devote many pages to the women’s movement, Texas books, in general, avoid discussions of sex or sexuality.

Immigration and nativism are major themes in American history textbooks. McGraw-Hill, “United States History & Geography: Continuity and Change,” California, P. 736 California includes an excerpt from a novel about a Dominican-American family. McGraw-Hill, “United States History Since 1877,” Texas, P. 609 In the same place, Texas highlights the voice of a Border Patrol agent.

Michael Teague, a Border Patrol agent, is featured in the Texas edition of McGraw-Hill’s 11th grade textbook. He discusses his concerns about drug trafficking and says, “if you open the border wide up, you’re going to invite political and social upheaval.”

Mr. Teague’s story is featured at the end of a chapter on recent immigration, alongside accounts from a Vietnamese immigrant and a second-generation Mexican-American.

That section in the California edition of the same book is devoted to a long excerpt from the novel “How the García Girls Lost Their Accents,” by Julia Alvarez. It deals with intergenerational tensions in a Dominican-American family.

In a written statement, McGraw-Hill said the full-page Border Patrol narrative was not included in the California edition because it would not fit beside the literary excerpt. And at the time the Texas edition was produced, six years ago, state standards called for students to analyze both “legal and illegal immigration to the United States.”

In contrast, California textbooks are more likely to note when a historical figure was an immigrant. And they include more detail on the role immigrants such as Japanese and Filipino farmworkers played in labor movements.

California is one of many states to ask teachers and textbooks in recent years to cover the contributions of specific immigrant groups, including Asian-Americans, Pacific Islanders, European-Americans and Mexican-Americans.

California Texas Takeaway Only California states that Levi Strauss was a German Jewish immigrant. McGraw-Hill, “United States History & Geography: Growth & Conflict,” California, P. 416; McGraw-Hill, "United States History Since 1877," Texas, P. 417 California tells the story of Wong Kim Ark, whose 1898 Supreme Court case established birthright citizenship for the children of immigrants; Texas’s edition, which is older, does not mention this case, but does cover the Chinese Exclusion Act. HMH, “American History: Reconstruction to the Present,” California, P. 247; HMH, “The Americans: United States History Since 1877,” Texas, P. 289

These additions are part of the reason California books are almost always longer than their Texas counterparts.

California’s Board of Education adopted an expansive 842-page social studies framework in 2016. Two years later, Texas’ school board streamlined its social studies standards, which are now laid out in 78 tightly compressed pages.

Critics of California’s approach say that making state standards and textbooks longer and more inclusive can be overwhelming to teachers trying to move quickly through hundreds of years of material.

Both states emphasize the role of big business from the Gilded Age to the present. HMH, “American History: Reconstruction to the Present,” California, P. 160 California is critical of wealth inequality and the impact of companies like Standard Oil on the environment. HMH, “The Americans: United States History Since 1877,” Texas, P. 235 Texas is more likely to celebrate free enterprise and entrepreneurs like Andrew Carnegie.

Texas policymakers feel strongly about giving students a positive view of the American economy; since 1995, state law has required that high school economics courses offer an “emphasis on the free enterprise system and its benefits.” That emphasis seems to have made its way into the history curriculum as well.

California’s curriculum materials, by contrast, sometimes read like a brief from a Bernie Sanders rally. “The yawning gap between the haves and have-nots and what is to be done about it is one of the great questions of this time,” says the state’s 2016 social studies framework.

As a result, California textbooks are more likely to celebrate unionism, critique the concentration of wealth and focus on how industry pollutes the environment.

California Texas Takeaway California refers to “the income gap” and explains that “changes in tax structures and safety-net programs” and “higher costs for education, child care, and housing” played a role. Both state editions discuss economic inequality in reference to the Occupy Wall Street movement and the decline of labor unions. Pearson, “United States History: The Twentieth Century,” California, P. 728; Pearson, “United States History: 1877 to Present,” Texas, P. 687. The older Texas edition highlights additional Republican critiques of President Barack Obama’s environmental policies, while the California book discusses the threat of rising sea levels. Pearson, “United States History: The Twentieth Century,” California, P. 749; Pearson, “United States History: 1877 to Present,” Texas, P. 709.

Both the California and Texas 11th-grade textbooks from Pearson state, “The main argument against environmental legislation is that it hurts the economy and the nation’s industries.”

The Texas edition goes further to highlight criticism of federal efforts to subsidize the green energy industry: “Republicans accuse the government of wasting taxpayers’ money, for example by supporting the failed solar manufacturer Solyndra.” The Solyndra controversy was a fixation for conservatives in 2011, when the company went bankrupt after accepting half a billion dollars in federally guaranteed loans.

The Texas book also states that American action on global warming may not make a difference if China, India, Russia and Brazil do not also act.

The California edition does not mention Solyndra or the other nations. However, it does include a section on the threat to American states and cities from rising sea levels, noting that the impact on tourism in Florida could hurt that state’s economy, and that transportation networks and buildings could be threatened.

Pearson said in a written statement that the differences between the books could be attributed mostly to the fact that the California book was published several years later, and that concerns over coastal flooding have become “more heightened in recent years.”