我在框图中放入了太多信息,现在输入和输出看起来不正确。
有没有办法放置更大的箭头?另外我想知道 X(s) 和 Y(s) 是否可以离块稍远一点。
以下是框图的代码:
\begin{frame}{Desarrollo Diagrama en Bloques}
\centering
\tikzstyle{block} = [draw, fill=white, rectangle, minimum height=3em, minimum width=6em]
\tikzstyle{sum} = [draw, fill=white, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
%Declara los nodos
\node [input, name=input] {};
\node [block, right of=input] (Controller1) {$\frac{K}{s^2+s(1+[K*K_h]+K}$};
\node [output, right of=Controller1] (output) {};
%Ahora conectamos los bloques
\draw [draw,->] (input) -- node {$X(s)$} (Controller1);
\draw [->] (Controller1) -- node[name=y] {$Y(s)$}(output);
\end{tikzpicture}
\end{frame}
感谢您的帮助。
答案1
是的。基本上你必须申请评论或我之前的回答. 这样做会产生
\documentclass{beamer}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
\begin{document}
\begin{frame}
\frametitle{Desarrollo Diagrama en Bloques}
\centering
\tikzset{block/.style={draw, fill=white, rectangle,
minimum height=3em, minimum width=6em,inner xsep=1ex},
input/.style={coordinate}, output/.style={coordinate}}
\begin{tikzpicture}[auto, node distance=2cm,>=Latex] %Declara los nodos
\node [input, name=input] {};
\node [block, right=of input] (Controller1) {$\dfrac{K}{s^2+s(1+[K*K_h]+K}$};
\node [output, right=of Controller1] (output) {};
\draw [draw,->] (input) -- node {$X(s)$} (Controller1); \draw [->] (Controller1) -- node[name=y] {$Y(s)$}(output);
\end{tikzpicture}
\end{frame}
\end{document}
答案2
根据我的回答关于你之前的问题:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
calc,
positioning,
quotes}
\begin{document}
\begin{frame}[fragile]
\frametitle{Desarrollo Diagrama en Bloques}
\begin{center}
\begin{tikzpicture}[auto,
node distance = 12mm,
block/.style = {draw, minimum height=3em, minimum width=6em},
> = Latex
]
%Declara los nodos
\coordinate (input);
\node [block, right=of input] (Controller1) {$\frac{K}{s^2+s(1+[K*K_h]+K}$};
\coordinate[right=of Controller1] (output);
%Ahora conectamos los bloques
\draw [->] (input) to ["$X(s)$"] (Controller1);
\draw [->] (Controller1) to ["$Y(s)$"{name=y}] (output);
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
注意:在上面 MWE 中使用的是库中定义的节点定位语法positioning
,例如right=of <coordinate name>
,节点边界之间的距离与您使用的node distance
距离不同,节点中心之间的距离也不同。right of = ...
node distance