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 am creating a beamer presentation. I have following tikz flow chart. The problem is the chart appears to be cluttered and is not accomodated on a single slide.

Here is the code

\documentclass[12pt,a4paper]{beamer}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{lmodern}
\usetheme{CambridgeUS}
\usefonttheme{professionalfonts}
\usepackage{tikz}
%\usetheme{AnnArbor}
\author{Dr Vaibhav Banait}
\title{Dysphagia - a serious symptom}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Dysphagia}
\begin{center}

% Define block styles
\tikzstyle{block} = [rectangle, draw, fill=blue!20, 
    text width=5em, text centered, rounded corners, minimum height=4em]

\begin{tikzpicture}[scale=0.15, node distance=2cm, auto]
    % Place nodes
    \node [] (Dysphagia) {Food sticks in chest after swallowing};
    \node [ below of=Dysphagia] (Esophageal){Esophageal dysphagia};
   \node [ below left  of=Esophageal] (Mechanical) {Solids only };
 \node [ below of = Mechanical](Mechanical1){Mechanical};
    \node [ below left of =Mechanical1](Intermittent){Intermittent};
    \node [ below right of =Mechanical1](Progressive){Progressive};
    \node [ below left of =Progressive](heartburn){Chronic heart burn};
\node [below of=heartburn](peptic){Peptic stricture};
\node[below right of =Progressive](age){Age more than50};
   \node[below of =age](ca){Ca Esophagus }; 
\node [below of =Intermittent](Web){Esophageal web };
\node [below right of=Esophageal](Solidliquids){Solid and liquids=motor };

\node[below right of =Solidliquids](Intermittent1){Intermittent };
\node[below left of =Solidliquids](Progressive1){Progressive};
\node [below of =Intermittent1](chestpain){Chest Pain};
\node [below of =chestpain ](DES){Diffuse esophageal spasm};
\node [below left of = Progressive1](heartburn1){Chronic heart burn};
\node [below of =heartburn1](scleroderma){Scleroderma};
\node [below right of = Progressive1](resp){Respiratory symptoms};
\node[below of =resp](achalasia){achalasia};
    % Draw edges
 \path [draw] (Dysphagia)--(Esophageal);
\path [draw] (Esophageal)--(Mechanical);
\path[draw](Esophageal)--(Solidliquids);
\path[draw](Mechanical)--(Mechanical1);
\path[draw](Mechanical1)--(Progressive);
\path[draw](Mechanical1)--(Intermittent);
\path[draw](Progressive)--(heartburn);
\path[draw](Progressive)--(age);
\path[draw](heartburn)--(peptic);
\path[draw](age)--(ca);
\path[draw](Intermittent)--(Web);
\path[draw](Solidliquids)--(Intermittent1);
\path[draw](Solidliquids)--(Progressive1);
\path[draw](Intermittent1)--(chestpain);
\path[draw](Intermittent1)--(DES);
\path[draw](Progressive1)--(resp);
\path[draw](resp)--(achalasia);
\path[draw](Progressive1)--(heartburn1);
\path[draw](heartburn1)--(scleroderma);
   % \path [line] (Vaibhav) -- (Vibhor);

\end{tikzpicture}




\end{center}


\end{frame}

\end{document}
share|improve this question
    
Welcome to the site, user34083. Have a look at Chapter 11.6: Special Syntax for Specifying Trees in the TikZ/PGF manual. –  John Wickerson Jul 24 '13 at 5:52
3  
You can scale the flow chart to adapt it to the slide's size; a general answer with some references is Scaling tikz mindmaps within a beamer frame while a specific answer for flow charts is Messy flowchart using tikz. –  Claudio Fiandrino Jul 24 '13 at 6:26

1 Answer 1

up vote 6 down vote accepted

As John wickerson commented, your flow graph is a tree. forest is a package designed to easily type and draw this kind of trees. But, because this tree is to large to fit inside a frame you can use \resizebox command to adjust it to your slide.

\documentclass[12pt,a4paper]{beamer}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{lmodern}
\usetheme{CambridgeUS}
\usefonttheme{professionalfonts}
\usepackage{tikz}
%\usetheme{AnnArbor}
\author{Dr Vaibhav Banait}
\title{Dysphagia - a serious symptom}
\usepackage{forest}
\begin{document}
\begin{frame}
\maketitle
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Dysphagia}

\centering

\resizebox{\textwidth}{.8\textheight}{
\begin{forest}
    [Food sticks in chest after swallowing
        [Esophageal dysphagia
            [Solids only 
           [Mechanical
            [Intermittent
                    [Esophageal web]]
            [Progressive
                [Chronic heart burn
                        [Peptic stricture]]
                    [Age more than50
                       [Ca Esophagus]]]]]
            [Solid and liquids=motor
                [Intermittent 
                    [Chest Pain]
                    [Diffuse esophageal spasm]]
                [Progressive
                    [Respiratory symptoms
                        [achalasia]]
                [Chronic heart burn
                        [Scleroderma]]]]]]
\end{forest}
}
\end{frame}
\end{document}

enter image description here

share|improve this answer
    
was there no way the tikz package rendered the tree correctly –  user34083 Jul 24 '13 at 11:41
    
@user34083: I'm not sure about your comment. If it means that you want to use some TikZ command on your tree, forest is based on TikZ so you can use tikzstyles , nodes, path, ... Please, take a look a forest manual (just type texdoc forest on your command line) or search for forest in TeX.SX. –  Ignasi Jul 24 '13 at 11:53
    
forest sty does not appear to be standard latex package. How can I install on ubuntu? It does not appear to be a part of writelatex sharelatex monkeylatex-online services either. –  user34083 Jul 24 '13 at 13:41
    
@user34083 I use MikTeX on windows, so I cannot help you to much but you can start with how-do-i-install-an-individual-package-on-a-linux-system‌​. –  Ignasi Jul 25 '13 at 8:26

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.