Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm try to customize a beamer theme with some additional text and logos. I added some pictures already and everything looks fine. Now I want to add a three line text in the head of a presentation. I changed my outer theme and added a beamercolorbox. I want to have something like:

          some text  ============
    some other text  =   LOGO   =
and again some text  ============

I added a beamercolorbox with the logo. Now I have some issues with the multiline text. If I do something like:

\begin{beamercolortext}[<options>]{<color>}
      line 1 \\
      line 2 \\
      line 3
\end{beamercolorbox}

I will just get a text in one line which looks like line 1 , line 2 , line 3. If I replace the \\ by \newline then I will get three lines. The problem is that I can't change the spacing. If I do \vspace{} then I shift the whole text and the space between the two lines doesn't change.

Is there a better way to add this three lines, maybe something beside beamercolorbox?

EDIT

Well. I using the beamercolorbox in a definition of an outer theme.

\defbeamertemplate*{headline}{split theme}
{%
  \leavevmode%
  \@tempdimb=10.7ex%
  %\@tempdimb=2.4375ex%
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 0ex%
    %\advance\@tempdimb by 1.125ex%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb,left]{section in     head/foot}%
      \hspace{1em}\vspace{0.7ex}\pgfuseimage{tu-logo}
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb,right]{section in   head/foot}%
      \begin{beamercolorbox}[wd=.2\paperwidth,ht=\@tempdimb,right]{title}
        test \\
        test \\
        test
      \end{beamercolorbox}
      \vspace{0.7ex}\pgfuseimage{iwm-logo}\hspace{1em}
     \end{beamercolorbox}
  \fi%
}

It's close to what is defined in the Warsaw theme. Please don't take the definition of spaces to serious. It's just an example and I wanted to make it work before I define all the spaces. My result for the following code will give me something like -- in the top right corner:problem

share|improve this question
    
At my test: \documentclass{beamer} \begin{document} \begin{frame} \frametitle{Test} \begin{beamercolorbox}[right]{title in head/foot} First \ Second \ Third \end{beamercolorbox} \end{frame} \end{document} it does work, so maybe can you show a MWE? –  Schweinebacke Nov 17 '11 at 11:11
    
While this is still not a MWE, I haven't make any additional tests. But AFAIK beamer redefines \\ at headline. Maybe adding \raggedleft after start of beamercolorbox would help. –  Schweinebacke Nov 17 '11 at 11:49
    
I added a few things. It's not a real MWE, but I hope it's fine. If I use inside the document the beamercolorbox environment, then everything is fine. The thing just happen inside the definition of the outer theme –  PateToni Nov 17 '11 at 11:51
    
\raggedleft have the same effect as \newline. It's still without any spacing. Do you know how to add additional spacing? –  PateToni Nov 17 '11 at 11:54
    
There may be many other suggestions, but it would be nice, if I could test them. –  Schweinebacke Nov 17 '11 at 11:56

1 Answer 1

In places, where multi-line text doesn't work, you could try \parbox.

Also here it works with \\ if you would put the contents into a parbox. Alternatively, you could use \newline instead of \\. However, if you use \\ inside the parbox, you could specify optional spacing, such as \\[2pt].

Another approach is using a simple table in that box in the header, with adjusted \arraystretch value if desired, such as by

\begin{tabular}{@{}r@{}}

In all cases, increase the height of the beamercolorbox, this means the parameter ht in the argument of the beamercolorbox environment.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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