-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion Error in nbsphinx.py during latex build #584
Comments
Update: It seems to be a compatibility issue with sphinx 4.1.0. Pinning sphinx to version 4.0.2 using the requirements.txt file resolved the build error. |
@AAndersn Thanks for figuring this out. I was stuck on it for hours yesterday. |
Thanks for the report! Apparently (as I'll have to look into it a bit more for how to fix this. |
thank you! build passes with these dependencies: requiresments.txt
|
See also sphinx-doc/sphinx#9458. |
Commenting out the \begin{sphinxuseclass}{nbinput}
\begin{sphinxuseclass}{nblast}
{
\sphinxsetup{VerbatimColor={named}{nbsphinx-code-bg}}
\sphinxsetup{VerbatimBorderColor={named}{nbsphinx-code-border}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\llap{\color{nbsphinxin}[ ]:\,\hspace{\fboxrule}\hspace{\fboxsep}}
\end{sphinxVerbatim}
}
\end{sphinxuseclass}
\end{sphinxuseclass} The fix to the issue is to define latex environment \sphinxsetup{VerbatimColor={named}{nbsphinx-code-bg}}
\sphinxsetup{VerbatimBorderColor={named}{nbsphinx-code-border}} thing (I don't know to which class assign these tasks), rather than having theme explicitly show up in the latex code. Also they would not add the explicit Same problem with the class \begin{sphinxuseclass}{nboutput}
\begin{sphinxuseclass}{nblast}
{
\kern-\sphinxverbatimsmallskipamount\kern-\baselineskip
\kern+\FrameHeightAdjust\kern-\fboxrule
\vspace{\nbsphinxcodecellspacing}
\sphinxsetup{VerbatimColor={named}{white}}
\sphinxsetup{VerbatimBorderColor={named}{nbsphinx-code-border}}
\begin{sphinxuseclass}{output_area}
\llap{\color{nbsphinxout}[2]:\,\hspace{\fboxrule}\hspace{\fboxsep}}\begin{sphinxuseclass}{}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
42
\end{sphinxVerbatim}
\end{sphinxuseclass}
\end{sphinxuseclass}
}
\end{sphinxuseclass}
\end{sphinxuseclass} which has 4 nested classes, from outer to inner I'll see if task does not appear too complicated in the time I dispose of and possibly make a PR. I don't see an easy replacement to the
So simply removing these |
After having looked a bit more I realize I don't have a clear enough view of the
to be added to
and
lines in In brief, Sphinx 4.1.0 allows to support via LaTeX environments what is implemented in HTML via CSS classes. But the current In future though, a transfer of the hacking via DocUtils nodes and added visit and depart handlers to simply adding to |
Sorry for my late response!
It indeed allows the build to pass, but the resulting PDF doesn't look as expected.
Less importantly (but still), there might be some cases where additional blank lines have to be inserted in the beginning or the end of the output (because reST syntax doesn't allow leading or trailing blank lines). I checked the LaTeX lines in question (for an output cell only containing the number 42) produced by Sphinx 4.0.2 (prior to changes made by ['\\begin{sphinxVerbatim}[commandchars=\\\\\\{\\}]', '42', '\\end{sphinxVerbatim}'] With the latest Sphinx version, those lines are changed to: ['\\begin{sphinxuseclass}{output_area}', '\\begin{sphinxuseclass}{}', '', '', '\\begin{sphinxVerbatim}[commandchars=\\\\\\{\\}]', '42', '\\end{sphinxVerbatim}', '', '\\end{sphinxuseclass}', '\\end{sphinxuseclass}'] It would be interesting to properly use the |
I've just created #591, which hopefully fixes this issue. |
Needed to work around this issue: spatialaudio/nbsphinx#584
I have just created a new |
When using nbsphinx to build on readthedocs.org, nbsphinx has started to crash today (07/12/21) when asked to build latex:
python -m sphinx -b latex -D language=en -d _build/doctrees . _build/latex
The error message in the terminal is
I have been able to reproduce this message on my local machine, with the following log message:
My repo and source notebooks have not changed (readthedocs is building from the same commit)
The text was updated successfully, but these errors were encountered: