1

I add the following code to my paper in order to draw a tree. All was ok but the tree is overlap on the second column of the paper, please how can insert it to take one column or eveb to be in two column without overlapop with the text.

    \documentclass[letterpaper, 10 pt, conference]{ieeeconf}           \IEEEoverridecommandlockouts                              
  \usepackage{tikz}
\newtheorem{definition}{\textbf{Definition}}
\overrideIEEEmargins
\usepackage{booktabs,lipsum,makecell}
\usetikzlibrary{arrows,shapes,positioning,shadows,trees}
\tikzset{
  basic/.style  = {draw, text width=2cm, drop shadow, font=\sffamily, rectangle},
  root/.style   = {basic, rounded corners=2pt, thin, align=center,
                   fill=green!30},
  level 2/.style = {basic, rounded corners=6pt, thin,align=center, fill=green!60,
                   text width=8em},
  level 3/.style = {basic, thin, align=left, fill=pink!60, text width=6.5em}
}
\title{\LARGE \bf
Test
}
\begin{document}
\maketitle
\thispagestyle{empty}
\pagestyle{empty}
\section{test}
bvkxvkxk lsjlfdjl ljsfjlsj lsjljl jljljl ljljl ljl jlj ljljl jljlj ljljlj lj ljl ljljlj l bvkxvkxk lsjlfdjl ljsfjlsj lsjljl jljljl ljljl ljl jlj ljljl jljlj ljljlj lj ljl ljljlj l
\begin{tikzpicture}[
  level 1/.style={sibling distance=40mm},
  edge from parent/.style={->,draw},
  >=latex]

% root of the the initial tree, level 1
\node[root] {Drawing diagrams}
% The first level, as children of the initial tree
  child {node[level 2] (c1) {Defining node and arrow styles}}
  child {node[level 2] (c2) {Positioning the nodes}}
  child {node[level 2] (c3) {Drawing arrows between nodes}};

% The second level, relatively positioned nodes
\begin{scope}[every node/.style={level 3}]
\node [below of = c1, xshift=15pt] (c11) {Setting shape};
\node [below of = c11] (c12) {Choosing color};
\node [below of = c12] (c13) {Adding shading};

\node [below of = c2, xshift=15pt] (c21) {Using a Matrix};
\node [below of = c21] (c22) {Relatively};
\node [below of = c22] (c23) {Absolutely};
\node [below of = c23] (c24) {Using overlays};

\node [below of = c3, xshift=15pt] (c31) {Default arrows};
\node [below of = c31] (c32) {Arrow library};
\node [below of = c32] (c33) {Resizing tips};
\node [below of = c33] (c34) {Shortening};
\node [below of = c34] (c35) {Bending};
\end{scope}

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

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

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

\end{document}
  • from your code snipped this is not visible, result is just fine :-). to help yoi, you should extend your code sniped to complete, but small document, which show your problem. welcome to tex.se! – Zarko Feb 9 '18 at 17:54
  • @Zarko, i dont know how to add a complete example cause when i need a lot of text to reproduce the problem. But if can please: i have a paper of two column. When i insert the code above it will be insreted in left column and overlap the text in the second coumn. so can just prevent that – user2869180 Feb 9 '18 at 18:36
  • @bib, strip down your document and left some text, the best emulate with lipsum package and your image. that is. in preamble left only relevant packages for image. – Zarko Feb 9 '18 at 18:43
  • @Zarko, i modified the example above please check – user2869180 Feb 9 '18 at 19:06
  • @Zarko, i modified the original question, please check – user2869180 Feb 9 '18 at 19:09
0

after tweaking your mwe (changes are indicaed in code by % <--- ...):

\documentclass[conference]{ieeeconf}
%\IEEEoverridecommandlockouts
%\overrideIEEEmargins
\usepackage{tikz}
\usetikzlibrary{arrows, positioning, shadows}

\usepackage{lipsum}

\title{Test}

\begin{document}
\maketitle
\thispagestyle{empty}

\section{test}
\lipsum*[11]% <--- added for dummy text
    \begin{table}[ht]
    \centering
\begin{tikzpicture}[
node distance = 3mm and 0mm, % <--- added
  basic/.style  = {draw, drop shadow, text width=18mm, inner xsep=2pt,
                   font=\sffamily\footnotesize}, % <-- changed
  root/.style   = {basic, rounded corners=2pt, align=center, fill=green!30},
 level 2/.style = {basic, rounded corners=6pt, align=center, fill=green!60,
                   text width=22mm}, <-- changed
 level 3/.style = {basic, align=left, fill=pink!60, text width=20mm}, <-- changed
sibling distance=27mm, <-- changed
edge from parent/.style={-latex,draw},
                    ]
% root of the initial tree, level 1
\node[root] {Drawing diagrams}
% The first level, as children of the initial tree
  child {node[level 2] (c1) {Defining node and arrow styles}}
  child {node[level 2] (c2) {Positioning the nodes}}
  child {node[level 2] (c3) {Drawing arrows between nodes}};

% The second level, relatively positioned nodes
\begin{scope}[every node/.style={level 3}] % <--- corrected positioning syntax
\node [below=of c1, xshift=5pt] (c11) {Setting shape};
\node [below=of c11] (c12) {Choosing color};
\node [below=of c12] (c13) {Adding shading};

\node [below=of c2, xshift=5pt] (c21) {Using a Matrix};
\node [below=of c21] (c22) {Relatively};
\node [below=of c22] (c23) {Absolutely};
\node [below=of c23] (c24) {Using overlays};

\node [below=of c3, xshift=5pt] (c31) {Default arrows};
\node [below=of c31] (c32) {Arrow library};
\node [below=of c32] (c33) {Resizing tips};
\node [below=of c33] (c34) {Shortening};
\node [below=of c34] (c35) {Bending};
\end{scope}

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

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

\foreach \value in {1,...,5}
  \draw[->] (c3.195) |- (c3\value.west);
\end{tikzpicture}
\caption{diagram}
    \end{table}
\lipsum[1-23] % <--- added for dummy text
\end{document}

i obtain the following result:

enter image description here

  • @bib, you are welcome! happy tex-ing! – Zarko Feb 9 '18 at 19:43

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.