![Tikz 在基线上的定位](https://linux22.com/image/268013/Tikz%20%E5%9C%A8%E5%9F%BA%E7%BA%BF%E4%B8%8A%E7%9A%84%E5%AE%9A%E4%BD%8D.png)
我有以下一段代码
\begin{tikzpicture}
[mainbullet/.style={rectangle, minimum size=0.3cm,draw=orange!100, fill=orange!100,thick}, %
maintitle/.style={rectangle,opacity= 0.5}, %
date/.style={black, opacity=0.5}]
\tikz[baseline=(experiencetitle.base)]{%
\node[mainbullet] (experiencebullet) at (0,-23) {}; %
\node[maintitle](experiencetitle)[right =10mm of experiencebullet]{Experience};
\node(experiencedesc1)[below= 5mm of experiencetitle] {Experience};
\node[date](date1)[left=15mm of experiencedesc1]{1999-2000};}
\end{tikzpicture}
\end{document}
我希望experiencetitle
和experiencebullet
在其基线上对齐。上面显示的代码似乎根据矩形中心(节点experiencebullet
)而不是其基线对齐它们,我不明白为什么。
有人可以提示我哪里犯了错误吗?
答案1
这是你想要的吗?
\begin{tikzpicture}
[mainbullet/.style={rectangle, minimum size=0.3cm, draw=orange!100, fill=orange!100, thick},
maintitle/.style={rectangle, opacity=0.5}]
\node[mainbullet] (experiencebullet) at (0, -23) {};
\node[maintitle] (experiencetitle) [right=10mm of experiencebullet.south east, anchor=base west] {Experience};
\draw (experiencebullet.south east) -- +(10mm, 0);
\end{tikzpicture}