Attached is the code to draw a simple tree.
I wish to get the NEGF node
to appear in a middle location between the "west"
of the \node {Without Illumination}
, and "east
" of the {Geometric}
node. I want this centering to happen just on the x axis
while with the y axis
I want it to appear "below "
the {-QTBM} \node
.
The issue is twofold:
- I am trying the
\x1
with let command but the compiler fails with the message:
- I am trying the
"No shape named 0 is known"
only when I try to introduce a more complecated mathematical expression no matter I try curly brackets, paranthese, I use 0.5*, 1/2,...
if I want to center between both x values.
- If I went with a simplified version and just wanted functionality to the righmost x (NEGFr) in my coordinates, it does not appear at the exact location in the plot. The code in its current status runs with no errors but just introducing more complecated math as above breaks it.
What am I doing wrong here? & Many thanks in advance for your help N.B: Please excuse any bad coding experience here as I am completely new to these LaTeX, TikZ things
\documentclass{article}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{trees,positioning, graphs, calc}
\begin{document}
\tikz [font=\footnotesize, grow=down,
level 1/.style={sibling distance=2.6cm},
level 2/.style={sibling distance=2.5cm}, level distance=1cm]{
\node [align =center](TOO){Theory of\\Operation } % root
child { node {Tunnelling}
child { coordinate (NEGFl) node [align=center](NI) {Without \\Illumination}}
child {node [align=center](I) {Under\\ Illumination}}
}
child { coordinate (NEGFr) node (Geo) {Geometric}
}
child { node {Hybrid}
}
;% This comma is for the parent \node DON'T REMOVE
% Now we list all the nodes down of each tree branch
\node[below right][inner sep = 0.4, minimum height =0.6cm] at (NI.south west)(Simmons){-Simmons};
\node[below right][inner sep = 0.4, minimum height =0.6cm] at (Simmons.south west)(Sanchez){-Sanchez};
\node[below right][inner sep = 0.4, minimum height =0.8cm] at (Sanchez.south west)(TMM){-TMM};
\node[below right][inner sep = 0.4, minimum height =0.6cm] at (TMM.south west)(QTBM){-QTBM};
%\node[below right][inner sep = 0.4, minimum height =0.6cm, minimum width =10pt, fit = (NEGFl)(NEGFr)] at (QTBM.south west)(NEGF){-NEGF};
% Now let's list the nodes below the "With Illumination" option
\node[below right][inner sep = 0.4, minimum height =0.6cm] at (I.south west)(PAT){-PAT};
\node[below right][inner sep = 0.4, minimum height =0.6cm] at (PAT.south west)(Floquet){-Floquet};
\node[below right][inner sep = 0.4, minimum height =0.6cm] at (Floquet.south west)(Mayer){-Mayer};
\path
let
\p1 = ($(NEGFr)$),
\p2 = ($(NEGFl)$)
in
node (NEGF) at (\x1,\y1) [below, draw] {{$\x1$}}; %<=== where mistakes come from
;
%Now let's put some explanatory text around
%Hint: You can use below above, right, left,... OR use anchor = east, west,...
%Single insulator models text
\node [below left, rotate=270, inner sep = 0cm, align= center, text width =1.5cm] at (Sanchez.south west)(Ss){\tiny Single barrier insulator};
%Multi insulator text
\node [below right, rotate=270, inner sep = 0cm, align= center, text width =2cm] at (Sanchez.south west)(Ms){\tiny Single \& multi barrier insulator};
%Draw dashed line to separate between single & Multi insulator models
\draw [dashed] (Ss.south east) -- ($(Sanchez.south east) + (0.5cm, 0)$);
} %This bracket closes the \tikz command
\end{document}
\x1
calculation (which is by the way seems to be wrong)? you like know some length value?\p2
, but only the value ofx
from\p1
.