josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.44k stars 143 forks source link

Make plain frames really fillable by canceling sidebars (and not only hidding them) #274

Open josephwright opened 11 years ago

josephwright commented 11 years ago

Originally reported by: denisbitouze (Bitbucket: denisbitouze, GitHub: Unknown)


Because sidebars in some themes are only hidden and not actually canceled, plain frames are not really fillable, despite what is written in beamer's documentation, page 61. The following MCE shows a drawback of the current situation where title frame cannot be horizontally centered in plain frames with some themes (the commented code is a workaround but is tricky especially for beginners).

#!latex

\documentclass{beamer}
\usetheme{PaloAlto}
\begin{document}
% \begingroup
% \makeatletter
% \setlength{\hoffset}{-.5\beamer@sidebarwidth}
% \makeatother
\title{Foo}
\author{Bar}
\begin{frame}[plain]
\maketitle
\end{frame}
\end{document}

josephwright commented 8 years ago

Original comment by denisbitouze (Bitbucket: denisbitouze, GitHub: Unknown):


Note that % \endgroup is missing just after \end{frame}. Any chance this issue could be fixed in a near future?

dbitouze commented 6 years ago

Sigh... Already release 3.48 and this issue is still alive :(

louisstuart96 commented 6 years ago

@dbitouze This is a hard problem: The page width (\textwidth) is calculated by (\paperwidth - sidebar width left - sidebar width right) at the beginning of document. Therefore, the only way to "cancel" the sidebar is to redefine the paper size using \geometry command at the begining of a plain frame (otherwise the way of arranging frame components must be totally altered) and restore it on a normal slide. I tried a few times with this but has not succeed by now.

dbitouze commented 6 years ago

Maybe I'm wrong but wouldn't it be enough, in case of sidebar outer theme, to redefine plain frames to be preceded and followed respectively by:

\begingroup
\makeatletter
\setlength{\hoffset}{-.5\beamer@sidebarwidth}
\makeatother

and:

\endgroup
louisstuart96 commented 6 years ago

@dbitouze This way only moves the frame content. Our goal is to stretch its width to fill the whole \paperwidth. Besides, current way fails if one puts sidebar onto the right side, that is, he has to use \setlength{\hoffset}{.5\beamer@sidebarwidth}.

dbitouze commented 6 years ago

@louisstuart96 I see.

ghost commented 6 years ago

Modified from https://tex.stackexchange.com/a/198224/36296 and https://tex.stackexchange.com/a/113412/36296 the following would a) stretch the textwidth and b) only move it when necessary, e.g. when the sidebar is on the left.

    \hoffset=-\beamer@leftsidebar
    \advance\textwidth\beamer@sidebarwidth
    \hsize\textwidth
    \columnwidth\textwidth

(With this ansatz, the frametitle still needs to be adjusted, see e.g. https://tex.stackexchange.com/q/423242/36296)

dbitouze commented 6 years ago

@samcarter8 A problem remains: if the background color is changed, only a part of the extended area is colored:

\documentclass{beamer}
%
\usetheme{PaloAlto}
\setbeamercolor{background canvas}{bg=yellow!50}
%
\title{Foo}
\author{Bar}
%
\begin{document}
%
\makeatletter
\hoffset=-\beamer@leftsidebar
\advance\textwidth\beamer@sidebarwidth
\hsize\textwidth
\columnwidth\textwidth
\makeatother
%
\begin{frame}[plain]
\maketitle
\end{frame}
%
\end{document}

test

ghost commented 6 years ago

@dbitouze Like the frametitle, this would need to be repaired, but it is doable, see my updated answer to your questions at tex.se https://tex.stackexchange.com/a/423246/36296

dbitouze commented 6 years ago

Quite perfect now! :)

ghost commented 6 years ago

So we know it is doable.

But should the current behaviour be changed by default? This would probably alter many old presentation which worked around this problem in one way or another.

dbitouze commented 6 years ago

Indeed, this would break backward compatibility but, IMHO, it is an unfortunate necessity: I don't see any reason to be happy with non centered text in plain frames, especially since it is centered in case of themes without sidebars.

dbitouze commented 2 years ago

Another problem remains: that trick doesn't work with sidebar-less themes (see #755).

\documentclass{beamer}
%
% \usetheme{PaloAlto}
%
\title{Foo}
\author{Bar}
%
\begin{document}
%
\begingroup
\makeatletter
\hoffset=-\beamer@leftsidebar
\advance\textwidth\beamer@sidebarwidth
\hsize\textwidth
\columnwidth\textwidth
\makeatother
\begin{frame}[plain]
\maketitle
\end{frame}
\endgroup
\end{document}
iagobaapellaniz commented 2 years ago

I went template by template (which can appear both in plain frame and in default frame) and added something similar to this line. It does work in my case

\addtobeamertemplate{title page}{
    \ifbeamer@plainframe%
        \advance\textwidth\beamer@sidebarwidth % I only use right sidebar ... 
        \hsize\textwidth
        \columnwidth\textwidth
    \fi                 
}{}

Does it make sense?

moritzpoll commented 2 years ago

The above did not yet work for the bibliography / reference list as it works as a list and its width is set by \linewidth, so I added \linewidth\textwidth to the above.