我尝试更改嵌套节点中的行距。我尝试使用\linepsread
和,\baselineskip
但都不起作用。
梅威瑟:
\documentclass[]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node[rectangle,fill=blue,align=center]() at (5cm,0){coucou\\%
\tikz\node[text width=3cm,align=center](){\setlength{\baselineskip}{1pt}\tiny These certificates can be used to digitally sign and encrypt email, authenticate%
and authorize users connecting to websites and secure data transmission over%
the Internet. Any application that supports the Secure Socket Layer (SSL) can%
make use of certificates signed by CAcert, as can any application that uses%
X.509 certificates, e.g. for encryption or code signing and document signatures.};};
\end{tikzpicture}
\end{document}
答案1
除了\tiny
在文本中设置外,将其放在选项中node font
也会进行相应的设置\baselineskip
:
\documentclass[]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node[rectangle,fill=blue!50,align=center]() at (5cm,0){%
coucou\\
\tikz\node[text width=3cm,align=center, node font=\tiny]{%
These certificates can be used to digitally sign and encrypt email,
authenticate and authorize users connecting to websites and secure data
transmission over the Internet. Any application that supports the
Secure Socket Layer (SSL) can make use of certificates signed by CAcert,
as can any application that uses X.509 certificates, e.g. for
encryption or code signing and document signatures.%
};};
\end{tikzpicture}
\end{document}
答案2
如果您不想决定字体大小,您可以让它tcolorbox
用其库为您决定fitting
。
只要\tcboxfit
您做出决定width
,height
程序就会调整内容文本以适应它。
\documentclass[border=2mm]{standalone}
\usepackage[most]{tcolorbox}
\newtcboxfit{\boxfit}[4][]{width=#2,height=#3,title=#4,halign=center, #1}
\begin{document}
\boxfit{5cm}{5cm}{coucou}{
These certificates can be used to digitally sign and encrypt email,
authenticate and authorize users connecting to websites and secure data
transmission over the Internet. Any application that supports the
Secure Socket Layer (SSL) can make use of certificates signed by CAcert,
as can any application that uses X.509 certificates, e.g. for
encryption or code signing and document signatures.%
}
\boxfit[sharp corners, colback=blue!50, size=fbox]{3cm}{6cm}{coucou}{
These certificates can be used to digitally sign and encrypt email,
authenticate and authorize users connecting to websites and secure data
transmission over the Internet. Any application that supports the
Secure Socket Layer (SSL) can make use of certificates signed by CAcert,
as can any application that uses X.509 certificates, e.g. for
encryption or code signing and document signatures.%
}
\boxfit[sharp corners, colback=red!50, size=small, colframe=red!70, halign title=center]{6cm}{3cm}{coucou}{
These certificates can be used to digitally sign and encrypt email,
authenticate and authorize users connecting to websites and secure data
transmission over the Internet. Any application that supports the
Secure Socket Layer (SSL) can make use of certificates signed by CAcert,
as can any application that uses X.509 certificates, e.g. for
encryption or code signing and document signatures.%
}
\end{document}
答案3
最后我找到了一个使用setspace
包的解决方案。
梅威瑟:
\documentclass[]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{setspace}
\begin{document}
\begin{tikzpicture}
\node[rectangle,fill=blue,align=center]() at (5cm,0){coucou\\ \tikz\node[text width=3cm,align=center](){\begin{spacing}{0.5}\tiny These certificates can be used to digitally sign and encrypt email, authenticate and authorize users connecting to websites and secure data transmission over the Internet. Any application that supports the Secure Socket Layer (SSL) can make use of certificates signed by CAcert, as can any application that uses X.509 certificates, e.g. for encryption or code signing and document signatures.\end{spacing}};};
\end{tikzpicture}
\end{document}