
私は Fedora バージョン 32 からバージョン 33 にアップグレードしました。そのため、Tikz も更新されました (3.1.4b から 3.1.5b へ)。この変更以降、この図はコンパイルされなくなりました (私は Lualatex を使用しています)。
\documentclass{minimal}
\usepackage[french]{babel}
\usepackage{xcolor}
\definecolor{RdBu-9-1}{RGB}{178,24,43}
\definecolor{RdBu-9-2}{RGB}{214,96,77}
\definecolor{RdBu-9-8}{RGB}{67,147,195}
\definecolor{RdBu-9-9}{RGB}{33,102,172}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{fadings}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows}
\usetikzlibrary{matrix}
\usetikzlibrary{decorations.pathreplacing}
\tikzset{%
ffa/.style={%
pattern=north west lines,
pattern color=RdBu-9-2,
draw=none
},
ffc/.style={%
draw=RdBu-9-1,
line width=1}
}
\usepackage[babel, autostyle]{csquotes}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes,
anchor=west,
nodes={minimum size=.75cm}
] (zla0) at (0,0)
{
\draw[ffa,ffc] (0,0) circle (.3cm);&
\draw[ffa,ffc] (0,0) circle (.3cm);\\
};
\matrix [matrix of nodes,
anchor=north,
nodes={minimum size=.75cm},
below=2cm of zla0] (zlb0)
{
\draw[ffa,ffc] (0,0) circle (.3cm);\\
};
\foreach \m in {0} {
\draw (zla\m.south west) |- ($(zla\m.south west)!0.5!(zla\m.south
east) + (0,-.1)$) -| (zla\m.south east) node[pos=0, yshift=.2]
(zla\m-g) {};
%
\draw (zlb\m.north west) |- ($(zlb\m.north west)!0.5!(zlb\m.north
east) + (0,.1)$) -| (zlb\m.north east) node[pos=0, yshift=.2]
(zlb\m-g) {};
%
\draw[->>, black,] ([yshift=-.2cm]zla\m.south) -- ([yshift=.2cm]zlb\m.north);
}
\draw[|-, black] ([yshift=1.25cm]zla0-1-2.north) -- (zla0-1-2.north)
node[pos=.6,fill=white, minimum size=.75cm]{};
\node[above=0cm of zla0-1-1.north, anchor=south, align=center,
font=\tiny, text width=1.75cm]{\enquote{Je suis proche du \emph{Pic
Jean Ray}}};
\node[above=1.25cm of zla0-1-2.north, anchor=south, align=center,
font=\tiny, text width=1.75cm]{\enquote{Je suis sous une \emph{crête}}};
\node[below=0cm of zlb0.south, anchor=north, align=center,
font=\tiny, text width=4cm]{\enquote{Je suis proche du \emph{Pic
Jean Ray} et sous une crête}};
\node[fill=white,align=center, font=\large\sffamily] at ($(zla0.south east)!0.5!(zlb0.north
west)$){\emph{Fusion} des \emph{indices de localisation}};
\end{tikzpicture}
\end{document}
コンパイル時に次のようなエラーが発生します:
ERROR: Package pgf Error: No shape named `zla0-1-2' is known.
tikzリポジトリを検索して問題を特定しました。導関数( など)matrix of nodes
を含むのセルは直接処理され、(\path
\draw
node
ソースしかし、フェロラ32では動作していたこのコードがなぜ動作しなくなったのかはわかりません(tikzで情報を見つけることができませんでした変更履歴またはその他何でも)。
この図を再び機能させるための最善の解決策は何でしょうか? このスキームに基づいて構築された図がいくつかあり (例として、これは最も単純なものです)、これらの変更を行う時間がほとんどないことがわかっています。
以前の作業方法に切り替えるオプションがあれば最高ですが、ドキュメントには同様のものは見つかりませんでした。
Ps: フランス語でも同じ質問をしましたここそこに答えがあればここに投稿しますし、その逆も同様です。
答え1
TikZ マトリックス内の単なるノードではないセルには名前がありません。( のセルに配置されているノードであっても、matrix of nodes
名前\node
を付けない限りは名前がありません。)
実際のノードを使用する以外にも
\matrix [
matrix of nodes,
anchor=west,
nodes in empty cells,
nodes={ffa, ffc, circle, minimum size=.6cm}
] (zla0) at (0,0) { & \\};
これにより、セル内に同じ円が配置されます\draw
。TikZ で各セルの境界ボックスの周囲にぴったりの長方形のノードをインストールできます。もちろん、セル内の実際の要素を参照することはできません。(ノードであり、名前を付けた場合は除きます。)
キーは、すべてのセルの最後にinstall fitted node at end cell
必要なものをインストールします。部分は、キーからスタイルを継承しないようにします。 これらのノードには名前が付けられているため( に注意)、 内の実際のノードと競合することはありません。\node
\path[every node/.code]
every node
<matrix name>-<row>-<column>'
'
matrix of node
current bounding box
また、エイリアスを指定したり、セルごとに をインストールしたりしてみましたlocal bounding box
が、実際のノード (後で使用する) を特別なマトリックス フックにインストールして、マトリックスの後でその位置がわかるようにする必要があるため、これらすべてにさらに作業が必要です。また、その場合でも線の幅は考慮されませんでした。
コード
\documentclass[tikz]{standalone}
\usepackage[french]{babel}
\definecolor{RdBu-9-1}{RGB}{178,24,43}
\definecolor{RdBu-9-2}{RGB}{214,96,77}
\definecolor{RdBu-9-8}{RGB}{67,147,195}
\definecolor{RdBu-9-9}{RGB}{33,102,172}
\usetikzlibrary{patterns, calc, positioning, arrows, matrix, fit}
\tikzset{% This is the new key.
install fitted node at end cell/.style={
execute at end cell={%
\path[every node/.code=] node[shape=rectangle, fit=(current bounding box),
inner sep=+0pt, minimum size=+0pt, outer sep=+0pt, name=\tikzmatrixname-%
\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn']{};}}}
\tikzset{
ffa/.style={pattern=north west lines, pattern color=RdBu-9-2, draw=none},
ffc/.style={draw=RdBu-9-1, line width=1}}
\usepackage[babel, autostyle]{csquotes}
\begin{document}
\begin{tikzpicture}[radius=.3cm]
\matrix [
install fitted node at end cell, % ← Here's the new key used.
anchor=west] (zla0) at (0,0) {
\draw[ffa,ffc] (0,0) circle []; &
\draw[ffa,ffc] (0,0) circle []; \\};
\matrix [below=2cm of zla0] (zlb0) {\draw[ffa,ffc] (0,0) circle [];\\};
\foreach \m in {0} {
\draw (zla\m.south west)
|- ($(zla\m.south west)!0.5!(zla\m.south east) + (0,-.1)$)
-| (zla\m.south east) node[pos=0, yshift=.2] (zla\m-g) {};
\draw (zlb\m.north west)
|- ($(zlb\m.north west)!0.5!(zlb\m.north east) + (0,.1)$)
-| (zlb\m.north east) node[pos=0, yshift=.2] (zlb\m-g) {};
\draw[->>, black,] ([yshift=-.2cm]zla\m.south) -- ([yshift=.2cm]zlb\m.north);
}
\draw[|-, black] ([yshift=1.25cm]zla0-1-2'.north) -- (zla0-1-2')
node[pos=.6,fill=white, minimum size=.75cm]{};
\node[above=0cm of zla0-1-1'.north, anchor=south, align=center, font=\tiny,
text width=1.75cm]{\enquote{Je suis proche du \emph{Pic Jean Ray}}};
\node[above=1.25cm of zla0-1-2'.north, anchor=south, align=center, font=\tiny,
text width=1.75cm]{\enquote{Je suis sous une \emph{crête}}};
\node[below=0cm of zlb0.south, anchor=north, align=center, font=\tiny,
text width=4cm]{
\enquote{Je suis proche du \emph{Pic Jean Ray} et sous une crête}};
\node[fill=white, align=center, font=\large\sffamily]
at ($(zla0.south east)!0.5!(zlb0.north west)$)
{\emph{Fusion} des \emph{indices de localisation}};
\end{tikzpicture}
\end{document}