10

I want to run this slide in beamer. I tried lot of things but always getting the errors for package clashes.

\documentclass{beamer}

\usetheme{AnnArbor}
\usecolortheme{beaver}

\setbeamercolor*{palette tertiary}{use=structure,fg=black,bg=blue}

\mode<presentation>
\usepackage{setspace}
\usepackage{nicefrac}
\usepackage{xcolor}
\usepackage{float}
\usepackage{breqn}
\usepackage{tikz}
\usepackage{indentfirst}
\usepackage{bibentry} 
\usepackage{color}
\usetikzlibrary{matrix}
\usepackage{apacite}
\usepackage{color}
\usepackage{graphicx}
\usepackage{comment}
\usepackage{hyperref}
\usepackage {xcolor}
\usepackage{graphicx,epsfig,setspace,subfig,url,amsmath}
\usepackage{indentfirst}
\usepackage{listings}
\usepackage{array}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{enumerate}
\usepackage[english]{babel}
\usepackage{booktabs}
\usepackage{etex}
\usepackage[all]{xypic}
\usepackage{color}
\usepackage[english]{babel}
\usepackage{enumerate}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{bm}
\renewcommand{\familydefault}{\sfdefault}

% New packages


%\setbeamertemplate{itemize item}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}
\setbeamertemplate{itemize subitem}{\tiny\raise1.5pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.
     \begin{frame}
    \begin{figure}[H]
    \tikzset{
      basic/.style  = {draw, text width=2cm, drop shadow,  rectangle},
      root/.style   = {basic, thin, align=center,
                   fill=gray!45 , text width=7em},
      level 2/.style = {basic, thin,align=center, fill=gray!30,
                   text width=7em},
      level 3/.style = {basic, thin, align=left, fill=gray!20, text width=7em, node distance = 40pt}
    }
    \begin{tikzpicture}[
      level 1/.style={sibling distance=40mm},
      edge from parent/.style={->,draw},
      >=latex]

    % root of the the initial tree, level 1
    \node[root] {BRD1 ($\alpha_{..},\beta_{..}$)}
    % The first level, as children of the initial tree
      child {node[level 2] (c1) {$(\alpha_{..},\beta_{i.})$}}
      child {node[level 2] (c2) {$ (\alpha_{.j},\beta_{..})$}}
      child {node[level 2] (c3) { $(\alpha_{..},\beta_{.j})$}}
      child {node[level 2] (c4) { $(\alpha_{i.},\beta_{..})$}};

    % The second level, relatively positioned nodes
    \begin{scope}[every node/.style={level 3}]
    \node [below of = c1, xshift=20pt] (c11) { $(\alpha_{i.},\beta_{i.})$};
    \node [below of = c11 ] (c12) {BRD9 $(\alpha_{.j},\beta_{i.})$};
    %\node [below of = c12] (c13) {$(\alpha_{..},\beta_{i.})$};

    \node [below of = c2, xshift=20pt] (c21) { $(\alpha_{.j},\beta_{.j})$};
    \node [below of = c21 ] (c22) {BRD9 $(\alpha_{.j},\beta_{i.})$};

    \node [below of = c3, xshift=20pt] (c31) { $(\alpha_{.j},\beta_{.j})$};
    \node [below of = c31 ] (c32) {BRD8 $(\alpha_{i.},\beta_{.j})$};

    \node [below of = c4, xshift=20pt] (c41) { $(\alpha_{i.},\beta_{i.})$};
    \node [below of = c41 ] (c42) { $(\alpha_{i.},\beta_{.j})$};

    %\node [below of = c2, yshift=-15pt, xshift=10pt] (c21) {Membership driven Re-Keying};
    %\node [below of = c21] (c22) {Time driven Re-Keying};

    %\node [below of = c3, xshift=15pt] (c31) {Ring-based Cooperation};
    %\node [below of = c31] (c32) {Hierarchical Cooperation};
    %\node [below of = c32] (c33) {Broadcast Cooperation};
    \end{scope}

    % lines from each level 1 node to every one of its "children"
    \foreach \value in {1,2}
      \draw[->] (c1.195) |- (c1\value.west);

    \foreach \value in {1,2}
      \draw[->] (c2.195) |- (c2\value.west);

    \foreach \value in {1,2}
      \draw[->] (c3.195) |- (c3\value.west);
    \foreach \value in {1,2}
      \draw[->] (c4.195) |- (c4\value.west);

    \end{tikzpicture}\\
    %\caption{Schematic Presentation of BRD models~\citep{Jansen05} } 
    \end{figure}
    \end{frame}
\end{document}
2
  • Please make this in to a complete document demonstrating the problem, so we can see which packages you are loading already. – Andrew Swann Nov 13 '13 at 12:45
  • What Andrew mentioned is a minimal working example (MWE). – masu Nov 13 '13 at 12:56
10

Your tikz code needs the shadows library, so you should add

\usetikzlibrary{shadows}

to your preamble. The error message produce says thet drop shadow is not known. Looking up drop shadow in the pgfmanual, e.g. via texdoc pgfmanual or texdoc tikz shows that it is part of the shadows library.

Now you need to adjust the size of your diagram...EDIT: I give one way to do this reducing a number of the fixed horizontal parameters you had:

Sample output

\documentclass{beamer}

\usetheme{AnnArbor}
\usecolortheme{beaver}

\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}

\begin{frame}
  \begin{figure}[H]
    \tikzset{
      basic/.style  = {draw, text width=5em, drop shadow,  rectangle},
      root/.style   = {basic, thin, align=center,
                   fill=gray!45 , text width=5em},
      level 2/.style = {basic, thin,align=center, fill=gray!30,
                   text width=5em},
      level 3/.style = {basic, thin, align=left, fill=gray!20, text
      width=5em, node distance = 40pt} 
    }
    \begin{tikzpicture}[
      level 1/.style={sibling distance=30mm},
      edge from parent/.style={->,draw},
      >=latex]

    % root of the the initial tree, level 1
    \node[root] {BRD1 ($\alpha_{..},\beta_{..}$)}
    % The first level, as children of the initial tree
      child {node[level 2] (c1) {$(\alpha_{..},\beta_{i.})$}}
      child {node[level 2] (c2) {$ (\alpha_{.j},\beta_{..})$}}
      child {node[level 2] (c3) { $(\alpha_{..},\beta_{.j})$}}
      child {node[level 2] (c4) { $(\alpha_{i.},\beta_{..})$}};

    % The second level, relatively positioned nodes
    \begin{scope}[every node/.style={level 3}]
    \node [below of = c1, xshift=10pt] (c11) { $(\alpha_{i.},\beta_{i.})$};
    \node [below of = c11 ] (c12) {BRD9 $(\alpha_{.j},\beta_{i.})$};
    %\node [below of = c12] (c13) {$(\alpha_{..},\beta_{i.})$};

    \node [below of = c2, xshift=10pt] (c21) { $(\alpha_{.j},\beta_{.j})$};
    \node [below of = c21 ] (c22) {BRD9 $(\alpha_{.j},\beta_{i.})$};

    \node [below of = c3, xshift=10pt] (c31) { $(\alpha_{.j},\beta_{.j})$};
    \node [below of = c31 ] (c32) {BRD8 $(\alpha_{i.},\beta_{.j})$};

    \node [below of = c4, xshift=10pt] (c41) { $(\alpha_{i.},\beta_{i.})$};
    \node [below of = c41 ] (c42) { $(\alpha_{i.},\beta_{.j})$};

    %\node [below of = c2, yshift=-15pt, xshift=10pt] (c21) {Membership driven Re-Keying};
    %\node [below of = c21] (c22) {Time driven Re-Keying};

    %\node [below of = c3, xshift=15pt] (c31) {Ring-based Cooperation};
    %\node [below of = c31] (c32) {Hierarchical Cooperation};
    %\node [below of = c32] (c33) {Broadcast Cooperation};
    \end{scope}

    % lines from each level 1 node to every one of its "children"
    \foreach \value in {1,2}
      \draw[->] (c1.195) |- (c1\value.west);

    \foreach \value in {1,2}
      \draw[->] (c2.195) |- (c2\value.west);

    \foreach \value in {1,2}
      \draw[->] (c3.195) |- (c3\value.west);
    \foreach \value in {1,2}
      \draw[->] (c4.195) |- (c4\value.west);

    \end{tikzpicture}\\
    %\caption{Schematic Presentation of BRD models~\citep{Jansen05} } 
    \end{figure}
    \end{frame}
\end{document}
2
  • You guys are the best....I was also just wondering is it possible to write this code in another file and compile it with my original ongoing file ? I am having a huge code for my presentation and I want to write these codes in another file but still compile it with my original one – user35571 Nov 13 '13 at 13:11
  • 2
    You can always put in a file file.tex and say \input{file.tex}. See also the standalone package. – Andrew Swann Nov 13 '13 at 13:35

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.