Tikzのマトリックスを使用したハイパーリンクされた形状の位置付け

StackOverflow https://stackoverflow.com/questions/2765232

  •  03-10-2019
  •  | 
  •  

質問

ハイパーリンクされた形状を描くことができます tikz 次のコードを使用してください。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usepackage{hyperref}

\begin{document}
\begin{tikzpicture}
\node {%
\href{http://www.stackoverflow.com}{% 
\begin{tikzpicture} 
\filldraw[blue] circle(1cm) node [white] {Click}; 
\end{tikzpicture}}}; 
\end{tikzpicture}

\end{document}

次に、マトリックスを使用して形状を整理したいと思います。それはほとんど機能しますが、私はハイパーリンクされた形状を残りの形状と整列させることができず、他の形状よりも大きいです。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usepackage{hyperref}

\begin{tikzpicture}
\matrix [matrix of nodes, row sep = 1cm, column  sep=1cm, nodes={circle, draw}]  
{%    First  row:
1           & 2 \\
%    second row:
\path node {\href{http://www.stackoverflow.com}{% 
\begin{tikzpicture} 
\node {3}; 
\end{tikzpicture}}}; & 4\\
};

\end{tikzpicture}
\end{document}

次の結果が得られます。

alt text
(ソース: picture.im)

私の質問は、上の写真のシェイプ3を他の形状とどのように整列させ、外側の円を取り除くことができるかということです。

役に立ちましたか?

解決

あなたが高すぎて狙っていると思います、そしてあなたの2番目の{tikzpicture}はあなたのレイアウトを台無しにしています。以下のコードについてどう思いますか?それはあなたが探していたものですか?

\documentclass{article}
\usepackage{tikz}
  \usetikzlibrary{matrix}
\usepackage[pdftex,active,tightpage]{preview}
  \PreviewEnvironment{tikzpicture}
\usepackage{hyperref}
\begin{document}
\begin{tikzpicture}
  \matrix [matrix of nodes, row sep = 1cm, column  sep=1cm, nodes={circle, draw}]  
    {%
    1 & 2\\%
    \href{http://stackoverflow.com}{3} & 4\\%
    };
\end{tikzpicture}
\end{document}

ところで: previewenvironment {tikzpicture}は実際には必要ありませんが、すてきなトリミングされたpdfになります...

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top