【问题标题】:how to reduce space between Figure legend and actual image in R Markdown如何减少 R Markdown 中图例和实际图像之间的空间
【发布时间】:2022-11-22 19:23:44
【问题描述】:

我正在使用以下命令在我的 R Markdown 中包含图像。

![Legend of the figure.\label{fig3}](image.pdf){width=90%}

但是,它在实际图像和底部的图例/标签之间增加了很多空间(图 1:...)。关于如何减少这个空间的任何想法?

【问题讨论】:

    标签: label markdown figure caption


    【解决方案1】:

    嗯,一个快速的模型显示了预期的空间,编织成 HTML。否则,您可以使用 CSS 自定义 div.figure > imgp.caption

    ---
    title: "test.Rmd"
    output: html_document
    runtime: shiny
    ---
    
    Text before.
    
    ![Legend of the figure.label{fig3}](https://via.placeholder.com/300x150.png){width=90%}
    
    Text after.
    

    【讨论】: