
암호
\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{tikzmark,shapes.geometric,shapes.symbols}
\tikzset{elnode/.style={draw, ellipse, dotted, minimum height=1cm, label distance=-2mm},
cloudnode/.style={draw, dotted, black!80, inner sep=1.75cm, cloud, cloud puffs=20, cloud puff arc=100}}
\begin{document}
\begin{tikzpicture}
\subnode{A}{ptA} at (0, 0);
\end{tikzpicture} \hspace{5cm}
\begin{tikzcd}[arrows={-latex, outer sep=-1.5pt},row sep=2cm, column sep=2cm]
& \subnode{ptfa}{F(A)} \arrow[d, "\alpha_A"{name = arrow1}] \arrow[to=arrow1, phantom, "{}\tikzmark{Fa}"]\\ & \subnode{ptga}{G(A)}
\end{tikzcd}
\begin{tikzpicture}[remember picture, overlay]
\node[cloudnode1, label = {above: $\cat{A}$}](lft) at (pic cs:A){};
\node[cloudnode, label = {above: $\cat{B}$}](rgt) at (pic cs:ptfa){};
\draw[-latex, dotted, black!80, bend right](A)to node[below]{$F$}(ptfa);
\draw[-latex, dotted, black!80, bend right](A)to node[below]{$G$}(ptga);
\end{tikzpicture}
\end{document}
두 클라우드 노드 사이에 공간을 추가하는 방법을 알고 싶습니다. hspace{}
작동하지 않는 것 같습니다.
저는 라텍스를 처음 사용합니다. 이전에 제가 지금까지 받은 도움에 대해 말씀드리고 싶습니다. @user:125871(SandyG)님이 매우 도움이 되었습니다. 그들은 제가 지금까지 어느 정도 진전을 이루는 데 도움을 주었습니다. 제가 올린 첫 번째 질문은 다음과 같습니다.https://tex.stackexchange.com/a/640262/268068
답변1
귀하의 코드가 왜 그렇게 복잡한지 잘 모르겠습니다. 몇 가지 간단한 도구를 사용하면 이 작업을 수행할 수 있다고 생각하기 때문입니다. 이것이 복제하려는 다이어그램에 따라 얻은 것입니다.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (1) node(a){A};
\node[draw,circle,right of=a, node distance=4cm, inner sep=1cm](two){};
\node[above of=two](up){F(A)};
\node[below of=two](down){G(A)};
\draw (up) edge[->] node[anchor=west]{f} (down);
\draw[dotted] (0.2,0.2) .. controls (2,1) and (3,1) .. (3.5,1);
\draw[dotted,label={right:f}] (0.2,-0.2) .. controls (2,-1) and (3,-1) .. (3.5,-1);
\end{tikzpicture}
\end{document}
답변2
이런 다이어그램은 tikzpicture
조각으로 구성하는 것보다 단일 환경에서 구성하는 것이 더 쉽다고 생각합니다. tikz-cd
a에서 스타일을 사용할 수 있습니다 tikzpicture
(매뉴얼의 섹션 3.3 참조).
\documentclass{article}
%\url{https://tex.stackexchange.com/q/640820/86}
\usepackage{tikz-cd}
\usetikzlibrary{
shapes.geometric,
shapes.symbols,
positioning,
fit
}
\tikzset{
elnode/.style={
draw,
ellipse,
dotted,
minimum height=1cm,
label distance=-2mm
},
cloudnode/.style={
draw,
dotted,
black!80,
inner sep=1.75cm,
cloud,
cloud puffs=20,
cloud puff arc=100}
}
\newcommand\cat[1]{\mathcal{#1}}
\begin{document}
\begin{tikzpicture}[commutative diagrams/every diagram]
\matrix[
matrix of math nodes,
name=m,
row sep=2cm,
commutative diagrams/every cell,
] {
F(A) \\
G(A) \\
};
\path[
commutative diagrams/.cd,
every arrow,
every label
]
(m-1-1) edge node {\(\alpha_A\)} (m-2-1);
\node[
cloudnode,
fit=(m),
inner sep=0pt,
label={above: \(\cat{B}\)}
] (B) {};
\node[
cloudnode,
left=2cm of B,
label={above: \(\cat{A}\)}
] (A) {};
\draw[
-latex,
dotted,
black!80,
bend right
]
(A.center) to node[auto,swap] {\(F\)} (m-1-1);
\draw[
-latex,
dotted,
black!80,
bend right
]
(A.center) to node[auto,swap] {\(G\)} (m-2-1);
\end{tikzpicture}
\end{document}
답변3
- 당신이 무엇을 추구하는지 완전히 명확하지 않습니다.
- 표시된 이미지 재현
- MWE를 수정하세요(제공된 스케치와 결과가 다름).
- 두 가지를 결합한 제안을 하시겠습니까?
- 귀하의 MWE는 불필요하게 복잡합니다. 단일
trikzpicture
환경 에서 그리는 것이 훨씬 간단합니다 .
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
fit,
positioning,
quotes,
shapes.symbols}
\begin{document}
\begin{tikzpicture}[
node distance = 6mm and 36mm,
> = {Stealth[scale=2]},
arr/.style = {->, densely dashed},
cn/.style = {cloud, cloud puffs=12,
draw, thick, dotted,
inner sep=#1},
]
\node (A) {$A$};
\node (F) [above right=of A] {$F(A)$};
\node (G) [below right=of A] {$G(A)$};
%
\node [cn=12pt, fit=(A),
label=$\mathcal{A}$] {};
\node [cn= 6pt, fit=(F) (G),
label=$\mathcal{B}$] {};
%
\draw[arr] (A) edge [bend right, "$F$" ] (F)
edge [bend right, "$G$" '] (G);
\draw[->] (F) edge ["$\alpha A$"] (G);
\end{tikzpicture}
\end{document}