How to output the created document as pdf using rst2pdf
OS:Mac OS X 10.9.5 Python:Ver.2.7.7
$ sudo easy_install rst2pdf
・ ・ ・
Finished processing dependencies for rst2pdf
If you get this result, you're done.
conf.py Add the following to conf.py
extensions = ['rst2pdf.pdfbuilder']
# -- Options for PDF output --------------------------------------------------
pdf_documents = [
('index', u'MyProject', u'My Project', u'Author Name'),
]
pdf_stylesheets = ['sphinx','kerning','a4','ja']
pdf_language = "ja"
Makefile Add the following to the Makefile
pdf:
$(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf
@echo
@echo "Build finished. The PDF files are in _build/pdf."
ja.json Add ja.json
{
"embeddedFonts" : [
"VL-Gothic-Regular.ttf",
"VL-PGothic-Regular.ttf",
"ipam.otf",
"ipag.otf",
"ipagp.otf",
"ipamp.otf"
],
"fontsAlias" : {
"stdFont": "VL-PGothic-Regular",
"stdBold": "VL-PGothic-Regular",
"stdItalic": "VL-PGothic-Regular",
"stdBoldItalic": "VL-PGothic-Regular",
"stdMono": "VL-Gothic-Regular",
"stdMonoBold": "VL-Gothic-Regular",
"stdMonoItalic": "VL-Gothic-Regular",
"stdMonoBoldItalic": "VL-Gothic-Regular",
"stdSans": "VL-Gothic-Regular",
"stdSansBold": "VL-Gothic-Regular",
"stdSansItalic": "VL-Gothic-Regular",
"stdSansBoldItalic": "VL-Gothic-Regular"
},
"styles" : [
["base" , {
"wordWrap": "CJK"
}],
["literal" , {
"wordWrap": "None"
}]
]
}
$ make pdf
Generated in the _build / pdf folder.
If you get the following error when installing rst2pdf
error: Setup script exited with error: command 'cc' failed with exit status 1
Install xcode-select
$ xcode-select --install