Use \nbsphinxincludegraphics only inside nbsphinxfancyoutput
Use \nbsphinxincludegraphics only inside nbsphinxfancyoutput

The formula for obtaining \nbsphinx@image@maxheight from \textheight is
a bit empirical. I tested it with 10pt and 12pt pointsizes and a4paper
or letterpaper.

The exact correction to subtract (with default \fboxsep, \fboxrule) was
found 11.1959pt for letterpaper at 10pt and 11.2271pt for a4paper at
10pt. The 2\fboxsep+2\fboxrule accounts by default for 6.8pt of that,
thus adding \baselineskip (12pt) makes 18.8pt and appears safe enough.

I tested the recipe with various settings (even big) of \fboxsep and
\fboxrule and it seems to work. I also tested at 12pt pointsize.

Testing was only done with nbsphinxfancyouput having as contents a
single image.

spatialaudio/nbsphinx,spatialaudio/nbsphinx,spatialaudio/nbsphinx