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 slide with a figure in it. I want show a vertically and horizontally centered (relative to the image if possible) text box overtop of it as an overlay which will contain a few lines of text.

alt text

\documentclass{beamer}
\usepackage[T1]{fontenc}

\begin{document}

\begin{frame}
    \frametitle{ESR1} 

    \begin{center}
        Functional analysis
    \end{center}

    \begin{center}
        \includegraphics[width=1\textwidth]{some_image.jpg}
    \end{center}
\end{frame}
\end{document}
share|improve this question

2 Answers 2

up vote 7 down vote accepted

Basically, the same solution as in your last question works: just put the image inside a TikZ node and you can position anything on top of it wherever you want.

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\begin{document}

\begin{frame}
    \frametitle{\emph{Mycena interrupta}} 

    \begin{center}
        Known as the Pixies' parasol.
    \end{center}

    \begin{center}
        \begin{tikzpicture}
            \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=1\textheight]{some_image.jpg}};
            \node[align=center,red,font={\Huge\bfseries}] at (image.center) {Do NOT eat\\these!};
        \end{tikzpicture}
    \end{center}
\end{frame}
\end{document}

example

(Actually, I have no idea whether they are dangerous; the Wikipedia article is rather short and I don't know anything about mushrooms ­­­­— this was just the first nice picture I found on Wikimedia Commons.)

Image attribution: Wikimedia Commons, JJ Harrison.

share|improve this answer
    
+1 for the mushroom fact disclaimer lol –  asia1281 Mar 6 '12 at 16:48

I use the casper image just for a trivial purpose.

alt text

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{pstricks}


\newdimen\ImageW
\ImageW=8cm

\newdimen\ImageH
\ImageH=6cm

\fboxrule=0pt
\begin{document}

\begin{frame}[t]{ESR1} 

    \begin{center}
        Functional analysis
    \end{center}

    \begin{center}
      \pspicture(\ImageW,\ImageH)
        \rput(0.5\ImageW,0.5\ImageH){\includegraphics[width=\ImageW]{CasperFunny}}
        \rput[c](0.5\ImageW,0.75\ImageH)%
        {\fbox{\parbox{6cm}{\color{red}\Huge\bf\centering la la la la la! Casper the friendly ghost}}}      
        \endpspicture
    \end{center}

\end{frame}
\end{document}
share|improve this answer

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.