向左移动绘制

向左移动绘制

我需要将画向左移动一点

\begin{flushleft}

\begin{tikzpicture}[inner sep=7pt,node distance=.8cm,every text node part/.style={align=center}]
\tikzstyle{block} = [rectangle, draw, fill=orange!30, 
    text width=10em, text centered, rounded corners, minimum height=4em]

% Draw rectangular nodes (switch sharp to smooth for different corners)
\node[draw,minimum height = 1cm, minimum width = 1cm, ] (state0){Lecture hall A} ;
\node[draw,below=1cm of state0, minimum height = 1cm, minimum width = 1cm](state2){ Female students };
\node[draw,right=.5cm of state0, minimum height = 1cm, minimum width = 1cm](state1){Lecture hall A };
\node[draw,below=1cm of state1, minimum height = 1cm, minimum width = 1cm](state3){Male students};
width = 1cm](state2){ Female students };
\node[draw,right=2cm of state3, minimum height = 1cm, minimum
width = 1cm](state4){ Female students };
\node[draw,right=1cm of state4, minimum height = 1cm, minimum width = 1cm](state5){Male students};
\node [block, right=3cm of state1] (state6) {Lecture hall A};
%Blank node for positioning
\node[right=2em of state1](blank){};
\node[single arrow, draw=black, fill=black!25, minimum height=4em, below=0.9em of blank](arrow){};

%Draw arrows
\draw[-triangle 60] (state0) -- (state2) node [midway, above, left = 0.1cm]{};

\draw[-triangle 60] (state1) -- (state3) node [midway, above, right = 0.1cm]{};

\draw[-triangle 60] (state6) -- (state4) node [midway, above, right = 0.1cm]{};
\draw[-triangle 60] (state6) -- (state5) node [midway, above, right = 0.1cm]{};


\end{tikzpicture}
\end{flushleft}!

在此处输入图片描述

答案1

请以可编译的形式发布您的代码,以便我们不需要猜测哪个键属于哪个库。

对于这个问题,trim <left/right>键接受尺寸。

\documentclass{article}
\usepackage{kantlipsum} 
\usepackage{tikz}
\usetikzlibrary{positioning,arrows,shapes.arrows}
\begin{document}
\kant[1]
\begin{tikzpicture}[
inner sep=7pt,node distance=.8cm,
every text node part/.style={align=center},
block/.style={rectangle, draw, fill=orange!30,text width=10em, text centered, rounded corners, minimum height=4em},
trim left=2cm % <================== ADDED ================
]
\node[draw,minimum height = 1cm, minimum width = 1cm, ] (state0){Lecture hall A} ;
\node[draw,below=1cm of state0, minimum height = 1cm, minimum width = 1cm](state2){ Female students };
\node[draw,right=.5cm of state0, minimum height = 1cm, minimum width = 1cm](state1){Lecture hall A };
\node[draw,below=1cm of state1, minimum height = 1cm, minimum width = 1cm](state3){Male students};
\node[draw,right=2cm of state3, minimum height = 1cm, minimum width = 1cm](state4){ Female students };
\node[draw,right=1cm of state4, minimum height = 1cm, minimum width = 1cm](state5){Male students};
\node [block, right=3cm of state1] (state6) {Lecture hall A};
\node[right=2em of state1](blank){};
\node[single arrow, draw=black, fill=black!25, minimum height=4em, below=0.9em of blank](arrow){};
\draw[-triangle 60] (state0) -- (state2) node [midway, above, left = 0.1cm]{};
\draw[-triangle 60] (state1) -- (state3) node [midway, above, right = 0.1cm]{};
\draw[-triangle 60] (state6) -- (state4) node [midway, above, right = 0.1cm]{};
\draw[-triangle 60] (state6) -- (state5) node [midway, above, right = 0.1cm]{};
\end{tikzpicture}
\kant[2]
\end{document}

在此处输入图片描述

相关内容