更改tikz矩阵中框的高度

更改tikz矩阵中框的高度

我想更改图像下方其中一个框的高度。正如我绘制的黑色边缘所示,我想将“revisar metodología”框放在“contraste experiments”的高度。这应该很容易,但我做不到。

以下是编辑的输入

\documentclass[handout, hyperref={pdfpagelabels=false}]{beamer}
\usetheme{Madrid} 
\let\Tiny=\tiny
\usecolortheme{whale} 
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usefonttheme{professionalfonts}  
\usenavigationsymbolstemplate{} 
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{frametitle}[default][center]
\setbeamersize{text margin left=2em,text margin right=2em}
\usepackage[export]{adjustbox}
\usepackage{graphicx}
\usepackage{chemfig} 
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta}
\usetikzlibrary{matrix}
\usepackage{ragged2e}

\AtBeginSection[]
{%
\begin{frame}
    \frametitle{Tabla de contenidos}
    \tableofcontents[currentsection]
\end{frame}
}

\begin{document}
\section{Metodología}
\subsection{Consideraciones termodinámicas}
\begin{frame}[fragile]{Title} % fragile otherwise you can't use % in matrix
\pagestyle{empty}
% Define block styles
\tikzset{% use tikzset instead of tikzstyle
    block/.style ={rectangle, draw, fill=blue!20, 
        text width=5em, text centered, rounded corners, font={\scriptsize}, minimum height=7ex},
    line/.style ={draw, -Stealth},
    cloud/.style ={draw, ellipse,fill=red!20},
}
\begin{tikzpicture}
% Place nodes
    \matrix[row sep=2ex,column sep=1em,] {% 
        \node[block] (react) {Reactantes}; \\
        \node[block] (myc) {Generar microespecies y conformeros}; &
        \node[block] (opt1) {Optimización (MOPAC)}; &
        \node[block] (solv) {Solvatación (programas)}; &
        \node[block] (opt2) {Optimización (MOPAC)}; \\
        \node[block] (metodo) {Revisar metodología}; &&&
        \node[block] (termo) {Cálculo termodinámico}; \\
        &&& \node[block] (exp) {Contraste experiental}; \\
        &&& \node[block] (decide) {¿Resultado aceptable?}; & 
        \node[ellipse, draw, fill=blue!20, font={\scriptsize}] (stop) {stop};\\
    };
    % Draw edges
    \path [line] (react) -- (myc);
    \path [line] (myc) -- (opt1);
    \path [line] (opt1) -- (solv);
    \path [line] (solv) -- (opt2);
    \path [line] (opt2) -- (termo);
    \path [line] (termo) -- (exp);
    \path [line] (exp) -- (decide);
    \path [line] (decide) -| node[near start, above, font={\scriptsize}] {no} (metodo);
    \path [line] (decide) -- node[above, font={\scriptsize}] {sí}(stop);
    \path [line] (metodo) -- (myc);
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

任何帮助都会有用。我不知道在哪里可以学到制作这样的矩阵。

答案1

只需将Revisar metodología块移动到下一行即可。

\documentclass[handout, hyperref={pdfpagelabels=false}]{beamer}
\usetheme{Madrid} 
\let\Tiny=\tiny
\usecolortheme{whale} 
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usefonttheme{professionalfonts}  
\usenavigationsymbolstemplate{} 
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{frametitle}[default][center]
\setbeamersize{text margin left=2em,text margin right=2em}
\usepackage[export]{adjustbox}
\usepackage{graphicx}
\usepackage{chemfig} 
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta}
\usetikzlibrary{matrix}
\usepackage{ragged2e}

\AtBeginSection[]
{%
\begin{frame}
    \frametitle{Tabla de contenidos}
    \tableofcontents[currentsection]
\end{frame}
}

\begin{document}
\section{Metodología}
\subsection{Consideraciones termodinámicas}
\begin{frame}[fragile]{Title} % fragile otherwise you can't use % in matrix
\pagestyle{empty}
% Define block styles
\tikzset{% use tikzset instead of tikzstyle
    block/.style ={rectangle, draw, fill=blue!20, 
        text width=5em, text centered, rounded corners, font={\scriptsize}, minimum height=7ex},
    line/.style ={draw, -Stealth},
    cloud/.style ={draw, ellipse,fill=red!20},
}
\begin{tikzpicture}
% Place nodes
    \matrix[row sep=2ex,column sep=1em,] {% 
        \node[block] (react) {Reactantes}; \\
        \node[block] (myc) {Generar microespecies y conformeros}; &
        \node[block] (opt1) {Optimización (MOPAC)}; &
        \node[block] (solv) {Solvatación (programas)}; &
        \node[block] (opt2) {Optimización (MOPAC)}; \\
         &&&
        \node[block] (termo) {Cálculo termodinámico}; \\
        \node[block,fill=red!20] (metodo) {Revisar metodología};&&& 
        \node[block] (exp) {Contraste experiental}; \\
        &&& \node[block] (decide) {¿Resultado aceptable?}; & 
        \node[ellipse, draw, fill=blue!20, font={\scriptsize}] (stop) {stop};\\
    };
    % Draw edges
    \path [line] (react) -- (myc);
    \path [line] (myc) -- (opt1);
    \path [line] (opt1) -- (solv);
    \path [line] (solv) -- (opt2);
    \path [line] (opt2) -- (termo);
    \path [line] (termo) -- (exp);
    \path [line] (exp) -- (decide);
    \path [line] (decide) -| node[near start, above, font={\scriptsize}] {no} (metodo);
    \path [line] (decide) -- node[above, font={\scriptsize}] {sí}(stop);
    \path [line] (metodo) -- (myc);
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

相关内容