TransWikia.com

Split beamer and alignment

TeX - LaTeX Asked on December 26, 2020

I’m using this beamer theme and I want to change the title page in something like this where both text and image are vertically and horizontally centered in their minipage:

enter image description here

I tried the following code but far away from the result:

setbeamertemplate{title page}
{
    begin{minipage}[t][0.7textheight][t]{textwidth}
        topskip0pt
        vspace*{fill}
            centering
            huge TITLE
        vspace*{fill}
    end{minipage}

    nointerlineskip
    colorbox{green}{begin{minipage}[b][0.3textheight][t]{textwidth}
        begin{minipage}[t]{0.48linewidth}
            vspace*{fill}
                small Author: 
                large Scot Shaw 
                small Advisor: 
                large Eric Heller 
            vspace*{fill}
        end{minipage}
        begin{minipage}[t]{0.48linewidth}
            includegraphics[scale = 0.3]{example-image}
        end{minipage}
    end{minipage}
    }
}

Any ideas on how I can do that?

One Answer

I propose a solution based on the nice package xcoffin.

As I explained earlier I found many advantages using xcoffin for cover design, title page and similar tasks, when the problem is typeset graphic material, tables or text in precise places of the page and/or relative positions between them. Please see my answer to Create a box using the tcolorbox package or any other? (image)

This case is solved using five coffins. The BGframe will serve as a framework for the title, and be inserted (typeset) at the text insertion point. The Greenframe will hold the credits and the logo.

I added a sixth coffin (a possible subtitle) to illustrate the vertical displacement.

The logo is in the logox coffin. The credits are in the credits coffin. The title is defined as a vertical coffin so multiple lines are allowed.

First we join the titlex (and the subtitle) to the BGframe, centered both vertically and horizontally.

Next we join the coffin credits left-side-bottom to the left-side-bottom of Greenframe. The coffin logox right-side-bottom is joined to the right-side-bottom of the Greenframe. I added a 2ex margin around.

At last the BGframe and the Greenframe are joined.

Finally BGframe is typeset. In this case BGframe has to be right shifted 3.845mm to compensate the default text margin left as defined by the UiB template.

The code is simple and (almost) auto documented: 6 settings, 5 joins, 1 typeset. In any case the reference manual of xcoffin is well written and short. Only few commands are provided and fewer are needed for the common tasks.

I tested the solution using the UiB-example.tex provided by the package. You might need to tweak the solution to balance the size of the coffins credits and logox, the proper margins, etc.

NOTE Since I am using LuaLaTeX I commented the line 12 of the UiB theme: %RequirePackage[utf8]{inputenx}.

setbeamertemplate{title page}
{%
    NewCoffinBGframe
    NewCoffinGreenframe
    NewCoffincredits
    NewCoffintitlex
    NewCoffinsubtitlex
    NewCoffinlogox    

    SetHorizontalCoffinBGframe{color{white}rule{paperwidth}{0.7paperheight}}
    SetHorizontalCoffinGreenframe{color{green}rule{paperwidth}{0.3paperheight}}

    SetVerticalCoffincredits{textwidth}{%
        small Author: 
        large Scot Shaw 
        small Advisor: 
        large Eric Heller 
    }

    SetVerticalCoffintitlex{textwidth}{centeringhuge Beamer example}
    SetVerticalCoffinsubtitlex{textwidth}{centering large Usage of the theme texttt{UiB} }
    SetHorizontalCoffinlogox{includegraphics[scale=0.25]{example-image}}

    JoinCoffins*BGframe[hc,vc]titlex[hc,vc] %title centered in frame
    JoinCoffins*BGframe[hc,vc]subtitlex[hc,vc](0pt,-2baselineskip) % vspace from title

    JoinCoffins*Greenframe[l,vc]credits[l,vc](2ex,0ex) % some margins around
JoinCoffins*Greenframe[r,vc]logox[r,vc](-2ex,0ex)  % some margins around

    JoinCoffinsBGframe[hc,b]Greenframe[hc,t] %join the two rules, no * to get the full paperheight

    TypesetCoffinBGframe(-3.845mm,0pt) %default text margin left from UiB template
}

xcoffin_solution

Answered by Simon Dispa on December 26, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP