
我正在嘗試使用 Tikz Mindmap 進行功能列為分析,其中我需要以下單元和連接。
- 菱形符號 - 嚴格位於最左側
- 圓圈符號-懶惰定位
- 連接 - 菱形和圓形之間的單箭頭和雙箭頭
- 圓形和菱形之間的連接定位嚴格
條款
lazy
- 將任意位置放置在結果上greedy
- 位於特定位置的位置,此處位於最左側 (=最左邊)left-most
- 在最左側
你可以懶惰地放置圓圈的位置,但菱形應該貪婪地放在最左邊。我認為該方法在線程上過於貪婪將 Tikz 中的節點定位在左下方對所有事物都有明確的定位。
線程的12節點程式碼範例Tikz Mindmap - 如何獲得更多節點其中只有圓圈,是惰性放置圓圈的一個很好的起點。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap}
\begin{document}
\begin{tikzpicture}
%% TODO
% 1. Put a diamond at left most
% 2. Make 12 circles lazily
%https://tex.stackexchange.com/a/7520/13173
\path[mindmap,concept color=blue,text=white,
level 1 concept/.append style=
{every child/.style={concept color=blue!70},sibling angle=-30}]
node[concept] {\Huge\bfseries TikZ}[clockwise from=0]
child foreach \i in {1,...,12} {node[concept]{\LARGE\bfseries\i}};
% 3. Create connections between diamond and circles
\end{tikzpicture}
\end{document}
作業系統:Debian 8.7
答案1
lazy
我不知道這裡的或是什麼意思greedy
。
放置鑽石最簡單的方法就是在心智圖之後繪製它。
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{mindmap,shapes.geometric,arrows.meta,positioning}
\begin{document}
% cwestiwn éo Léopold Hertz 준영: http://tex.stackexchange.com/questions/364288/how-to-do-lazy-and-strict-positioning-of-circles-diamonds-arrows-in-tikz-mindmap
\begin{tikzpicture}
%http://tex.stackexchange.com/a/7520/13173
\path
[mindmap,
concept color=blue,
text=white,
level 1 concept/.append style={every child/.style={concept color=blue!70}, sibling angle=-30}
]
node [concept, font=\Huge\bfseries] {Ti\emph{k}Z}
[clockwise from=0]
child foreach \i in {1,...,12} {node (c\i) [concept, font=\LARGE\bfseries]{\i}};
\node (d) [left=of c7, text width=50mm, fill, diamond, draw, magenta] {};
\foreach \i [evaluate=\i as \j using {\i>6 ? -45-(12-\i)*15 : 55+\i*15}, evaluate=\i as \k using { \i>6 ? -90+(12-\i)*5 : 90-((\i-1)*5)} ] in {1,...,12} \draw [gray, ultra thick, -Latex] (d) [out=\k, in=\j] to (c\i);
\end{tikzpicture}
\end{document}