我尝试在文本矩形的右侧放置一个箭头,但不起作用。以下是我所得到的:
\documentclass[compress,blue]{beamer}
\mode<presentation>
\usetheme{Warsaw}
\definecolor{azure}{RGB}{74,100,217}
\useoutertheme[subsection=false]{smoothbars}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{shapes.misc, fit, arrows}
\usetikzlibrary{shapes.callouts, shapes.symbols}
\tikzset{product size/.style={minimum width=1cm,
minimum height=1cm,
text height=1ex,
},
product/.style={
draw,signal,
signal to=east,
signal from=west,
product size,
fill=azure,
draw=gray!50!white,
text=white,
},
}
\begin{document}
\frame{\frametitle{test...}
\begin{tikzpicture}
\node (1-t) at (10,12.2) [draw, minimum width=6cm,minimum height=1.2cm, text width=5.8cm, inner sep = 1pt] {She sells seashells by the seashore,};
\node (2-t) at (10,10.5) [draw, minimum width=6cm,minimum height=1.2cm, text width=5.8cm] {shells she sells are sure seashells,};
\node (3-t) at (10,8.7) [draw, minimum width=6cm,minimum height=1.2cm, text width=5.8cm] {so if she sells shells on the seashore,};
\node (4-t) at (10,6.9) [draw, minimum width=6cm,minimum height=1.2cm, text width=5.8cm] {I am sure she sells seashore shells.};
\node[product] (map) at (10, 12) {Input};
\end{tikzpicture}
}
\end{document}
我该如何定位箭头?
答案1
请参阅以下解决方案:
\documentclass[compress,blue]{beamer}
\mode<presentation>
\usetheme{Warsaw}
\definecolor{azure}{RGB}{74,100,217}
\useoutertheme[subsection=false]{smoothbars}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{calc, chains, positioning, shapes}
\tikzset{product size/.style={minimum width=1cm,
minimum height=1cm,
text height=1ex,
},
product/.style={
draw,signal,
signal to=east,
signal from=west,
product size,
fill=azure,
draw=gray!50!white,
text=white,
},
}
\begin{document}
\frame{\frametitle{test...}
\begin{tikzpicture}[
node distance = 3mm and 10 mm,
start chain = going below,
box/.style = {draw, minimum height=1.2 cm, text width=5.9cm,
on chain}
]
\node (1-t) [box] {She sells seashells by the seashore,};
\node (2-t) [box] {shells she sells are sure seashells,};
\node (3-t) [box] {so if she sells shells on the seashore,};
\node (4-t) [box] {I am sure she sells seashore shells.};
%
\node[product, right=of $(1-t.east)!0.5!(4-t.east)$] (map) {Input};
\end{tikzpicture}
}
\end{document}
我尝试使用两个 TikZ 库稍微优化您的代码:calc
和\chains
。positioning
得到的结果是: