Closed prowlett closed 3 years ago
I do not mean to be pushy, and I totally understand the conflicting draws on your time, but just in case you are prioritising work on makecourse
: as we are going through our graph theory section this is a problem each week for us. We have told students the PDF is a better version to look at for now and this will hopefully be fixed at some point.
I think to tackle this properly I will need to look carefully to really see what's going on inside plasTeX's PDF imager. Using a PNG file does not invoke the imager and that's why they seem to work better.
For the moment, does adding the following to your preamble help with your graph theory slides?
\ifplastex
\setbeamertemplate{background canvas}[default]
\setbeamercolor{background canvas}{bg=}
\beamertemplatenavigationsymbolsempty
\fi
Yes, perfect! The HTML output now looks exactly as I expect it to.
At first I got an error (below) but realised it was because \ifplastex
is defined by makecourse
and I didn't have \usepackage{makecourse}
.
! Undefined control sequence.
l.24 \ifplastex
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on graphs.log
This does seem to work really well, I've included it as part of the pdf2svg
imager in 382ee3add5180057182630c5abc2bfd110179633 so that it's injected into the LaTeX preamble automatically.
I'm closing this for now, but will re-open if more problems with the same origin surface. The fix will likely be to add further lines similar to \setbeamertemplate{background canvas}[default]
to reset beamer template elements back to empty or transparent.
Brilliant! That works well for tikz images, but does not work for the case where a PDF is included using \includegraphics
, which I think uses a related process. Here is an example - the first image is a tight crop with no background, but the second includes the PDF on a background with tikz controls etc. (It still works for \includegraphics
using PNG images.)
\documentclass{beamer}
\usepackage{tikz}
\usepackage{graphicx}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\draw (0,0) rectangle (1,2);
\end{tikzpicture}
\end{frame}
\begin{frame}
\includegraphics{image.pdf}
\end{frame}
\end{document}
Ah, sorry. I forgot about the non-vector imager. Hopefully 10fd295a9afecff271e8ba884e1bc1ef7d0dfc6f works with both.
It does, thank you!
There is a problem with images in Beamer slides generated from
tikz
and PDF graphics, which seem to render an image for the HTML version which is too large and resembled (not precisely) the whole slide. I guess because it happens withtikz
and PDF but not PNG that it is an SVG issue, and I don't really understand such things.Here is a basic example. I have put the horrible colour scheme on the background so you can see what is happening more clearly, but it happens anyway even with a default plain white background.
LaTeX code:
The PDF output looks like this:
The HTML output looks like this:
My expectation is that the HTML version will not have a background colour. As I've said, even if the slide background it is white it still makes a big slide-sized image for the HTML version.
Notice that the version of the slide that appears in the HTML image lacks the other slide content (title, text), but has the control buttons in the footer. So it is a version of the slide that only contains the picture, and the picture is not located in its proper place on the slide.
Just to confirm, this works with
tikz
graphics and also with images imported from PDF. Hereimage.pdf
is a PDF made bytikz
as astandalone
graphic. I changed the rectangle to a circle to avoid confusion with the screenshots above.The PDF output looks like this:
The HTML output looks like this:
However, the problem does not occur with, say, a PNG graphic. Here
image.png
is simplyimage.pdf
converted to PNG.The PDF output looks like this:
The HTML output looks like this:
I think it is fair to say this last image is what I expect to happen for all three. I hope that all makes sense.