Sorry, I can't find the specific paper-- NASA wrote so much about this (it was a big problem, plus astronauts had to save their poop-- which was then analyzed and copiously written about) that I just got lost looking. Search for "NASA low residue diet" and things like "preflight", "fecal collection assembly", "waste management system", and etc -- from Gemeni through Apollo.
There's pictures online of the bags. They were taped to the butts to help make a seal.
Now I want to read the preflight diet study again, so please write if you find it.