Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify tables in my Markdown document using pandoc syntax?

I have a markdown document I'm processing with the pandoc tool to generate HTML and PDF documents. I'm trying to include a table in the document. Regular markdown doesn't support tables, but pandoc does. I've tried copy-pasting the definition of a table from the pandoc documentation into my source document, but when running it through the pandoc program the resulting document is all crammed into one big table.

Can anyone show me a pandoc table that renders properly?

like image 460
mpvvliet Avatar asked Dec 28 '10 13:12

mpvvliet


People also ask

What is pandoc used for?

Pandoc is a command-line tool for converting files from one markup language to another. Markup languages use tags to annotate sections of a document. Commonly used markup languages include Markdown, ReStructuredText, HTML, LaTex, ePub, and Microsoft Word DOCX.

What is a pandoc template?

Pandoc is a command line tool that you can use to automatically convert files from markup format to another. With Pandoc, you can write in something easy like Markdown, Microsoft Word, or LibreOffice, and convert it something hard like: HTML. Ebook formats.

Can pandoc convert HTML to markdown?

Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx.

How do I convert Word to markdown in pandoc?

As you can see, first, write pandoc to execute any pandoc command, and then write the file name of a file with extension which you want to convert to a markdown file. The -o stands for output file name and provide name of the file with extension to which it should be converted.


1 Answers

# 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* 
like image 192
applicative Avatar answered Oct 25 '22 08:10

applicative