The best way to achieve this is to let them cool down before cutting. If you're not in a hurry, pop them in a fridge for about an hour once they've cooled down to room temperature on the counter). This way you will get really neat portions. Using sharp and cold knife also helps.