PDF support for sample document with font
This commit enables the sample document to support PDF builds with Liberation font. Since current Jenkins gate has docs build but does not have publish-docs build, PDF builds are done in docs tox build job. Change-Id: I9d40ac0bf179075c102170f9560629989520e12f Implements: blueprint build-pdf-from-rst-guides Co-Authored-By: SeongSoo Cho <nexusz99@gmail.com>
This commit is contained in:
committed by
Andreas Jaeger
parent
5a032c4ef5
commit
adaf0b1132
@@ -1,6 +1,8 @@
|
||||
# This is a cross-platform list tracking distribution packages needed by tests;
|
||||
# see http://docs.openstack.org/infra/bindep/ for additional information.
|
||||
|
||||
fonts-lmodern [platform:dpkg]
|
||||
fonts-liberation [platform:dpkg]
|
||||
libxml2-dev [platform:dpkg]
|
||||
libxml2-devel [platform:rpm]
|
||||
libxml2-utils [platform:dpkg]
|
||||
@@ -13,3 +15,8 @@ python3-devel [platform:fedora]
|
||||
python34-devel [platform:centos]
|
||||
zlib-devel [platform:rpm]
|
||||
zlib1g-dev [platform:dpkg]
|
||||
inkscape
|
||||
texlive-latex-base [platform:dpkg]
|
||||
texlive-latex-extra [platform:dpkg]
|
||||
texlive-xetex [platform:dpkg]
|
||||
texlive-fonts-recommended [platform:dpkg]
|
||||
|
||||
@@ -24,6 +24,12 @@ import openstackdocstheme
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# Release name for PDF documents
|
||||
latex_custom_template = r"""
|
||||
\usepackage{""" + openstackdocstheme.get_pdf_theme_path() + """}
|
||||
\\newcommand{\openstacklogo}{""" + openstackdocstheme.get_openstack_logo_path() + """}
|
||||
"""
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
@@ -216,16 +222,22 @@ htmlhelp_basename = 'os-doc-demodoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
latex_engine = 'xelatex'
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
'papersize': 'a4paper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
'pointsize': '11pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
#Default figure align
|
||||
'figure_align': 'H',
|
||||
|
||||
# Not to generate blank page after chapter
|
||||
'classoptions': ',openany',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
'preamble': latex_custom_template,
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
|
||||
@@ -52,3 +52,10 @@
|
||||
|
||||
% Do not use chapter and section number
|
||||
\setcounter{secnumdepth}{-1}
|
||||
|
||||
% Font selection (English)
|
||||
\usepackage{fontspec}
|
||||
\defaultfontfeatures{Scale=MatchLowercase}
|
||||
\setmainfont{Liberation Serif}
|
||||
\setsansfont{Liberation Sans}
|
||||
\setmonofont[SmallCapsFont={Liberation Mono}]{Liberation Mono}
|
||||
|
||||
6
tox.ini
6
tox.ini
@@ -10,7 +10,9 @@ setenv = VIRTUAL_ENV={envdir}
|
||||
BRANCH_NAME=master
|
||||
CLIENT_NAME=openstackdocstheme
|
||||
sitepackages = False
|
||||
whitelist_externals = rm
|
||||
whitelist_externals =
|
||||
rm
|
||||
make
|
||||
|
||||
[testenv:pep8]
|
||||
commands =
|
||||
@@ -23,6 +25,8 @@ commands = {posargs}
|
||||
commands =
|
||||
rm -rf doc/build api-ref/build
|
||||
python setup.py build_sphinx
|
||||
sphinx-build -a -E -W -d doc/build/doctrees -b latex doc/source doc/build/pdf
|
||||
make -C doc/build/pdf
|
||||
sphinx-build -a -E -W -d api-ref/build/doctrees -b html api-ref/source api-ref/build/html
|
||||
|
||||
[testenv:releasenotes]
|
||||
|
||||
Reference in New Issue
Block a user