Well, that all depends on the amount of time between taking the medication and throwing it up. In most cases, there is a sure way to tell if you should give them another dosage right away. If you can still see the medicine in the vomit, it is alright to give them another dose. If you cannot see it and you are not sure how much time has passed since they took the medicine, do not give them a second dose.
This goes for other medications such as paracetamol as well. However, for antibiotics or pain/fever reducing medications, you should only repeat the dosage once. If your child throws up the medicine again, you should contact your doctor.
When your child is sick it can be very hard for them to take the medicine and keep it down. Here is a trick that seems to work. When administering the medicine, use a syringe and place the liquid down the side of the mouth at the cheek. This method prevents the medicine from contacting the center of the tongue and initiating a gag reflex.