implement fig.caption for all formats