rst2pdf(1)
πΈ rst2pdf β the manual, but make it a group chat πΈ
okay so bestie, welcome to rst2pdf(1) β that's the text processing section of your manual pages, and yes this lil tool is the moment. sit down, hydrate, we're converting docs to PDFs and we're doing it directly, no LaTeX detour, no drama π
β¨ SYNOPSIS β¨
rst2pdf [options] [input] [-o output]
that's it. that's the whole vibe. input goes in, PDF comes out π¦
π DESCRIPTION π
so the usual way people make a PDF out of a reStructuredText (ReST) document is by routing the whole thing through LaTeX. which, fine, okay, it works. but rst2pdf said not me being basic and does it a whole different way: it builds the PDF directly, using the ReportLab library. no LaTeX middleman, no cap π₯
π OPTIONS π
every single flag, no skips, we're thorough here because that's the energy:
-h,--helpβ shows this help message and then exits, king behavior π«Ά--config=FILEβ the config file to use. Default is~/.rst2pdf/config-o FILE,--output=FILEβ write the PDF to FILE-s STYLESHEETS,--stylesheets=STYLESHEETSβ a comma-separated list of custom stylesheets. Default is""--stylesheet-path=FOLDERLISTβ a colon-separated list of folders to search for stylesheets. Default is""-c,--compressedβ create a compressed PDF. Default isFalse--print-stylesheetβ prints the default stylesheet and exits--font-folder=FOLDERβ search this folder for fonts. (Deprecated) okay so this one is deprecated, noted, moving on--font-path=FOLDERLISTβ a colon-separated list of folders to search for fonts. Default is""--baseurl=URLβ the base URL used for relative URLs-l LANG,--language=LANGβ the language used for hyphenation and docutils localization. Default isNone--header=HEADERβ page header, but only if the document itself doesn't specify one--footer=FOOTERβ page footer, same deal, only if the document doesn't specify one--section-header-depth=Nβ sections up to this depth get used in the header and footer's replacement of###Section###. Default is2--smart-quotes=VALUEβ tries to convert ASCII quotes, ellipsis and dashes into the typographically correct equivalent. Default is0
the possible values, and bestie listen, this is a whole numbered saga:
- Suppress all transformations. (Do nothing.) literally nothing happens β
- Performs default SmartyPants transformations: quotes (including backticks-style), em-dashes, and ellipses.
"--"(dash dash) is used to signify an em-dash; there is no support for en-dashes. - Same as
--smart-quotes=1, except that it uses the old-school typewriter shorthand for dashes:"--"(dash dash) for en-dashes,"---"(dash dash dash) for em-dashes. - Same as
--smart-quotes=2, but inverts the shorthand for dashes:"--"(dash dash) for em-dashes, and"---"(dash dash dash) for en-dashes.
wait, careful β the list above is numbered 0 through 3 in the original (0, 1, 2, 3), soVALUEreally does start at0for "do nothing". don't get it twisted π
--fit-literal-mode=MODEβ what to do when a literal is too wide. one oferror,overflow,shrink,truncate. Default is"shrink"--fit-background-mode=MODEβ how to fit the background image to the page. one ofscale,scale_widthorcenter. Default is"center"--inline-linksβ shows the target between parenthesis instead of as an active link--repeat-table-rowsβ repeats the header row for each splitted table--raw-htmlβ support embedding raw HTML. Default:False-q,--quietβ print less information-v,--verboseβ print debug information--very-verboseβ print even more debug information π--versionβ print version number and exit--no-footnote-backlinksβ disable footnote backlinks. Default:False--inline-footnotesβ show footnotes inline. Default:True--default-dpi=NUMBERβ DPI for objects sized in pixels. Default is300--show-frame-boundaryβ show frame borders (only useful for debugging). Default isFalse--disable-splittablesβ don't use splittable flowables in some elements. only try this if you literally cannot process a document any other way, it's the last-resort button π¨-b LEVEL,--break-level=LEVELβ maximum section level that starts in a new page. Default:0--first-page-on-rightβ when using double sided pages, the first page will start on the right hand side. (Book Style)--blank-first-pageβ add a blank page at the beginning of the document--break-side=VALUEβ how section breaks work. can be"even", and sections start in an even page,"odd", and sections start in odd pages, or"any"and sections start in the next page, be it even or odd. See also the-boption.--date-invariantβ don't store the current date in the PDF. useful mainly for the test suite, where we don't want the PDFs to change-e EXTENSIONSβ alias for--extension-module--extension-module=EXTENSIONSβ add a helper extension module to this invocation ofrst2pdf(module must end in.pyand be on the python path)--custom-cover=FILEβ template file used for the cover page. Default:cover.tmpl--use-floating-imagesβ makes images with:align:attribute work more like inrst2html. Default:False--use-numbered-linksβ when using numbered sections, adds the numbers to all links referring to the section headers. Default:False--strip-elements-with-class=CLASSβ remove elements with this CLASS from the output. can be used multiple times--record-dependencies=FILEβ write output file dependencies to FILE
π EXAMPLES π
okay here's the iconic one-liner:
$ rst2pdf rest.txt -o out.pdf
it produces an out.pdf file which is a PDF version of the ReST document rest.txt. that's the whole trick, no notes, ate and left no crumbs π
π Author π
Chris Lamb <chris@chris-lamb.co.uk> for the Debian project π«‘
and that's the page bestie! this was rst2pdf(1) β manual name rst2pdf, in the text processing section, footer also reading rst2pdf(1) (so you always know where you are when you scroll back up π
). go make some PDFs, you're gonna slay β¨π¦πΈ
π¦ where this page comes from
- nixos 26.05: python3.13-rst2pdf 0.105
- nixos 26.05: python3.14-rst2pdf 0.105
- ubuntu resolute: rst2pdf 0.104-1 Β· MIT
- ubuntu stonking: rst2pdf 0.104-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms