Hello I'm having trouble with Proteus to do this CMOS logic simulation, I used transistors, I can do the logic perfectly, but when I use CMOS for some reason the logic doesn't work. I used the methods of feeding voltage or applying a digital signal and it still doesn't work. Is there any modification that I must do on top of the component?
Your image from Sedra & Smith doesn't indicate which terminal is the source because it doesn't need to. The PMOS source is by definition the terminal at the higher voltage. Also, the body will be connected to the highest voltage in the circuit, whether that happens to be the source or not.
Your schematic uses MOSFETs with the source tied to the body. If you use those transistors you must connect the source to the higher voltage point. Your MOSFETs Q1 and Q2 must be flipped source/drain.
You should really be using a 4-terminal MOSFET if you want to simulate these circuits properly.
First of all, the way you had drawn the BJT (bipolar) NAND gate was wrong. The topology was wrong, and your Q5 and Q6 were drawn upside down, and to top it all off: you need base resistors. The circuit won't work without base resistors, since the E-B diode of Q5 would conduct in series with B-E diode of Q7, causing a short circuit.
Secondly, you've drawn Q1 and Q2 upside down. I've drawn them correctly below, using symbols that include the body diodes. As you can see, when Q1 and Q2 are upside down, their body diodes are forward-biased and conduct, so effectively Q1 and Q2 are conducting no matter what their gate voltage is.
Now, the schematic below can be simulated and is interactive: just click on the "0" and "1" buttons, press space, and they toggle, and you can immediately see the results.
You will note that the bipolar (and only bipolar!) version of the gate will still work if you flip the transistors upside down - with a caveat: the output must not be loaded. As soon as you load the output using the current source I1 - just 5mA is sufficient - the output will not be correct anymore.
That's because when the bipolar transistors are "upside down", they still work, but have a very low current gain. The base resistors can drive about 0.5mA into the bases. Since the current gain is very low - usually between 1-5, the base current multiplied by the gain is insufficient to overcome the load current.
You should be able to redraw the schematic above in Proteus, and I guarantee that it will work - as long as you don't make any mistakes. It'll also work if you assemble it on a breadboard, using "reasonable" mosfets like the BSS138/BSS84 (N/P channel, respectively).
Since this site has integrated CircuitLab, you can use it to experiment - for such simple circuits, it's much nicer than Proteus.