From 8fa890c5fd2b60bc35ba4ad432afb97cd5ff8292 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 11 Jun 2016 15:16:13 +0900 Subject: [PATCH 1/4] Install TeXLive for testing on Travis CI --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 85378277c..91ad798e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ addons: apt: packages: - graphviz + - texlive-latex-recommended + - texlive-latex-extra + - texlive-fonts-recommended + - texlive-fonts-extra install: - pip install -U pip - pip install docutils==$DOCUTILS From d7dd00a8986f2ef3a934d31bc0c730491ba970a5 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 11 Jun 2016 15:17:55 +0900 Subject: [PATCH 2/4] Failed to build PDF with framed.sty 0.95 The framed.sty which ubuntu precise bundles does not uses \OuterFrameSep macro yet. --- CHANGES | 1 + sphinx/texinputs/sphinx.sty | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 64c1abde0..0a149a3b2 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,7 @@ Bugs fixed * latex: allow one more nesting depth for code-blocks (ref #777, PR #2624) * #2635: Latex code directives produce inconsistent frames based on viewing resolution * #2639: Sphinx now bundles iftex.sty +* Failed to build PDF with framed.sty 0.95 Release 1.4.3 (released Jun 5, 2016) diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 449924710..12ec1adef 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -416,7 +416,7 @@ \newenvironment{SphinxShadowBox} {\def\FrameCommand {\Sphinx@ShadowFBox }% % configure framed.sty not to add extra vertical spacing - \OuterFrameSep \z@skip + \ifdefined\OuterFrameSep \OuterFrameSep\z@skip \fi % the \trivlist will add the vertical spacing on top and bottom which is % typical of center environment as used in Sphinx <= 1.4.1 % the \noindent has the effet of an extra blank line on top, to @@ -532,7 +532,7 @@ % configure framed.sty's parameters to obtain same vertical spacing % as for "light" boxes. We need for this to manually insert parskip glue and % revert a skip done by framed before the frame. - \setlength{\OuterFrameSep}{0pt} + \ifdefined\OuterFrameSep \OuterFrameSep\z@skip \fi \vspace{\FrameHeightAdjust} % copied/adapted from framed.sty's snugshade \def\FrameCommand##1{\hskip\@totalleftmargin From fec2a36db7adf415cb83cbcc6fdb9d4e7baad683 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 11 Jun 2016 15:41:27 +0900 Subject: [PATCH 3/4] Use \c@chapter instead of \thechapter to check what sectioning unit is used In ubuntu precise, the old condition; \thechapter is defined or not misdetects the sectioning unit. And then, it causes build error. --- sphinx/texinputs/sphinx.sty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 12ec1adef..4874aa62c 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -841,7 +841,7 @@ % Define literal-block environment \RequirePackage{newfloat} \DeclareFloatingEnvironment{literal-block} -\ifx\thechapter\undefined +\ifx\c@chapter\undefined \SetupFloatingEnvironment{literal-block}{within=section,placement=h} \else \SetupFloatingEnvironment{literal-block}{within=chapter,placement=h} From bc4148983d046dd79d329daaa75e5926f9ade016 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 12 Jun 2016 11:33:43 +0900 Subject: [PATCH 4/4] Sphinx now bundles needspace.sty --- CHANGES | 1 + sphinx/texinputs/needspace.sty | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 sphinx/texinputs/needspace.sty diff --git a/CHANGES b/CHANGES index 0a149a3b2..efbe161b8 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,7 @@ Bugs fixed * #2635: Latex code directives produce inconsistent frames based on viewing resolution * #2639: Sphinx now bundles iftex.sty * Failed to build PDF with framed.sty 0.95 +* Sphinx now bundles needspace.sty Release 1.4.3 (released Jun 5, 2016) diff --git a/sphinx/texinputs/needspace.sty b/sphinx/texinputs/needspace.sty new file mode 100644 index 000000000..113d87216 --- /dev/null +++ b/sphinx/texinputs/needspace.sty @@ -0,0 +1,35 @@ + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{needspace}[2010/09/12 v1.3d reserve vertical space] + +\newcommand{\needspace}[1]{% + \begingroup + \setlength{\dimen@}{#1}% + \vskip\z@\@plus\dimen@ + \penalty -100\vskip\z@\@plus -\dimen@ + \vskip\dimen@ + \penalty 9999% + \vskip -\dimen@ + \vskip\z@skip % hide the previous |\vskip| from |\addvspace| + \endgroup +} + +\newcommand{\Needspace}{\@ifstar{\@sneedsp@}{\@needsp@}} + +\newcommand{\@sneedsp@}[1]{\par \penalty-100\begingroup + \setlength{\dimen@}{#1}% + \dimen@ii\pagegoal \advance\dimen@ii-\pagetotal + \ifdim \dimen@>\dimen@ii + \break + \fi\endgroup} + +\newcommand{\@needsp@}[1]{\par \penalty-100\begingroup + \setlength{\dimen@}{#1}% + \dimen@ii\pagegoal \advance\dimen@ii-\pagetotal + \ifdim \dimen@>\dimen@ii + \ifdim \dimen@ii>\z@ + \vfil + \fi + \break + \fi\endgroup} +