如何在 tikz 的雲端(節點)環境中使用換行符?

如何在 tikz 的雲端(節點)環境中使用換行符?

通常我從來沒有遇到過 tikz 內部換行問題。但這一次,出於某種我不知道的原因,tikz 不想給我換行符。您知道是什麼原因造成的嗎?

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts}

\begin{document}
\begin{tikzpicture}
    \node[cloud callout, cloud puffs=10, aspect=4.5, cloud puff arc=70,
    shading=ball, anchor=pointer] at (0,0) {
        This is long text\\
        One line isn't enough
    };
\end{tikzpicture}
\end{document}

答案1

你可以用align\node,

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts}

\begin{document}
\begin{tikzpicture}
    \node[cloud callout, cloud puffs=10, aspect=4.5, cloud puff arc=70,
    shading=ball, anchor=pointer,align = left] at (0,0) {
        This is long text\\
        One line isn't enough
    };
\end{tikzpicture}
\end{document}

leftcenterright

相關內容