
提案されたように、輪郭パッケージを使用してテキストの周りにハローを配置する方法この回答ではスタイルを定義することで多くのノードで?
ムウェ:
\documentclass[tikz]{standalone}
\usepackage[outline]{contour} %halo around text
%https://tex.stackexchange.com/questions/18472/tikz-halo-around-text
\contourlength{1.2pt}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}[halo text node/.style={circle, draw, pattern=north east lines}]
\node [halo text node] {\contour{white}A};
\end{tikzpicture}
\end{document}
結果:
私が望むのは、すべてのノード内で を使用する代わりに、tikzpicture
に似た形式でのオプションを含めることです。halo text node/.style{...,text=\contour{white}}
\contour{white}{...}
答え1
\contour
これはあなたの質問には答えません (ノード コンテンツにどのように適用すればよいかわからないため) が、contour text
ノード コンテンツをパラメーターとして受け取るスタイルを定義する別のアプローチを提供します。
\documentclass[tikz]{standalone}
\usetikzlibrary{patterns}
\usepackage[outline]{contour}
\contourlength{1.2pt}
\tikzset{
contour text/.style={node contents={\contour{white}{#1}}},
halo text node/.style={circle, draw, pattern=north east lines}
}
\begin{document}
\tikz\node[halo text node, contour text=ABC];
\end{document}
ノート:
- 私の場合、これは XeLaTeX では機能しません。
contour
もう一つの可能性はパッケージを使用しないことですしかしpdfrender
、または純粋な TikZ で輪郭のアクションを再定義します (印刷する前にテキストを異なる色で複数回移動します)。