我正在制作一个 Beamer 演示文稿。我有以下 tikz 流程图。问题是图表看起来很混乱,无法放在一张幻灯片上。
以下是代码
\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}
答案1
正如约翰·威克森 (John wickerson) 评论的那样,你的flow graph
是一个tree
。forest
是一个用于轻松输入和绘制此类树木的软件包。但是,由于这棵树太大,无法放入框架中,因此您可以使用\resizebox
命令将其调整到幻灯片中。
\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}