TransWikia.com

Latex beamer - Split frame horizontally - get rid of top margin

TeX - LaTeX Asked by Pol Dellaiera on April 1, 2021

I’m trying to make my first LaTeX beamer theme. This theme will be open-sourced.

In order to promote and foster the adoption of LaTeX, I would like to provide a couple of pre-made and ready-to-use "frames", having specific layouts.

I have created a file "frames.tex" which is included in my main file.

I’m trying to create 4 basic frame layouts A, B, C and D.

The layout A will be a frame horizontally split in 2, with an image on the top, and text on the bottom. The image must take the full width of the page and the height must be half of the page.
The Layout B will be the same, but the text on the top and the image on the bottom.

The layout C will be a frame vertically split in 2, with an image on the left, and text on the right. The image must take the full height of the page and the width must be half of the page.
The Layout D will be the same, but the text on the left and the image on the right.

So far, I almost succeeded to get the A and C (B and D are not yet done) layout working using this code:

NewEnviron{FrameA}[3][]{%
    begin{frame}
        begin{columns}
            column{paperwidth}
                includegraphics[width=thepaperwidth, height=.5paperheight]{src/afup/style/logo/bg1}
            begin{tikzpicture}
                node[shape=rectangle, text opacity=1,minimum height=.5paperheight, minimum width=paperwidth, anchor=south]{
                    BODY
                };
            end{tikzpicture}
        end{columns}
    end{frame}
}

NewEnviron{FrameC}[3][]{%
    begin{frame}
        begin{columns}
            column{.5paperwidth}
                includegraphics[width=.5paperwidth, height=paperheight]{src/afup/style/logo/bg1}
            column{.5paperwidth}
                begin{tikzpicture}
                    node[shape=rectangle, text opacity=1,minimum height=paperheight, minimum width=.5paperwidth, anchor=east]{
                        BODY
                    };
                end{tikzpicture}
        end{columns}
    end{frame}
}

The main tex file (I removed the non-relevant parts) is:

documentclass{beamer}

input{frames}

begin{document}

begin{FrameA}
    Some text here
end{FrameA}

begin{FrameB}
    Some text here
end{FrameB}

end{document}

The resulting PDF for the frameA is: https://imgur.com/TTryy63

The resulting PDF for the frameC is: https://imgur.com/JNy0PC9

Now my question is: How can I get rid of the tiny margin on the top of the page?

I tried many things, but I couldn’t get over it.

Could you help?

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