\libebreak 似乎在节点内不起作用。这是我的 MWE
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0)--(12,0);
\foreach \x in {0,4,8,12}
\draw (\x,0)--(\x,-0.5);
\node at (0,-0.5cm)[anchor=north]{1785\\ born in Haiti};
\end{tikzpicture}
\end{document}
答案1
您需要指定对齐方式,例如align=center
。我还将您的图缩小了一点(或者您可以使页面更宽)以适合页面,并且还添加了line cap=rect
改进刻度的效果。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.8]
\draw (0,0)--(12,0);
\foreach \x in {0,4,8,12}
\draw[line cap=rect] (\x,0)--(\x,-0.5);
\node at (0,-0.5cm)[anchor=north,align=center]{1785\\ born in Haiti};
\end{tikzpicture}
\end{document}