aboutsummaryrefslogtreecommitdiff
path: root/man/man1/pandoc.1
blob: 82c9ae321e5dffd38908807b45f3e2bbf21fa288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
.TH PANDOC 1 "December 15, 2006" Pandoc "User Manuals"
.SH NAME
pandoc, markdown2html, markdown2latex, markdown2rst, markdown2rtf,
markdown2s5, html2markdown2, latex2markdown, rst2markdown \- general
markup converter
.SH SYNOPSIS
\fBpandoc\fR [\fIoptions\fR] [\fIinput\-file\fR]...
.SH DESCRIPTION
\fBPandoc\fR converts files from one markup format to another. It can
read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and
it can write markdown, reStructuredText, HTML, LaTeX, RTF, and S5 HTML
slide shows.
.PP
If no \fIinput\-file\fR is specified, input is read from STDIN.
Otherwise, the \fIinput\-files\fR are concatenated (with a blank
line between each) and used as input.  Output goes to standard
output.  If you want output to a file, use the \fB\-o\fR option or
shell redirection:
.IP
.B pandoc \-o output.html input.txt
.IP
.B pandoc input.txt > output.html
.PP
The default behavior of \fIPandoc\fR is to convert the input from
markdown\-formatted plain text to HTML.  Different input and output
formats can be specified using command\-line options.  For example,
.IP
.B pandoc \-f latex \-t markdown chap1.tex > chap1.txt
.PP
converts \fIchap1.tex\fR from LaTeX to markdown\-formatted plain text.
See below for a detailed list of command\-line options.
.PP
For convenience, eight variant programs are available:
\fBmarkdown2html\fR (same as \fBpandoc \-w html\fR),
\fBmarkdown2latex\fR (same as \fBpandoc \-w latex\fR),
\fBmarkdown2rst\fR (same as \fBpandoc \-w rst\fR),
\fBmarkdown2rtf\fR (same as \fBpandoc \-w rtf\fR),
\fBmarkdown2s5\fR (same as \fBpandoc \-w s5\fR),
\fBhtml2markdown\fR (same as \fBpandoc \-r html \-w markdown\fR),
\fBlatex2markdown\fR (same as \fBpandoc \-r latex \-w markdown\fR),
and \fBrst2markdown\fR (same as \fBpandoc \-r rst \-w markdown\fR).
These programs take an appropriately restricted subset of \fBpandoc\fR's
options.  (Run them with the \fB-h\fR flag for a full list of allowed
options.)  
.PP
\fIPandoc\fR uses the UTF\-8 character encoding for both input and output.
If your local character encoding is not UTF\-8, you should pipe input
and output through \fBiconv\fR:
.IP
.B iconv \-t utf\-8 input.txt | pandoc | iconv \-f utf\-8

.SH OPTIONS
.TP
.B \-f \fIFORMAT\fB, \-r \fIFORMAT\fB, \-\-from=\fIFORMAT\fB, \-\-read=\fIFORMAT\fB
Specify input format.
.I FORMAT
can be
.B native
(native Haskell),
.B markdown
(markdown or plain text),
.B rst
(reStructuredText),
.B html
(HTML),
or 
.B latex
(LaTeX).
.TP
.B \-t \fIFORMAT\fB, \-w \fIFORMAT\fB, \-\-to=\fIFORMAT\fB, \-\-write=\fIFORMAT\fB
Specify output format.
.I FORMAT
can be
.B native
(native Haskell),
.B markdown
(markdown or plain text), 
.B rst
(reStructuredText),
.B html
(HTML),
.B latex
(LaTeX),
.B s5
(S5 HTML and javascript slide show),
or
.B rtf
(rich text format).
.TP
.B \-s, \-\-standalone
Produce output with an appropriate header and footer (e.g. a
standalone HTML, LaTeX, or RTF file, not a fragment).
.TP
.B \-o FILE, \-\-output=FILE
Write output to \fIFILE\fR instead of STDOUT.
.TP
.B \-p, \-\-preserve-tabs
Preserve tabs instead of converting them to spaces.
.TP
.B \-\-tab-stop=\fITABSTOP\fB
Specify tab stop (default is 4).
.TP
.B \-R, \-\-parse-raw
Parse untranslatable HTML codes and LaTeX environments as raw HTML
or LaTeX, instead of ignoring them.
.TP
.B \-S, \-\-smartypants
Use smart quotes, dashes, and ellipses in HTML output.
.TP
.B \-m, \-\-asciimathml
Use ASCIIMathML to display embedded LaTeX math in HTML output.
.TP
.B \-i, \-\-incremental
Make list items in S5 display incrementally (one by one).
.TP
.B \-N, \-\-number-sections
Number section headings in LaTeX output.  (Default is not to number
them.)
.TP
.B \-c \fICSS\fB, \-\-css=\fICSS\fB
Link to a CSS style sheet.
.I CSS
is the pathname of the style sheet.
.TP
.B \-H \fIFILE\fB, \-\-include-in-header=\fIFILE\fB
Include contents of \fIFILE\fR at the end of the header.  Implies
\fB\-s\fR.
.TP
.B \-B \fIFILE\fB, \-\-include-before-body=\fIFILE\fB
Include contents of \fIFILE\fR at the beginning of the document
body.
.TP
.B \-A \fIFILE\fB, \-\-include-after-body=\fIFILE\fB
Include contents of \fIFILE\fR at the end of the document body.
.TP
.B \-C \fIFILE\fB, \-\-custom-header=\fIFILE\fB
Use contents of \fIFILE\fR as the document header (overriding the
default header, which can be printed by using the \fB\-D\fR option).
Implies \fB-s\fR.
.TP
.B \-D \fIFORMAT\fB, \-\-print-default-header=\fIFORMAT\fB
Print the default header for \fIFORMAT\fR (\fIhtml, s5, latex,
markdown, rst, rtf\fR).
.TP
.B \-T \fISTRING\fB, \-\-title-prefix=\fISTRING\fB
Specify \fISTRING\fR as a prefix to the HTML window title.
.TP
.B \-d, \-\-debug
Print debugging information (names of input and output files) to
STDERR.  Write output to STDOUT, even if an output file was specified
using the \fB\-o\fR option.
.TP
.B \-v, \-\-version
Print version.
.TP
.B \-h, \-\-help
Show usage message.

.SH "SEE ALSO"
\fBweb2markdown\fR(1),
\fBmarkdown2pdf\fR(1),
\fBiconv\fR(1)

The
.I README
file distributed with Pandoc contains full documentation.

The Pandoc source code and all documentation may be downloaded from
<http://sophos.berkeley.edu/macfarlane/pandoc/>.
.SH AUTHOR
John MacFarlane