text - 如何使用 pandoc 语法在 Markdown 文档中指定表格?

标签 text markdown pandoc

我有一个 Markdown 文档,我正在使用 pandoc 工具处理以生成 HTML 和 PDF 文档。我正在尝试在文档中包含一个表格。常规 Markdown 不支持表格,但 pandoc 支持。我已经尝试将表格的定义从 pandoc 文档复制粘贴到我的源文档中,但是当通过 pandoc 程序运行它时,生成的文档全部塞进了一个大表格中。

任何人都可以向我展示一个正确呈现的 pandoc 表吗?

最佳答案

# Points about Tweedledee and Tweedledum

Much has been made of the curious features of 
Tweedledee and Tweedledum.  We propose here to
set some of the controversy to rest and to uproot
all of the more outlandish claims.

    .      Tweedledee       Tweedledum
--------   --------------   ----------------
Age        14               14
Height     3'2"             3'2"
Politics   Conservative     Conservative
Religion   "New Age"        Syrian Orthodox
---------  --------------   ----------------

Table: T.-T. Data


# Mussolini's role in my downfall

--------------------------------------------------------------------
             *Drugs*         *Alcohol*           *Tobacco*
----------   -------------   -----------------   --------------------
    Monday     3 Xanax        2 pints             3 cigars,  
                                                  1 hr at hookah bar

   Tuesday    14 Adderall     1 Boone's Farm,     1 packet Drum
                              2 Thunderbird

 Wednesday    2 aspirin       Tall glass water    (can't remember)
---------------------------------------------------------------------

Table:  *Tableau des vices*, deluxe edition


# Points about the facts

In recent years, more and more attention has been 
paid to opinion, less and less to what were formerly 
called the cold, hard facts.  In a spirit of traditionalism, 
we propose to reverse the trend. Here are some of our results.

-------     ------ ----------   -------
     12     12        12             12
    123     123       123           123
      1     1          1              1
---------------------------------------

Table:  Crucial Statistics


# Recent innovations (1): False presentation

Some, moved by opinion and an irrational lust for novelty, 
would introduce a non-factual element into the data, 
perhaps moving all the facts to the left:

-------     ------ ----------   -------
12          12     12           12
123         123    123          123
1           1      1            1
---------------------------------------

Table: Crucial "Statistics"

# Recent innovations (2): Illegitimate decoration

Others, preferring their facts to be *varnished*, 
as we might say, will tend to 'label' the columns

Variable    Before During       After
---------   ------ ----------   -------
12          12     12           12
123         123    123          123
1000        1000   1000         1000
----------------------------------------

# Recent innovations (3): "Moderate" decoration

Or, maybe, to accompany this 'spin' with a centered or centrist representation: 

 Variable    Before  During       After
----------  ------- ----------   -------
 12          12      12           12
 123         123     123          123
 1           1       1            1
-----------------------------------------


# The real enemy

Some even accompany these representations with a bit of leftwing 
clap-trap, suggesting the facts have drifted right:


------------------------------------------------------
  Variable       Before            During       After
----------  -----------        ----------     -------
 12                  12                12          12
              -- Due to
                baleful 
              bourgeois
              influence

  123               123               123          123
              -- Thanks
              to the 
              renegade 
               Kautsky

  1                   1                 1            1
              -- All a 
              matter of
            sound Party
             discipline
-------------------------------------------------------

Table: *"The conditions are not ripe, comrades; they are **overripe**!"*

# The Truth

If comment be needed, let it be thus:  the facts have drifted left.


------------------------------------------------------------------------
 Variable   Before             During            After
----------  -------------      ----------        ----------------------
 12         12                 12                12
            (here's            (due to           (something to do
            where the rot      lapse of          with Clinton and
            set in )           traditional       maybe the '60's)
                               values)

 123        123                123               123
            (too much          (A=440?)
            strong drink)

 1          1                  1                 1
                                                 (Trilateral Commission?)
--------------------------------------------------------------------------

Table: *The Decline of Western Civilization*

关于text - 如何使用 pandoc 语法在 Markdown 文档中指定表格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4546547/

相关文章:

c++ - 在 C C++ 中比较和匹配 word/excel 文件中的数字

r - 使用 knitr 创建 HTML 幻灯片,仅输出 R 代码

latex - 从使用Moderncv模板中的knitr创建的PDF中删除页码

Java:如何将PDF写出到文本文件?

javascript - jQuery - .text 返回 [Object Object] 而不是变量。

php - preg_replace 仅外部标签? (...我们不是在谈论完整的 'html parsing' ,只是一些 Markdown )

markdown - 如何在 Markdown 表格中添加换行符?

pandoc - 是否可以根据变量值在 pandoc 模板中编写条件语句?

haskell - pandoc 在 haskell 中包含文件过滤器

c++ - 程序只输入一行到文本文件