I know how the infinitive form of a verb is used in Esperanto.
Mi ŝatas danci. (I like to dance.)
Does Esperanto have a parallel to English gerunds?
I like dancing.
You can say:
Mi ŝatas dancadon.
Its meaning is similar to the one Mi ŝatas danci has, though it does not explicitly say that what you like is you dancing. It could also be used when all you like is watching others dancing, though to avoid misunderstandings, it would be better to say this explicitly, for example with Mi ŝatas rigardi dancadon..
I guess the difference is the same as between I like to dance and I like dancing (though as a non-native I'm not really sure about the difference in English).
The English gerund (or the -ing form) is a strange beast because it conflates three historically different forms in one. The difference is still preserved in other Germanic languages like Dutch or German
In Latin grammar, only the first thing is called gerundium.
Esperanto does not follow the rather unique English model, but keeps the three functions of the English Gerund separate.
If you want to say that you like the act of dancing, you could use:
Mi ŝatas la dancadon.
Or you like how someone is dancing (his act/manner of dancing):
Mi ŝatas lian dancadon.
Apart from that, if you want to say you like dancing in general, you use the infinitive form, which you already know.
I'm currently learning Esperanto on Duolingo, and they're translating sentences like 'Mi ŝatas danci' in both ways: with and without gerund. What's more, when I translate such a sentence without gerund, a popup appears saying that another correct solution is the one with gerund.
So, according to Duolingo, there's no gerund in Esperanto.