![如何在 tikz 中制作一个不可见的矩形来划定区域并在其上写文字?](https://linux22.com/image/423269/%E5%A6%82%E4%BD%95%E5%9C%A8%20tikz%20%E4%B8%AD%E5%88%B6%E4%BD%9C%E4%B8%80%E4%B8%AA%E4%B8%8D%E5%8F%AF%E8%A7%81%E7%9A%84%E7%9F%A9%E5%BD%A2%E6%9D%A5%E5%88%92%E5%AE%9A%E5%8C%BA%E5%9F%9F%E5%B9%B6%E5%9C%A8%E5%85%B6%E4%B8%8A%E5%86%99%E6%96%87%E5%AD%97%EF%BC%9F.png)
以下是我目前得到的结果:
\begin{tikzpicture}[scale=0.8]
\draw[thick] (0,0) -- (4,0) -- (4.5,2) -- (4,4) -- node[above]{\textbf{Motivacional} }(0,4) -- (0.5,2) -- (0,0);
\draw[thick] (4.2, 0) -- (8.2, 0) -- (8.7, 2) -- (8.2, 4) -- node[above]{\textbf{Financeiro} }(4.2, 4) -- (4.7 , 2) -- (4.2, 0);
\draw[thick] (8.4, 0) -- (12.4, 0) -- (12.9, 2) -- (12.4, 4) -- node[above, yshift=1em]{\textbf{Informações} } node[above, yshift=-2]{\textbf{Privilegiadas} }(8.4, 4) -- (8.9 , 2) -- (8.4, 0);
\draw[thick] (12.6, 0) -- (16.6, 0) -- (17.1, 2) -- (16.6, 4) -- node[above, yshift=1em]{\textbf{Informações} } node[above, yshift=0.5]{\textbf{Pessoais} }(12.6, 4) -- (13.1 , 2) -- (12.6, 0);
\draw (0.7,0.2) rectangle(3.8,3.8);
\draw (4.9,0.2) rectangle(8,3.8);
\draw (9.1,0.2) rectangle(12.2,3.8);
\draw (13.3,0.2) rectangle(16.4,3.8);
\end{tikzpicture}
我怎样才能在这些矩形内写入与第一幅图像相同的文本而不实际显示它们?
答案1
对于节点我将使用signal
形状:
\documentclass[tikz, border=3.14159mm]{standalone}
\usetikzlibrary{chains,
positioning,
shapes.symbols}
\begin{document}
\begin{tikzpicture}[
node distance = 2mm,
start chain = going right,
SN/.style = {% Signal Node
shape=signal, signal from=west, signal pointer angle=120,
fill=#1, inner sep=1ex,
text width=34mm, minimum height=21mm, align=flush left,
font=\sffamily\linespread{0.84}\selectfont,
on chain},
every label/.style = {text width=24mm, align=center,
font=\large\sffamily\linespread{0.84}\selectfont}
]
\node [SN=yellow, label=some text in two lines] {\bfseries
\hfil 1993\\
Presenca Corportiva Instucional\\[2ex]
\normalfont
Pichacao, Negacao de servicos};
\node [SN=orange!30, label=some text in two lines] {\bfseries
\hfil 1995\\
Presenca Corportiva Instucional\\[2ex]
\normalfont
Pichacao, Negacao de servicos};
\node [SN=orange, label=some text in two lines] {\bfseries
\hfil 2000\\
Presenca Corportiva Instucional\\[2ex]
\normalfont
Pichacao, Negacao de servicos};
\node [SN=red, label=some text in two lines] {\bfseries
\hfil 2010\\
Presenca Corportiva Instucional\\[2ex]
\normalfont
Pichacao, Negacao de servicos};
\end{tikzpicture}
\end{document}
(在 MWE 中没有正确的文本,我把它们留给你写)