Graphics, Figures & Tablesdrop shadow picture

Information and discussion about graphics, figures & tables in LaTeX documents.
joehc
Posts: 9
Joined: Sat Oct 16, 2010 3:26 pm

drop shadow picture

Post by joehc »

Hey guys

I'm trying to drop shadow of a picture that i'm inserting. Really don't know how to do this...I have tried many things and searched everywhere. Can you help me?


my picure-code looks like this:

\begin{frame}
\begin{picture}(1.5,1.1)
\put(100,-220){\includegraphics[width=4cm]{billeder/aau-logo.pdf}}
\end{picture}
\end{frame}

It's beamer class

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

drop shadow picture

Post by gmedina »

Hi,

perhaps the shadows library from PGF/TikZ could be useful for you. A little example (I used a black rectangle to simulate an actual figure, but you can use the standard \includegraphics command instead to include your image):

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}

\begin{frame}
\begin{tikzpicture}
  \node[drop shadow={shadow xshift=.8ex,shadow yshift=-.8ex},fill=white,draw] at (0,0) {\rule{2cm}{2cm}};
\end{tikzpicture}
\end{frame}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
joehc
Posts: 9
Joined: Sat Oct 16, 2010 3:26 pm

Re: drop shadow picture

Post by joehc »

Thanks for your respons

I'm not that great with latex and it's beamer class

what what my code look like?
Can you make an example of my code - with your TikZ package

This is not correct is it?


\begin{frame}
\begin{tikzpicture}(1.5,1.1)
\put(90,-220){\includegraphics[drop shadow={shadow xshift=.8ex,shadow yshift=-.8ex},fill=white,draw,width=4cm]{billeder/aau-logo.pdf}}
\end{tikzpicture}

\end{frame}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

drop shadow picture

Post by gmedina »

Try something like this:

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}

\begin{frame}
\begin{tikzpicture}
  \node[drop shadow={shadow xshift=.8ex,shadow yshift=-.8ex},fill=white,draw] at (0,0) {\includegraphicswidth=4cm]{billeder/aau-logo.pdf}};
\end{tikzpicture}
\end{frame}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
joehc
Posts: 9
Joined: Sat Oct 16, 2010 3:26 pm

drop shadow picture

Post by joehc »

gmedina wrote:Try something like this:

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}

\begin{frame}
\begin{tikzpicture}
  \node[drop shadow={shadow xshift=.8ex,shadow yshift=-.8ex},fill=white,draw] at (0,0) {\includegraphicswidth=4cm]{billeder/aau-logo.pdf}};
\end{tikzpicture}
\end{frame}

\end{document}
It works, thanks! :)
But how do a implement my put-code. I would like to be able to control where I put the image on the paper.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

drop shadow picture

Post by gmedina »

Hi,

you can use the textpos package to control the position of the image:

Code: Select all

\documentclass{beamer}
\usepackage{textpos}
\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}

\begin{frame}

\begin{textblock*}{4cm}(0cm,-3cm)%modify to change the placement
\begin{tikzpicture}
\node[drop shadow={shadow xshift=.8ex,shadow yshift=-.8ex},fill=white,draw] at (0,0) {\includegraphics[width=4cm]{billeder/aau-logo.pdf}};
\end{tikzpicture}
\end{textblock*}
\end{frame}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
joehc
Posts: 9
Joined: Sat Oct 16, 2010 3:26 pm

Re: drop shadow picture

Post by joehc »

I do not get it
If I use the textblock command my picture does not show up on my paper, but latex does not give any error message. But if I outcomment the textblock the picture shows :(
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: drop shadow picture

Post by gmedina »

Reduce your code to a minimal, compilable version allowing us to reproduce the problem; post the reduced version here and attach the file aau-logo.pdf so we can reproduce the problem mentioned.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
joehc
Posts: 9
Joined: Sat Oct 16, 2010 3:26 pm

drop shadow picture

Post by joehc »

Code: Select all

\documentclass[slidestop,compress,mathserif]{beamer}

\usetheme{Copenhagen}
\usecolortheme{seahorse}	% Beamer color theme
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel} %danske overskrift
\usepackage[T1]{fontenc} % fonte (output)
\usepackage{color}
\usepackage{textpos}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}

\begin{frame}

\begin{textblock*}{10cm}(9cm,-20cm)%modify to change the placement
\begin{tikzpicture}
\node[drop shadow={shadow xshift=.8ex,shadow yshift=-.8ex},fill=white,draw] at (0,0) {\includegraphics[width=4cm]{billeder/aau-logo.pdf}};
\end{tikzpicture}
\end{textblock*}

\end{frame}

\end{document}
Attachments
aau-logo.pdf
(35.19 KiB) Downloaded 431 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

drop shadow picture

Post by gmedina »

The coordinates that you specified for \textblock* lie outside the page; use something like

Code: Select all

\begin{textblock*}{10cm}(5cm,0cm)%modify to change the placement
...
\end{textblock*}
or change the coordinates according to the position where the logo must appear, but use sensible values that correspond to some position inside the page.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply