在这张图片中,我试图创建一个论文中涵盖的主题图。我只是复制并更改了网站上已有内容中的元素。如果能通过缩小方框来缩小整体图片,我将不胜感激。我想删除 A、B、C,并省略注释(它们可以用第 2、3、4 和 5 章代替,其中中心章节已经是第 1 章了)。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.misc}
\tikzset{
figNode/.style={
path picture={
\node at (path picture bounding box.center) {#1};}}
}
\begin{document}
\begin{tikzpicture}[thick]
\node (a) at (60:10){};
\node (b) at (20:10){};
\node (c) at (-20:10){};
\node (d) at (-60:10){};
%\node (e) at (-80: 10){};
\foreach \r/\c in {90/blue,45/green,0/red,-45/yellow}{
\fill[\c!50] (0,0) -- (\r:4) arc (\r:\r-45:4) -- cycle;
};
\foreach \r/\c/\p in {67.5/blue/a,22.5/green/b,-22.5/red/c,-67.5/yellow/d}{
\draw[\c] (\r:4) -- (\p);
\fill[gray!50] (\r:4) circle (0.5);
\fill[\c] (\r:4) circle (0.25);
};
\draw[fill=white] (0,0) circle (3) node[align=center]{Chapter 1: Campactness};
\draw[rounded corners=25pt, fill=gray!50] (3.5,7) rectangle ++(7,3.5);
\draw[fill=blue!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-a}}]
(a) circle (1);
\node[right=2 of a, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=blue!50,
minimum height=2cm, minimum width=3cm] {Chapter 2: Degrees of compactness (Schauder's theorem and s-numbers)};
\draw[rounded corners=25pt, fill=gray!50] (7.8,1.6) rectangle ++(7,3.5);
\draw[fill=green!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-b}}]
(b) circle (1);
\node[right=2 of b, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=green!50,
minimum height=2cm, minimum width=3cm] {Chapter 3: Approximation Schemes ( Q-Compactness, Degrees of Q-compactness) };
\draw[rounded corners=25pt, fill=gray!50] (8,-5) rectangle ++(7,3.5);
\draw[fill=red!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-c}}]
(c) circle (1);
\node[right=2 of c, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=red!50,
minimum height=2cm, minimum width=3cm] {Chapter 4: Realizing certain approximation spaces as interpolation spaces (Applications of interpolation theory to PDEs)};
\draw[rounded corners=25pt, fill=gray!50] (3.2,-10.4) rectangle ++(7,3.5);
\draw[fill=yellow!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-duck}}]
(d) circle (1);
\node[right=2 of d, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=yellow!50,
minimum height=2cm, minimum width=3cm] {Chapter 5: H-Operators as applications of interpolation theory};
\end{tikzpicture}
\end{document}
答案1
这里有一种方法可以为您提供更好的起点。
主要步骤:
- 将重构应用于您的代码,例如参见点击此处了解更多信息
\tikzset
已figNode
过时(图片已消失)- 宏并
\newcommand
简化你的代码\graybox
\colorcirc
cmnnode
(新)风格也类似,cmnbox
- 使你的“章节节点”能够使用更大的字体进行多行显示
- 重构还可以更进一步,例如吸收多个
font
语句(但这始终取决于程序员)
笔记:宏已经提供了;
tikz 急需的分号。但是,如果您愿意,您可以将其更改为\graybox{(3.5,7)};
(只需将其放在那里)。
记住:节点内部的文本{ }
接受任何 LaTeX“文本”,例如将某些单词加粗、在里面放置表格或图像等。
通过这种方法您可以获得以下好处:
- 更清洁的代码(美丽密码)更“口头”地说明它将展示什么
- “仅在一个地方进行更改”方法(
styles
,\newcommand
) - 更容易进一步适应您的需求
建议:如果你还没有完成,请花一些时间阅读本章开头的教程。PGF 手册,并查找此处使用的 tikz 命令,例如通过该 pdf 内的搜索/查找或索引。
\documentclass[12pt,border=3mm]{standalone}% <<<---
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.misc}
%\tikzset{% <<<--- became irrelevant from REFACTORING
% figNode/.style={
% path picture={
% \node at (path picture bounding box.center) {#1};}}
%}
% ~~~ macros (shorthand notations) from REFACTORING ~~~~~~~~~~~~~~~~~~~~~~~
\newcommand\graybox[1]{\draw[cmnbox] #1 rectangle ++(7,3.5);}% the gray boxes
\newcommand\colcirc[3]{% #1=color, #2=nodes name, #3=text
\draw[#1] (#2) circle (1);%
\node [font=\Large] at (#2) {#3};}% to put text, like 2, ch 2 etc.
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
\begin{tikzpicture}
[thick,
cmnnode/.style={rounded rectangle=25pt,% common node style
rounded rectangle west arc=none,
draw,
minimum height=2cm, minimum width=3cm,% these you had already
font=\Large,% larger fonts; \LARGE would be maximum
align=left,% for multilines, indicated by \\
inner sep=1em% give it a bit more space to breath
},
cmnbox/.style= {rounded corners=25pt,% common box style
fill=gray!50}
]
\node (a) at (60:10){};
\node (b) at (20:10){};
\node (c) at (-20:10){};
\node (d) at (-60:10){};
%\node (e) at (-80: 10){};
% ~~~ colored arc segments ~~~~~~~~~~~~~~~~~~~~
\foreach \r/\c in {90/blue,45/green,0/red,-45/yellow}{
\fill[\c!50] (0,0) -- (\r:4) arc (\r:\r-45:4) -- cycle;
};
% ~~~ small gray and colored circles ~~~~~~~~~~~~~~
\foreach \r/\c/\p in {67.5/blue/a,22.5/green/b,-22.5/red/c,-67.5/yellow/d}{
\draw[\c] (\r:4) -- (\p);
\fill[gray!50] (\r:4) circle (0.5);
\fill[\c] (\r:4) circle (0.25);
};
% ~~~ root-circle ~~~~~~~~~~~~~~~~
\draw[fill=white,font=\Large] (0,0) circle (3) node[align=center]{\textbf{Chapter 1}:\\ Campactness};% augmented: font, \\ (multiline), \textbf{} for bold text-part
% ~~~ 1st, blue ~~~~~~~~~~~~~~~~
\graybox{(3.5,7)} % simplified, see macro above
\colcirc{fill=blue!50}{a}{2} % simplified, see macro above
% reusing common node style, some bold text, \\ (multiline)
\node[right=2 of a, cmnnode, fill=blue!50] {\textbf{Chapter 2}: Degrees of compactness\\(Schauder's theorem and s-numbers)};
% ~~~ 2nd, green ~~~~~~~~~~~~~~~~~
\graybox{(7.8,1.6)}
\colcirc{fill=green!50}{b}{3}
\node[right=2 of b, cmnnode, fill=green!50] {\textbf{Chapter 3}: Approximation Schemes\\( Q-Compactness, Degrees of Q-compactness) };
% ~~~ 3rd, red ~~~~~~~~~~~~~~~~~
\graybox{(8,-5)}
\colcirc{fill=red!50}{c}{4}
\node[right=2 of c, cmnnode, fill=red!50] {Chapter 4: Realizing certain approximation spaces as interpolation\\spaces (Applications of interpolation theory to PDEs)};
% ~~~ 4th, yellow ~~~~~~~~~~~~~~~~~~~~~
\graybox{(3.2,-10.4)}
\colcirc{fill=yellow!50}{d}{5}
\node[right=2 of d, cmnnode, fill=yellow!50] {Chapter 5: H-Operators as applications of interpolation theory};
\end{tikzpicture}
\end{document}