## 编译环境
操作系统
* [x] Windows 10
* [ ] macOS
* [ ] Linux
`若需勾选,请把[ ]改成[x]`
Tex发行版
* [x] TexLive 2020
*...
## 编译环境
操作系统
* [x] Windows 10
* [ ] macOS
* [ ] Linux
`若需勾选,请把[ ]改成[x]`
Tex发行版
* [x] TexLive 2020
* [ ] MikTeX `版本号`
* [ ] CTeX
`若需勾选,请把[ ]改成[x]`
## 我的问题
`rotate=90` 旋转选项和 `below=1em` 相对位置选项在添加 `positioning` 程序库前后效果不一。希望效果是在 `positioning` 程序库的加持下,仍能保持图 1 的效果。
```tex
\documentclass[tikz]{standalone}
% \usetikzlibrary{positioning}
\tikzset{rotatetext/.style={
rotate=90,below=1em,minimum width=3cm,draw=#1,fill=#1!30
}}
\begin{document}
\begin{tikzpicture}
\node[rotatetext=red] (a) {aaaaaaaaaa};
\node[rotatetext=blue] (b) at (a.south) {bbbbbbbbbb};
\node[rotatetext=green] (c) at (b.south) {cccccccccc};
\end{tikzpicture}
\end{document}
```
![正确](https://wenda.latexstudio.net/data/attach/200607/DLh5avZx.png "正确")
添加 `positioning` 程序库后,3个 `node` 错位。
```tex
\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\tikzset{rotatetext/.style={
rotate=90,below=1em,minimum width=3cm,draw=#1,fill=#1!30
}}
\begin{document}
\begin{tikzpicture}
\node[rotatetext=red] (a) {aaaaaaaaaa};
\node[rotatetext=blue] (b) at (a.south) {bbbbbbbbbb};
\node[rotatetext=green] (c) at (b.south) {cccccccccc};
\end{tikzpicture}
\end{document}
```
![错位](https://wenda.latexstudio.net/data/attach/200607/jaGaHXLk.png "错位")
不为 `below` 选项指定距离后,`node` 的错位消失
```tex
\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\tikzset{rotatetext/.style={
rotate=90,below,minimum width=3cm,draw=#1,fill=#1!30
}}
\begin{document}
\begin{tikzpicture}
\node[rotatetext=red] (a) {aaaaaaaaaa};
\node[rotatetext=blue] (b) at (a.south) {bbbbbbbbbb};
\node[rotatetext=green] (c) at (b.south) {cccccccccc};
\end{tikzpicture}
\end{document}
```
![无间距](https://wenda.latexstudio.net/data/attach/200607/7ExzgtEl.png "无间距")
一周热门 更多>