1

I am trying to generate my own title page for my beamer, I treid the follwong:

\documentclass[11pt]{beamer}
\usetheme{Madrid}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}


\begin{document}
\begin{frame}{}
\begin{tikzpicture} 
\fill[blue!20!black] (-7,1) rectangle (7,6);
 \fill[blue!25] (-7,1) rectangle (7,-0.5);
\fill[white,opacity=.3] (-7,-0.5) rectangle (7,-4);
\node[ ] at (-6,2) {{\textcolor{white}{\Huge{  }}}};
\node[ ] at (-6,0.5) { };
\node[ ] at (-6,-1.5) { };    
%\node[] at (4.2,4.9) {\includegraphics[scale=0.4]{ }};
\end{tikzpicture}
\end{frame}
\end{document}  

The problem is that the fiildraw are not covering the whole slide, they are a bit shifted to the left, whatever I change their coordinates, whereas I want them to cover the whole slide. Even more, when I change the titles in the nodes (above I keep them empty) the filldraw shifts more to the left.

Can someon help me solve thi sproblem.

Thank you in advance.

2
  • Use an overlay picture, e.g. \begin{frame}[plain] \begin{tikzpicture}[overlay,remember picture] \fill[blue!20!black] (current page.north west) rectangle ([yshift=-5.5cm]current page.north east); \fill[blue!25]([yshift=-5.5cm]current page.north west) rectangle ([yshift=-7cm]current page.north east); \fill[white,opacity=.3] ([yshift=-1.5cm]current page.north west) rectangle ([yshift=-5cm]current page.north east); \node[anchor=north west,font=\Huge,text=white] at ([yshift=-3cm,xshift=1cm]current page.north west) {Blub}; \end{tikzpicture} \end{frame} – user194703 Feb 13 '20 at 20:10
  • @Schrödinger'scat Thank you very much for your comment, Ithink if you post it as an answer it will be great. One more thing, I am new to tikz, so I am not sure what would "anchor" and "xshift, yshift" do, can you propose a guide for this ? – Nizar Feb 14 '20 at 5:09
3

If you wish to fill a page or do something relative to page coordinate, you may want to use the current page node. To access its anchors (like north, west, south east and so on), you need to dial the overlay,remember picture keys. Then you can draw objects using these page anchors. For instance,

\fill[blue!20!black](current page.north west)
        rectangle ([yshift=-5.5cm]current page.north east);

fills a rectangle defined by two corners: the upper left corner of the page/frame and the point 5.5cm below the upper right corner of the page/frame. That is, yshift=<distance> means "shift the y coordinate by distance". xshift works analogously.

\documentclass[11pt]{beamer}
\usetheme{Madrid}
\usepackage{amsmath}
\usepackage{tikz}


\begin{document}
\begin{frame}[plain]
\begin{tikzpicture}[overlay,remember picture]
 \fill[blue!20!black](current page.north west)
        rectangle ([yshift=-5.5cm]current page.north east);
 \fill[blue!25]([yshift=-5.5cm]current page.north west)
        rectangle ([yshift=-7cm]current page.north east);
 \fill[white,opacity=.3] ([yshift=-1.5cm]current page.north west)
    rectangle ([yshift=-5cm]current page.north east);
 \node[anchor=north west,font=\Huge,text=white] at
  ([yshift=-3cm,xshift=1cm]current page.north west)
  {Blub};
 \end{tikzpicture}
\end{frame}
\end{document} 

enter image description here

If you wish to remove the navigation symbols on the lower right, you may use \beamertemplatenavigationsymbolsempty. And graphicx does already get loaded by beamer and tikz, you do not need to load it separately. samcarter is at topanswers.xyz kindly informed me that beamer loads amsfonts and amssymb, and that with an up-to-date \usepackage[utf8]{inputenc} is also unnecessary.

1
  • @ user194703 how do I write on the Madrid theme using overlay, remember picture – js bibra Jul 14 '20 at 10:14

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.