Literally anything that covers the X and Y chromosomes.
those sound like highschool or middleschool textbooks, I'm guessing. Possibly outdated and poorly written. It's a bit of a problem for schools at the moment, to be honest, outdated and poorly written textbooks. You'll find most highschool textbooks tend to take the "ehhh, more or less" approach. There's a reason why folks say you have to unlearn most everything you learned in highschool when you get to college. What you were taught as rules are actually more like fuzzy concepts not explained very well.
But biology is pretty messy. it's not as straight-forward as you were led to believe. But to help out, there are, at least, 3 different categories you can break this down into:
-chromosome
-presenting sex
-gender
chromsomes are usually xy or xx. but they can be xxx, xxy, etc, etc. lots of combinations. Rare, perhaps, but they still happen to loads of people. They don't not exist because it doesn't happen terribly often.
presenting sex is what kind of sex you could pass as (read: what you look like). depends on how a body reacts to the various hormones or whatnot, among other things. For example, If your body didn't really react to testosterone, even if you were XY, you'd have all the physical aspects of a woman and probably consider yourself a woman. Or maybe not. Brains and bodies are fun like that.
gender is the "men act and look like this", "women act and look like this" nonsense. But folks aren't exactly cookies, so neither of those two categories fit a great great many people. And when the categories don't fit the people, you don't try and shove them into the categories to make your life easier. You make new categories to better reflect reality. You adapt to reality, reality doesn't adapt to you. Simple as that. Mix and match this with those above and you've got a lot of people who understand themselves in ways that aren't reflected very well with the language and concepts we currently use.
And that's even before we get into the science of transgendered and other related topics. Understand the above and you're a step closer to understanding how complicated the biology is on the topic. Biology is far more varied and interesting than you give it credit for