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 have the following problem.

enter image description here

As you see, the last nodes have a height that shrink the arrows. I want to fix the size of the arrows moving the nodes down. How can I do that?

This is a example of my code.

%% LyX 2.1.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[14pt,spanish]{extarticle}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Ubuntu}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{tikz}
\usepackage{textgreek}
\usepackage{mhchem}
\usepackage{gensymb}

\usetikzlibrary{shapes.geometric, arrows}

\tikzstyle{inicio} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=yellow]
\tikzstyle{nodo} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black]
\tikzstyle{arrow} = [thick,->,>=stealth]
\tikzstyle{centerzero} = [trim left=0pt,trim right=0pt]

\makeatother

\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}

\usepackage{xunicode}
\begin{document}


\begin{center}
\begin{tikzpicture}[node distance=2cm, centerzero]
    \node (crecimiento) [inicio] {Crecimiento de la biomasa};

    \node (luz) [nodo, below of=crecimiento, xshift=-3cm] {Luz}; \draw [arrow] (crecimiento) -- (luz);
    \node (oscuridad) [nodo, below of=crecimiento, xshift=3cm] {Oscuridad}; \draw [arrow] (crecimiento) -- (oscuridad);

    \node (alto) [nodo, below of=luz] {Alto crecimiento}; \draw [arrow] (luz) -- (alto);
    \node (bajo) [nodo, below of=oscuridad] {Bajo crecimiento}; \draw [arrow] (oscuridad) -- (bajo);

    \node (bc1-alto) [nodo, below of=alto, xshift=-2cm, text width=2cm] {BC1: 150 a 470 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc1-alto);
    \node (bc2-alto) [nodo, below of=alto, xshift=2cm, text width=2cm] {BC2: 1500 a 1620 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc2-alto);


\end{tikzpicture}
\par\end{center}
\end{document}
share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

Use positioning library and use below = of... syntax over below=of

%% LyX 2.1.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[14pt,spanish]{extarticle}
%\usepackage{fontspec}
%\setmainfont[Mapping=tex-text]{Ubuntu}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{tikz}
\usepackage{textgreek}
\usepackage{mhchem}
\usepackage{gensymb}

\usetikzlibrary{shapes.geometric, arrows,positioning}

\tikzstyle{inicio} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=yellow]
\tikzstyle{nodo} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black]
\tikzstyle{arrow} = [thick,->,>=stealth]
\tikzstyle{centerzero} = [trim left=0pt,trim right=0pt]

\makeatother

\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}

%\usepackage{xunicode}
\begin{document}


\begin{center}
\begin{tikzpicture}[node distance=2cm, centerzero,anchor=north]
    \node (crecimiento) [inicio] {Crecimiento de la biomasa};

    \node (luz) [nodo, below = of crecimiento, xshift=-3cm] {Luz}; \draw [arrow] (crecimiento) -- (luz);
    \node (oscuridad) [nodo, below = of crecimiento, xshift=3cm] {Oscuridad}; \draw [arrow] (crecimiento) -- (oscuridad);

    \node (alto) [nodo, below = of luz] {Alto crecimiento}; \draw [arrow] (luz) -- (alto);
    \node (bajo) [nodo, below =of oscuridad] {Bajo crecimiento}; \draw [arrow] (oscuridad) -- (bajo);

    \node (bc1-alto) [nodo, below = of alto, xshift=-2cm, text width=2cm] {BC1: 150 a 470 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc1-alto);
    \node (bc2-alto) [nodo, below = of alto, xshift=2cm, text width=2cm] {BC2: 1500 a 1620 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc2-alto);


\end{tikzpicture}
\par\end{center}
\end{document}

enter image description here

Also, it is better to use tilzset instead of `tikzstyle which is deprecated.

\tikzset{inicio/.style = {rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=yellow},
           nodo/.style = {rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black},
}
share|improve this answer
add comment

Use yshift with negative value within the node option.

\node (bc1-alto) [nodo, below of=alto, xshift=-2cm,yshift=-1cm, text width=2cm] {BC1: 150 a 470 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc1-alto);
\node (bc2-alto) [nodo, below of=alto, xshift=2cm,yshift=-1cm, text width=2cm] {BC2: 1500 a 1620 mg SSl\textsuperscript{-1}}; \draw [arrow] (alto) -- (bc2-alto);

enter image description here

share|improve this answer
add comment

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.