Skip to content

docs: versioned PDF user guide built from the Sphinx sources - #475

Draft
bodono wants to merge 7 commits into
masterfrom
docs/user-guide-pdf
Draft

bodono wants to merge 7 commits into
masterfrom
docs/user-guide-pdf

Conversation

@bodono

@bodono bodono commented Sep 11, 2026

Copy link
Copy Markdown
Member

Draft for discussion, following #474: a user's guide as a single versioned PDF, generated from the same Sphinx sources as the site so it cannot drift from it.

  • make guide in docs/src renders a curated subset of the docs through Sphinx's LaTeX builder into _build/latex/scs_user_guide.pdf, running pdflatex directly so the only extra requirement is a TeX installation. The release number from conf.py appears on the title page, which is what versions the guide.
  • The PDF has its own master document, guide/index.rst, which selects what it contains: C and Python install and API, cones, matrices, settings, info, exit flags, compile flags, linear solvers, BLAS/LAPACK, best practices, help, the algorithm as background, and citing. It points to the site for the other language interfaces and the worked examples. 62 pages.
  • The docs workflow installs TeX and publishes the PDF next to the site as scs_user_guide.pdf; the front page links to it and says to cite the published papers rather than the guide.
  • The root toctree is reordered into guide order (install and use first, the algorithm as background), which changes the site's navigation order too.
  • guide/best_practices.rst is a new draft chapter (scaling, tolerances, workspace reuse, backend choice, acceleration, reading the log, certificates, differentiating through SCS, when to use something else). It is written for maintainer review and every recommendation in it should be checked.
  • Layout for print: the cone, settings, compile-flag and info tables get explicit column widths, the settings and compile-flag tables become page-breaking longtables, tables are set a size down in the PDF, the vertical spacing around C API entries is tightened, and ScsCone, ScsSettings and ScsInfo are shown in outline form with a pointer to the table that documents each field.
  • Algorithm pages audited against src/scs.c and include/glbopts.h: the embedding (u, Q, C_+) is now defined on the algorithm page; root_plus is written in terms of the cached g = (R + M)^{-1}(c, -b) and per-iteration p rather than an undefined r; the adaptive-scale band is [1/10, 10] on the geometric-mean ratio, not [1/3, 3]; and a sign typo in the unequilibrated primal residual is fixed. Every quoted default was checked.
  • Two source fixes the LaTeX build needed: the JavaScript example's .. math:: blocks carry their own align*, which LaTeX rejects inside Sphinx's split wrapper, so they are marked :nowrap: (no change to the HTML rendering); and a few Unicode math symbols that reach the PDF through code comments are declared in the preamble.

Built locally: Sphinx -W clean for both the HTML and LaTeX builders.

🤖 Generated with Claude Code

bodono and others added 7 commits September 11, 2026 11:45
Adds a 'guide' target that renders the existing documentation through
Sphinx's LaTeX builder into scs_user_guide.pdf, with the release number
from conf.py on the title page, and publishes it next to the site from
the docs workflow. The root toctree is reordered so that the site and the
PDF read as a guide (install and use first, the algorithm as background),
and a draft best-practices chapter is added for maintainer review.

The JavaScript example's math blocks carried their own align* environments,
which MathJax accepts but LaTeX rejects inside Sphinx's split wrapper, so
they are marked :nowrap:. A handful of Unicode math symbols that reach the
PDF through code comments are declared for pdflatex in the preamble.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The PDF now starts from guide/index.rst rather than the site's root, so
it covers the C and Python interfaces, the core reference pages, the
linear solvers, best practices, help, the algorithm and citing, and
points to the site for the other interfaces and the worked examples.
64 pages instead of 117.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Give the cone, settings, compile-flag and info tables explicit column
widths so math and long monospace names are not squeezed, make the
settings and compile-flag tables longtables so they break cleanly across
pages, set tables a size down in the PDF, and tighten the vertical
spacing Sphinx puts around every struct member and function in the C
API reference. HTML rendering is unchanged apart from the column widths.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…it the algorithm pages

The spectral cone table's row-count column gets room for its sums, set
inline rather than display style. ScsCone, ScsSettings and ScsInfo are
shown in outline form with a pointer to the table that documents each
field, instead of repeating every member's docstring.

Algorithm pages checked against src/scs.c and include/glbopts.h: the
embedding (u, Q, C_+) that the DR iteration acts on is now defined on
the algorithm page rather than assumed; root_plus is written in terms of
the cached g = (R + M)^{-1}(c, -b) and per-iteration p, which the page
called r without defining; the adaptive-scale band is [1/10, 10] on the
geometric-mean ratio (the code tests its square root against sqrt(10)),
not [1/3, 3]; and a sign typo in the unequilibrated primal residual is
fixed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replace the seven doxygenstruct member listings on the C API page with
literalinclude blocks of the struct declarations from include/scs.h and
include/aa_stats.h, comments included. The declarations are compact, are
the source of truth, and read the same in HTML and in the PDF, where the
member-per-paragraph rendering ran over pages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant