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 using textpos to position text blocks in a beamer frame. However, the textblock environment does not seem to respect overlay commands. In the following example, I want "some more text" to be invisible on the first slide and visible on the second. However, when I compile the document, it is visible on both slides. How can I make it invisible on the first slide?

\documentclass{beamer}

\usepackage[overlay,absolute]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

\begin{document}

\begin{frame}
Some text

  \visible<2->{
        \begin{textblock}{5}(6,6)
            Some more text
        \end{textblock}
          }
\end{frame}

\end{document}

Edit: Both of the answers that have been given so far are quite useful, and I am not sure which one to accept. On one hand, CyberSingularity's answer allows me to use multiple textblock environments with a single overlay command, while Paul Gaborit's answer would require a different overlay command for each textblock. On the other hand, Paul Gaborit's answer allows me to use the \visible command. I prefer \visible to \only, since, as cyberSingularity noted, \visible reserves the amount of space that it needs.

share|improve this question
2  
You can put your call to \visible into your textblock environment. –  Paul Gaborit Nov 5 '12 at 10:54
    
Thanks to [this answer}(tex.stackexchange.com/a/83654/13034), I'm OK with the idea of using an \overlayarea in combination with \only commands. So, I've decided to accept @cyberSingularity's answer. –  Andrew Uzzell Nov 22 '12 at 10:21
add comment

2 Answers

up vote 9 down vote accepted

It works as expected if you use \only instead of \visible:

\documentclass{beamer}

\usepackage[overlay,absolute]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

\begin{document}

\begin{frame}
Some text

  \only<2->{
        \begin{textblock}{5}(6,6)
            Some more text
        \end{textblock}
          }
\end{frame}

\end{document}
share|improve this answer
    
Why does one work and not the other? –  Andrew Uzzell Nov 5 '12 at 11:20
    
@AndrewUzzell: \visible takes up space on the slides where the content is not shown, whereas \only does not. In order to work out the amount of space that needs to be reserved, I presume that \visible actually typesets its argument in all cases, but just doesn't show the result. When the content has side-effects like eg \addtocounter, the side-effects are retained. The textblock environment presumably also works via a side-effect. –  cyberSingularity Nov 5 '12 at 11:38
1  
To add to what cyberSingularity has said, \visible works by changing the colour (actually, the transparency) of its text. Presumably the textblock environment either ignores or overrides this (whether by accident or design). –  Andrew Stacey Nov 5 '12 at 13:05
    
@AndrewStacey: and when normal text is set in invisible/transparent mode, it is not selectable/searchable by PDF viewers. I think all of this could be better explained in the beamer manual than currently. –  cyberSingularity Nov 5 '12 at 13:20
add comment

It works as expected if you call \visible into your textpos environment:

\documentclass{beamer}

\usepackage[overlay,absolute]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}

\begin{document}

\begin{frame}
  Some text

  \begin{textblock}{5}(6,6)
    \visible<2->{
      Some more text
    }
  \end{textblock}
\end{frame}

\end{document}
share|improve this answer
    
great! your solution is better, because \visible avoids jumping elements. when I used \only, elements are re-arranged when new element appears. –  damluar Feb 4 '13 at 22:54
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.