docs: fix pdf build, simpler start page (#2736)

This commit is contained in:
Henry Schreiner
2020-12-22 08:50:45 -05:00
committed by GitHub
parent 6b4297fd2f
commit 79b0e2c052
4 changed files with 32 additions and 22 deletions

View File

@@ -239,6 +239,8 @@ htmlhelp_basename = "pybind11doc"
# -- Options for LaTeX output ---------------------------------------------
latex_engine = "pdflatex"
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
@@ -353,8 +355,11 @@ def prepare(app):
with open(DIR.parent / "README.rst") as f:
contents = f.read()
# Filter out section titles for index.rst for LaTeX
if app.builder.name == "latex":
# Remove badges and stuff from start
contents = contents[contents.find(r".. start") :]
# Filter out section titles for index.rst for LaTeX
contents = re.sub(r"^(.*)\n[-~]{3,}$", r"**\1**", contents, flags=re.MULTILINE)
with open(DIR / "readme.rst", "w") as f: