如何将其做成钻石,就像“A 下的 C”
\documentclass[12pt]{report}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.markings}
\linespread{1.5}
\textwidth=16truecm \textheight=23truecm \voffset=-1truecm
\hoffset=-1 truecm \thispagestyle{empty}
\usetikzlibrary{arrows, calc, decorations.markings, positioning, quotes}
\usepackage{cite,amsmath,amssymb,amsthm,amsfonts}
\begin{document}
\begin{tikzpicture}[
node distance = 5cm and 5cm,
C/.style = {circle, draw=black, inner sep=0pt, outer sep=0pt, minimum size=5cm,
},
dot/.style = {circle, fill, inner sep=0pt, minimum size=2mm,
node contents={}},
L/.style = {decoration={markings, mark=at position 0.7 with {\arrow{>}}line width=60mm},
postaction={decorate}},
every edge quotes/.append style = {anchor=south , sloped, font=\footnotesize},
every edge/.append style = {L}
]
% main nodes
\node (A) [dot];
\node (B) [dot, below right=of A];% {2};
\node (C) [dot, below = of A ];% {3};
\node (D) [dot,below left =of A];% {5};
% dots
\draw[L] ($(A)+(0, 5mm)$) circle (4mm) node {1};
\draw[L] ($(B)+( 5mm,0)$) circle (4mm) node {2};
\draw[L] ($(C)+( 5mm,0)$) circle (4mm) node {3};
\draw[L] ($(D)+(-5mm,0)$) circle (4mm) node {4};
\end{tikzpicture}
答案1
此代码(唯一改变的行有%CHANGED
注释):
\documentclass[12pt]{report}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.markings}
\linespread{1.5}
\textwidth=16truecm \textheight=23truecm \voffset=-1truecm
\hoffset=-1 truecm \thispagestyle{empty}
\usetikzlibrary{arrows, calc, decorations.markings, positioning, quotes}
\usepackage{cite,amsmath,amssymb,amsthm,amsfonts}
\begin{document}
\begin{tikzpicture}[
node distance = 5cm and 5cm,
C/.style = {circle, draw=black, inner sep=0pt, outer sep=0pt, minimum size=5cm,
},
dot/.style = {circle, fill, inner sep=0pt, minimum size=2mm,
node contents={}},
L/.style = {decoration={markings, mark=at position 0.7 with {\arrow{>}}line width=60mm},
postaction={decorate}},
every edge quotes/.append style = {anchor=south , sloped, font=\footnotesize},
every edge/.append style = {L}
]
% main nodes
\node (A) [dot];
\node (B) [dot, below right=of A];% {2};
\node (C) [dot, below =10cm of A ];% {3};%CHANGED
\node (D) [dot,below left =of A];% {5};
% dots
\draw[L] ($(A)+(0, 5mm)$) circle (4mm) node {1};
\draw[L] ($(B)+( 5mm,0)$) circle (4mm) node {2};
\draw[L] ($(C)+(0,-5mm)$) circle (4mm) node {3};%CHANGED
\draw[L] ($(D)+(-5mm,0)$) circle (4mm) node {4};
\end{tikzpicture}
\end{document}
给我这个输出:
请告诉我缺少了什么。
答案2
你非常接近……
\documentclass[12pt]{report}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, calc, decorations.markings, positioning, quotes}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{cite}
\begin{document}
\begin{tikzpicture}[
node distance = 5cm and 5cm,
C/.style = {circle, draw=black, inner sep=0pt, outer sep=0pt, minimum size=5cm,
},
dot/.style = {circle, fill, inner sep=0pt, minimum size=2mm,
node contents={}},
L/.style = {decoration={markings, mark=at position 0.7 with {\arrow{>}}line width=60mm},
postaction={decorate}},
every edge quotes/.append style = {anchor=south , sloped, font=\footnotesize},
every edge/.append style = {L}
]
% main nodes
\node (A) [dot];
\node (B) [dot, below right=of A];
\node (C) [dot, below left =of B ];% this node you like to have below of A
% but it is also below left from node B.
\node (D) [dot, below left =of A];
% dots
\draw[L] ($(A)+(0, 5mm)$) circle (4mm) node {1};
\draw[L] ($(B)+( 5mm,0)$) circle (4mm) node {2};
\draw[L] ($(C)+(0,-5mm))$) circle (4mm) node {3};
\draw[L] ($(D)+(-5mm,0)$) circle (4mm) node {4};
\end{tikzpicture}