
저는 tikz를 처음 사용합니다. 수동으로 이미지를 만듭니다. 그림에서 색칠된 부분은 레이블을 강조 표시합니다. tikz에서 이 작업을 수행하는 방법은 레이블에 대해 다음 코드를 사용하고 있습니다. 이 코드를 변경하는 방법입니다.
\documentclass[a3paper]{article}
\usepackage{
calc,
graphicx,
eso-pic,
tikz,
}
\begin{document}
\begin{tikzpicture}
\begin{scope}[local bounding box=scope1]
\draw (2.1,8) rectangle (6,4);
\node [transform shape] (Label) at (1.5,4)[rotate=0,color=black] {label-1};
\node [transform shape] (Label) at (1.5,5)[rotate=0,color=black] {label-2};
\node [transform shape] (Label) at (1.5,6)[rotate=0,color=black] {label-3};
\node [transform shape] (Label) at (1.5,7)[rotate=0,color=black] {label-4};
\node [transform shape] (Label) at (1.5,8)[rotate=0,color=black] {label-5};
\end{scope}
\end{tikzpicture}
\end{document}
답변1
옵션 을 제거 color=black
하고 다음을 통해 각 노드에 스타일을 적용합니다 every node/.style=
.
암호:
\documentclass[a3paper]{article}
\usepackage{calc,graphicx,eso-pic,tikz,}
\tikzset{My Node Style/.style={draw=pink, fill=pink, fill opacity=0.50, text opacity=1}}
\begin{document}
\begin{tikzpicture}
\begin{scope}[local bounding box=scope1,
every node/.style={My Node Style}
]
\draw (2.1,8) rectangle (6,4);
\node [transform shape] (Label) at (1.5,4) {label-1};
\node [transform shape] (Label) at (1.5,5) {label-2};
\node [transform shape] (Label) at (1.5,6) {label-3};
\node [transform shape] (Label) at (1.5,7) {label-4};
\node [transform shape] (Label) at (1.5,8) {label-5};
\end{scope}
\end{tikzpicture}
\end{document}