When including a single figure with long captions, I tried several different strategies.

1. Use the markdown `img` syntax directly

```
![This is a long caption. (a) $\theta=2*x^2$; (b) this is the second part; (c) this is the third part](./img/Fig2.pdf){#fig-native}

```
This worked as expected and the figure is **centered** by default; the captions are rendered properly. The figure is **numbered** and cross-ref works as expected.

**However, in the editor, the text does not look clean and tidy.** 

I prefer to define long captions outside of the brackets `[ ]`, so I tried the following

2. Use the quarto `layout` with 1 column
```
::: {#fig-layout layout-ncol=1}
![](./img/Fig2.pdf) 

This is a long caption. (a) $\theta=2*x^2$; (b) this is the second part; (c) this is the third part
:::
```
This strategy worked, **except that the figure is no longer "centered"**. After checking the `tex` file, it is found that the image was implemented using a `minipage` environment.

3. To center the image using the layout method, 
```
::: {#fig-layout2 layout="[-30, 40, -30]"}

![](./img/Fig2.pdf) 

This is a long caption. (a) $\theta=2*x^2$; (b) this is the second part; (c) this is the third part
:::
```
This worked, expect that **one need to manually adjust the layout parameters; and three minipage environments were created in the `tex` file and made it inconvenient to submit to a publisher**

4. Lastly, I tried the [`Figure Div`](https://quarto.org/docs/authoring/figures-and-layout.html#figure-divs) as described in the quarto documentation
```
::: {#fig-div}
![](./img/Fig2.pdf) 

This is a long caption. (a) $\theta=2*x^2$; (b) this is the second part; (c) this is the third part
:::
```
The figure is inserted. But there are a few problems. 

-  The figure is not centered
-  The figure is not numbered
-  Figure reference still partially work but no number is given

After checking the `tex` file, it is found that the figure is not put in a `figure` environment. 

**Summary:**
-  Native markdown syntax works best and gives a clean `tex` file; but the editing experience is not idea
-  Quarto layouts work; the `tex` file is not as clean; and the editing experience is not idea
-  Quarto `figure div` does not give satisfactory results

**Idea method:**
- use quarto `figure div` syntax, but put it into a `figure` environment for latex output.

Thanks for your patience and time for reviewing all my issues!


2021-12-12T03:59:42Z
juliantao
closed
PDF format: what is the best way to include a single figure with long captions and a label?
https://github.com/quarto-dev/quarto-cli/issues/217