Home > database >  How to format images with markdown, Sphinx latexpdf
How to format images with markdown, Sphinx latexpdf

Time:08-11

I have a markdown document that I wish to output in pdf format. I cannot find a way to format the images correctly.

If I use

<center><img src="_images/parameter_form.png" alt="Select Parameters" width="400"></center>

I works perfectly with make html, but with make latexpdf the image does not appear at all.

If I use (based on this stack overflow answer)

![Select Parameters](_images/parameter_form.png) { width=400 }

The images is not sized and the format string { width=400 } appears in the text

What am I doing wrcng?

CodePudding user response:

The answer is to use MyST. This Sphinx parser allows a richer syntax in markdown and specifically the image tag

```{image} _images/parameter_form.png
:alt: Select Parameters
:width: 400px
:align: center
```

Perfect!

  • Related