2

How can I prevent the new line indicated in the picture below?

enter image description here

Here is a MWE:

\documentclass[svgnames,9pt]{beamer}
\usepackage[latin1]{inputenc}
\usetheme{Warsaw}
\setbeamertemplate{headline}{}
\setbeamerfont{footline}{size=\fontsize{6}{8}\selectfont}
\makeatletter
\setbeamertemplate{frametitle}
{%
  \nointerlineskip%
  \vskip-2pt%
  \hbox{\leavevmode
    \advance\beamer@leftmargin by -12bp%
    \advance\beamer@rightmargin by -12bp%
    \beamer@tempdim=\textwidth%
    \advance\beamer@tempdim by \beamer@leftmargin%
    \advance\beamer@tempdim by \beamer@rightmargin%
    \hskip-\Gm@lmargin\hbox{%
      \setbox\beamer@tempbox=\hbox{\begin{minipage}[b]{\paperwidth}%
          \vbox{}\vskip.50ex% NEW: original \vskip-.75ex
          \leftskip0.3cm%
          \rightskip0.3cm plus1fil\leavevmode
          \insertframetitle%
          \ifx\insertframesubtitle\@empty%
            \strut\par%
          \else
            \par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par\vskip2ex}% NEW: added \vskip2ex
          \fi%
          \nointerlineskip
          \vbox{}%
          \end{minipage}}%
      \beamer@tempdim=\ht\beamer@tempbox%
      \advance\beamer@tempdim by 2pt%
      \begin{pgfpicture}{0pt}{0pt}{\paperwidth}{\beamer@tempdim}
        \usebeamercolor{frametitle right}
        \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
        \pgfusepath{clip}
        \pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
      \end{pgfpicture}
      \hskip-\paperwidth%
      \box\beamer@tempbox%
    }%
    \hskip-\Gm@rmargin%
  }%
  \nointerlineskip
    \vskip-0.2pt
    \hbox to\textwidth{\hskip-\Gm@lmargin\pgfuseshading{beamer@topshade}\hskip-\Gm@rmargin}
    \vskip-2pt
}
\makeatother
\addtobeamertemplate{frametitle}{\vspace*{0.5cm}}{\vspace*{0.5cm}}


\title[short title]{\huge \textbf{Long Title}}
\author[Me]{}
\date{}

\begin{document}
\begin{frame}

\begin{figure}[h!]
   \includegraphics[scale=0.2]{../Thesis/images/Logo_Unisi_2012.jpg}
\end{figure}

\begin{center}      
\begin{minipage}[b]{0.5\textwidth}
    \centering
    University of Siena\\Master Thesis in Computer Science Engineering
\end{minipage}%
\end{center}

\titlepage

\begin{minipage}[t]{0.5\textwidth}
    \vspace{-2cm}
    \begin{flushleft}
        { \textit{Author}:\vspace*{0.1cm} \\ Me }
    \end{flushleft}
\end{minipage}%
        %
\begin{minipage}[t]{0.5\textwidth}
    \vspace{-2cm}
    \begin{flushright}
        {\textit{Supervisor}:\vspace*{0.1cm} \\ Prof. Him \\}
    \end{flushright}    
\end{minipage}%

\vspace{-0.7cm}
\begin{center}      
\begin{minipage}[b]{0.5\textwidth}
    \centering  
    \small  
    December 10, 2012\\Academic Year 2011/2012
\end{minipage}%
\end{center}    

\end{frame}
\end{document}
Matteo
  • 1,787
  • Sorry, but I don't understand why you don't customize the title page with the apposite title page template. An example: How to customize \titlepage in beamer?. BTW: you might be interested in an italian guide called Introduzione alla personalizzazione di Beamer. – Claudio Fiandrino Dec 04 '12 at 11:19
  • @ClaudioFiandrino - I just wanted to use my personal layout, is it such a bad habit doing it this way?.thks for pointing out the tutorial. – Matteo Dec 04 '12 at 11:22
  • @ClaudioFiandrino - BTW, I used the \mbox{} command and the line will not be broken, however it is not centred (even though I put the \centering command). How can I solve the problem? – Matteo Dec 04 '12 at 11:24
  • Have you tried with Master Thesis in Computer Science~Engineering? – Claudio Fiandrino Dec 04 '12 at 11:26
  • @ClaudioFiandrino - yes, but it produced the following effect: Master Thesis in Computer\\Science Engineering. (I put \ where the new line occurs) – Matteo Dec 04 '12 at 11:30
  • Personally, I think it is better to create a new theme, even starting by a default one, by logically dividing things into inner, outer, color and font theme. This helps a lot in keeping the code clean. But, in the current case you solve your problem by simply increasing the width of the minipage: for example from 0.5\textwidth up to 0.6\textwidth. – Claudio Fiandrino Dec 04 '12 at 11:47

1 Answers1

8

Change

\begin{minipage}[b]{0.5\textwidth}
    \centering
    University of Siena\\Master Thesis in Computer Science Engineering
\end{minipage}%

to

\begin{minipage}[b]{0.7\textwidth}
    \centering
    University of Siena\\Master Thesis in Computer Science Engineering
\end{minipage}%

as you do not want to force the title to fit into half the page width.

David Carlisle
  • 757,742