0

I am preparing some slides for a lab meeting, and I am using mainly beamer/metropolis. I need to add a logo at top right corner of the frametitle to fit my lab standards. So I used the command \addtobeamertemplate{frametitle}.

But to fit with the corner I have to overfull margins. And since it is on every slide it yields a large number of warnings. For example, here is a MWE:

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[aspectratio=169, 10pt]{beamer}

    \usetheme{metropolis}
    \metroset{numbering=fraction,}
    \addtobeamertemplate{frametitle}{}{\vspace*{-1.5em}\hspace*{+0.86\paperwidth}LOGO}
    
\begin{document}        
    \begin{frame}
        \frametitle{title of an empty frame}
        
        empty.
    \end{frame}
\end{document}

which gives me the following warning:

Overfull \hbox (28.00511pt too wide) in paragraph at lines 12--12

I would like to suppress (or resolve) these warning and keeping the warning if I have other overfull occurring. Of course, a good manner to handle this would be to reduce the hspace to \hspace*{+0.79\paperwidth} but the result is too far from what I need to obtained.

So it there a way to remove this warnings only locally (or solve them but I don't think so) ?

1

As far as I can tell you want to flush right but overlapping a fixed amount (25pt) past the allowed space. Using \fill rather than a fixed left margin allows it to easily adapt to different length texts.

enter image description here

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[aspectratio=169, 10pt]{beamer}

    \usetheme{metropolis}
    \metroset{numbering=fraction,}
    \addtobeamertemplate{frametitle}{}{\vspace*{-1.5em}\hspace*{\fill}LLLLOGO\hspace{-25pt}\mbox{}}
    
\begin{document}        
    \begin{frame}
        \frametitle{title of an empty frame}
        
        empty.
    \end{frame}
\end{document}
2
  • I would never though about removing 25pt and use a mbox !
    – R. N
    Sep 13 at 14:56
  • @R.N adding the negative space is the natural thing to try to make something overlap but it did nothing which means that somewhere in the beamer theme most likely something is doing \unskip to remove trailing white space (as tabular does in all cells) so the \mbox{} is just to guard the hspace from being removed. Sep 13 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.