由于某种原因,开头总是会出现空白行。我需要删除它。
\documentclass[border=0.5mm]{standalone}
\usepackage{ragged2e}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path node[draw,text width=3cm]
{\begin{justify}this is just some text this is just some text this is just some text\end{justify}};
\end{tikzpicture}
\end{document}
答案1
使用align
带值的节点选项justify
。那么您不需要包ragged2e
。
\documentclass[border=0.5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path node[draw,text width=3cm,align=justify]
{this is just some text this is just some text this is just some text};
\end{tikzpicture}
\end{document}
或者,您可以在节点文本中使用命令\justifying
(由包提供ragged2e
)。但是您必须\par
在文本末尾使用。
\documentclass[border=0.5mm]{standalone}
\usepackage{ragged2e}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\path node[draw,text width=3cm,align=justify]
{\justifying this is just some text this is just some text this is just some text\par};
\end{tikzpicture}
\end{document}