我有当前的设计
\begin{tikzpicture}
\def\longitudUno{2}
\def\longitudDos{3.6}
\def\pico{0.25}
\def\altura{0.5}
\def\separación{\longitudUno+0.08}
\draw [azulPalido,fill=azulPalido,line width=0pt,xshift=6.05cm] (0,0) -- (0,\altura) -- (\longitudUno,\altura)-- (\longitudUno+\pico,\altura/2) -- (\longitudUno,0) -- cycle;
\draw [azulOscuro,fill=azulOscuro,line width=0pt,xshift=6.05cm] (\separación,0) -- (\separación+\longitudDos,0) -- (\separación+\longitudDos+\pico,\altura/2) -- (\separación+\longitudDos,\altura) -- (\separación,\altura) -- (\separación+\pico,\altura/2) -- cycle;
\node[text=white,font=\bfseries,] at (7.1,0.25){Business};
\node[text=white,font=\bfseries,] at (10.1,0.25){Ireland bailout};
\end{tikzpicture}
画
就像你在报纸上看到的那样http://www.theguardian.com/business/2011/apr/03/irish-property-going-for-a-song
但是,对于这种设计,我必须手动放置文本并指定框长度(变量“经度”)以及元素的位置,而没有任何锚点可能性。有什么方法可以改善这种情况吗?也许使用自定义节点形状?
答案1
感谢@Claudio Fiandrino 的评论
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\tikzset{product size/.style={minimum width=2cm,
minimum height=0.5cm,
},
product/.style={
draw,signal,
signal to=east,
signal from=west,
product size,
fill=gray!50!black,
draw=gray!50!white,
text=white,font=\bfseries,
},
otroproduct/.style={
draw,signal,
signal to=east,
%signal from=west,
product size,
fill=gray!50!black,
draw=gray!50!white,
text=white,font=\bfseries,
},
}
\definecolor{azulPalido}{RGB}{74,100,217}
\definecolor{azulOscuro}{RGB}{35,49,120}
\begin{tikzpicture}
\node[otroproduct,fill=azulPalido, draw=white] (first) {Business};
\node[product, fill=azulOscuro, draw = white, anchor=west] at (first.east){Ireland bailout};
\end{tikzpicture}
\end{document}
这是最终结果: