Onno
Onno

Reputation: 897

How to add an image with alt tag but without caption in Pandoc?

As described in the manual, in Pandoc’s Markdown images are added by

![This is the caption](/url/of/image.png)

The string This is the caption is added as a caption to the image as well as in the alt tag of the image.

I need the alt tags of the images, but want to avoid the captions for some of the images in an epub document. Is there an easy way to accomplish this, e.g. by css?

Upvotes: 9

Views: 2651

Answers (1)

mb21
mb21

Reputation: 39413

Pandoc treats an image that is the only content of a paragraph as a figure and prints the alt text as a caption. You can append an escaped linebreak to suppress this behaviour:

![This is the caption](/url/of/image.png) \

Upvotes: 14

Related Questions