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 have a beamer presentation with several TikZ diagrams that spread across the entire frame, i.e., use the full screen size. I am using the overlay option to make sure the picture captures the entire frame:

\begin{tikzpicture}[overlay, remember picture]
  ...
\end{tikzpicture}

The problem is that these diagrams are messed up on the notes pages, that can't align them properly.

Is there a way to make a TikZ picture spread across the full page? I tried using a node that is as large as the entire frame, but it was displayed with some margin between it and the top and left edges of the frame.

Edit

When not using an overlay or background template, the result is shifted to the right:

\begin{frame}
  \begin{tikzpicture}
    \node[minimum width=\paperwidth, minimum height=\paperheight, anchor=north west] (a) {};
    \draw [very thick] (a.north west) -- (a.south east);
    \draw [very thick] (a.north east) -- (a.south west);
  \end{tikzpicture}
\end{frame}

The X is not on from the corners

share|improve this question
    
It would probably help if you could include a minimal example that shows how you include the node. If you say \node at (current page.north west) [anchor=north west] {...};, there shouldn't be a gap. –  Jake Jan 17 '12 at 8:50
    
@Jake I'd have to look in the manual to be sure (gosh, I'm lazy) but I think that to use the current page node then you have to use overlay. –  Andrew Stacey Jan 17 '12 at 9:22
    
@AndrewStacey: From the code snippet, it seems Little Bobby Tables uses overlay for his tikzpicture. –  Jake Jan 17 '12 at 9:36
    
Yes, but he wants to get rid of it (at least, that's my understanding of the problem). –  Andrew Stacey Jan 17 '12 at 9:50
    
Just looked. The pgf manual says that both overlay and remember picture have to be specified to use the current page node. –  Andrew Stacey Jan 17 '12 at 9:57
show 7 more comments

2 Answers

up vote 5 down vote accepted

If you wrap your tikzpicture in \makebox[\textwidth][c]{...}, the picture will be properly centered and stretch across the whole width.

\documentclass{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}
 \makebox[\textwidth][c]{\begin{tikzpicture}
    \node[minimum width=\paperwidth, minimum height=\paperheight, anchor=north west] (a) {};
    \draw [very thick] (a.north west) -- (a.south east);
    \draw [very thick] (a.north east) -- (a.south west);
  \end{tikzpicture}
  }
\end{frame}

\end{document}
share|improve this answer
    
That seems to work. I'll try it around a bit, I'm concerned that the \makebox command might be too fragile to handle complex pictures. If not, that's a solution. –  Little Bobby Tables Jan 17 '12 at 12:35
add comment

Here you have two options, second is what Jake suggested and first was taken from How to insert a background image in a beamer frame?

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{graphicx}

\begin{document}

{
\usebackgroundtemplate{%
\begin{tikzpicture}
\node[draw,very thick,minimum width=\paperwidth-\pgflinewidth,minimum height=\paperheight-\pgflinewidth] [anchor=north west] (mynode) {My node};
\draw (mynode.north west)--(mynode.south east);
\draw (mynode.south west)--(mynode.north east);
\end{tikzpicture}
}
\begin{frame}{Frame with background}
\begin{itemize}
\item 1
\item 2
\item 3
\end{itemize}
\end{frame}
}

\begin{frame}{Frame with overlay picture}
\begin{tikzpicture}[overlay, remember picture]
\node[draw,very thick,minimum width=\paperwidth-\pgflinewidth,minimum height=\paperheight-\pgflinewidth] at (current page.north west) [anchor=north west] (mynode) {My node};
\draw (mynode.north west)--(mynode.south east);
\draw (mynode.south west)--(mynode.north east);
\end{tikzpicture}
\begin{itemize}
\item 1
\item 2
\item 3
\end{itemize}
\end{frame}
\end{document}

enter image description here

EDIT

From beamer user guide 8.2 Frame and Margin Sizes

Aside from using these options, you should refrain from changing the “paper size.” However, you can change the size of the left and right margins, which default to 1cm. To change them, you should use the following command: \setbeamersize{⟨options⟩}

The following ⟨options⟩ can be given:

  • text margin left=⟨TEX dimension⟩ sets a new left margin. This excludes the left sidebar. Thus, it is the distance between the right edge of the left sidebar and the left edge of the text.

The problem is that this command is only valid in the preamble, so it changes all presentation margins. Here you have a new example:

\documentclass{beamer}
\usepackage{tikz}
\setbeamersize{text margin left=0pt}
\begin{document}
\begin{frame}
  \begin{tikzpicture}
    \node[minimum width=\paperwidth, minimum height=\paperheight, anchor=north west] (a) {};
    \draw [very thick] (a.north west) -- (a.south east);
    \draw [very thick] (a.north east) -- (a.south west);
  \end{tikzpicture}
\end{frame}
\end{document}

and its result

enter image description here

share|improve this answer
    
This is what I want, but it works only as an overlay or a background. In default mode the node is shifted, probably because of the margins. See my edit. –  Little Bobby Tables Jan 17 '12 at 12:22
    
@LittleBobbyTables: I've edited my answer, is it better now? –  Ignasi Jan 17 '12 at 16:53
    
It's good to know, but the problem is that it indeed affects the entire presentation. –  Little Bobby Tables Jan 18 '12 at 6:35
    
@LittleBobbyTables: I've tested with 'adjustwidth` from changepage and it's possible to suppress left margin but a top margin appears. –  Ignasi Jan 18 '12 at 9:56
add comment

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.