markdown是否支持本机文本对齐而不使用html + css?


当前回答

我发现在jupyter笔记本单元格上使用latex语法非常有用,比如:

![good-boy](https://i.imgur.com/xtoLyW2.jpg  "Good boy on boat")

$$\text{This is some centered text}$$

其他回答

在Github你需要写:

<p align="justify">
  Lorem ipsum
</p>

为了在md文件中居中文本,你可以使用center标签,如html标签:

<center>Centered text</center>

我知道这不是markdown,但<p align="center">对我有用,所以如果有人找出markdown语法,我很乐意使用它。在此之前,我将使用HTML标记。

我试着将图像居中,答案中建议的技术都不起作用。一个常规的HTML <img>内联CSS为我工作…

<img style="display: block; margin: auto;" alt="photo" src="{{ site.baseurl }}/images/image.jpg">

这是一个在GitHub上托管的Jekyll博客

这有点俗气,但如果你正在使用GFM或其他支持用管道构建表的MD语法,你可以使用列对齐特性:

|| <!-- empty table header -->
|:--:| <!-- table header/body separator with center formatting -->
| I'm centered! | <!-- cell gets column's alignment -->

这在标记中起作用。