0

I have an official logo, which has white background and much margins around. So the logo does not look good without trimming at the top-left corner of Berkley theme in Beamer. Code

\documentclass{beamer}

\usepackage{graphics}
\usepackage{adjustbox}

\usetheme{Berkeley} 
\logo{
% llx lly urx ury
\adjustbox{trim=0.2\width{} 0.1\height{} 0.2\width{} 0.1\height{}, clip, height=1.2\textheight{}}{
\includegraphics[height=1cm]{logo.png}
}
}

\begin{document}
\begin{frame}
\begin{titlepage}
Leo Leopold Hertz. 
\end{titlepage}
\end{frame}
\end{document}

Fig. 1 Logo example, Fig. 2 Output of the code

enter image description here enter image description here

Testing samcarter's answer with random image

I try to auto-adjust width and height of the image but I cannot get it to work

% http://tex.stackexchange.com/a/215317/13173
\includegraphics[trim=5.3cm 0.2cm 5cm 1.2cm,clip, width=\beamer@sidebarwidth,height=\beamer@headheight]{logo.p‌​ng}

Final proposal which works

\includegraphics[trim=5.3cm 0.2cm 5cm 1.2cm,clip, height=\headheight, width=\headheight]{logo.p‌​ng}

OS: Debian 8.5
TeXLive: 2016

  • 1
    So what exactly is the question? – user36296 Dec 30 '16 at 13:47
  • If you want trim/clip included graphics (as your logo), use the trim and clip options of \includegraphics. The adjustbox package provides options to clip or trim LaTeX mateial. – Paul Gaborit Dec 30 '16 at 14:44
  • @LéoLéopoldHertz준영 Here are examples. – Paul Gaborit Dec 30 '16 at 14:48
  • 1
    @LéoLéopoldHertz준영 Did you try to use trim and clip options of \includegraphics? If so, what is the problem? – Paul Gaborit Dec 30 '16 at 17:50
3

I still have no idea, what your intended output should look like, so this is just a guess:

\documentclass{beamer}

\usetheme{Berkeley} 

\logo{%
    \includegraphics[trim=5.3cm 0.2cm 5cm 1.2cm, clip, height=\headheight]{logo.png}%
}

\begin{document}
\begin{frame}
\begin{titlepage}
Leo Leopold Hertz. 
\end{titlepage}
\end{frame}
\end{document}

enter image description here

  • @LéoLéopoldHertz준영 Why would you want that? – user36296 Dec 31 '16 at 14:07
  • Yes, this works height=\headheight, width=\headheight. – Léo Léopold Hertz 준영 Dec 31 '16 at 16:50

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.