Markdown 相当于 LaTeX 的描述环境是什么?

What is the Markdown equivalent to LaTeX's description environment?

有没有相当于LaTeX描述环境的Markdown?这使作者能够生成第一个单词为粗体的列表,如下所示:

LaTeX 源将是:

\begin{description}
  \item[First] The first item
  \item[Second] The second item
  \item[Third] The third etc \ldots
\end{description}

我想在 Markdown 中复制它,这样如果我 运行 通过诸如 pandoc 之类的工具使用 Markdown,我会得到类似的结果。

Markdown 不如 LaTeX 全面,或者 even HTML:

Markdown’s syntax is intended for one purpose: to be used as a format for writing for the web.

Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags.

它支持bulleted and numbered lists,但不支持定义列表。

但是,您提到使用“pandoc 之类的工具”来处理您的输入文件。 Pandoc 支持使用 raw_tex 扩展名的内联 LaTeX:

Extension: raw_tex

In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be included in a document. Inline TeX commands will be preserved and passed unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use LaTeX to include BibTeX citations:

This result was proved in \cite{jones.1967}.

Note that in LaTeX environments, like

\begin{tabular}{|l|l|}\hline
Age & Frequency \ \hline
18--25  & 15 \
26--35  & 33 \
36--45  & 22 \ \hline
\end{tabular}

the material between the begin and end tags will be interpreted as raw LaTeX, not as markdown.

Inline LaTeX is ignored in output formats other than Markdown, LaTeX, and ConTeXt.

所以简单地包括你的 LaTeX description 环境和 运行 带有 raw_tex 扩展名的 Pandoc 应该会给你你想要的结果。

您可能必须手动指定源格式,例如通过在命令中使用 -f markdown_strict+raw_tex 之类的东西。

如果你使用的是最新版本的Pandoc(ver 2.0+),你可以使用the definition lists notation,如下图。这样就容易多了。

First

: The first item

Second

: The second item

Third

: The third etc