According to the Catholic Church, can you cook food while you're fasting? Can you cook food while you're fasting? And eat it afterwards? I have often made dinner for others during a fast. And I have also made dinner for myself but waited until the fast was over to eat it.

What is the Catholic doctrine on this question? Are there any rules about this?
Cooking and fasting are two different subjects that have to be considered here. In days gone by when the Church had the Lenten fast for 40 days, no one would question the idea of cooking for your main meal of the day. People have to eat.

There is absolutely no problem in preparing to cook food for after your fast, even if it were animal flesh.

The rules of fasting and abstinence are totally silent on the subject of how, what or when one should cook food. Thus you should be able to prepare your food accordingly. That said, it would seem to be of poor taste to cook a meat dish on Good Friday for the next day. If I had to prepare a meat dish early for Easter I would choose to do it on Holy Saturday.


  The Rules for the Roman Catholic Church
  
  The Code of Canon Law prescribes (Canons 1250-1252):
  
  Can. 1250: The penitential days and times in the universal Church are every Friday of the whole year and the season of Lent.
  
  Can. 1251: Abstinence from meat, or from some other food as determined by the Episcopal Conference, is to be observed on all Fridays, unless a solemnity should fall on a Friday. Abstinence and fasting are to be observed on Ash Wednesday and Good Friday.
  
  Can. 1252: The law of abstinence binds those who have completed their fourteenth year. The law of fasting binds those who have attained their majority, until the beginning of their sixtieth year. Pastors of souls and parents are to ensure that even those who by reason of their age are not bound by the law of fasting and abstinence, are taught the true meaning of penance.