尝试移动 tikz 图片组合时出现问题

尝试移动 tikz 图片组合时出现问题

我正在尝试为我的论文构建某种拓扑结构。到目前为止,我的重点主要是排版(也就是说,我对某些部分不太熟练tikz)。我设法突破并理解了非常有用的 TEX.SX 线程。这是我迄今为止的 MWE:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tqft}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}[every tqft/.append style={transform shape, rotate=0, tqft/circle x radius=7pt, tqft/circle y radius=3pt, tqft/boundary separation=1.3cm}]
\pic[   
tqft/pair of pants,
name=b,
every incoming upper boundary component/.style={draw},
every incoming  boundary component/.style={draw},
cobordism  edge/.style={draw}
];
\pic[
tqft/reverse pair of pants,
name=c,
every outgoing lower boundary component/.style={draw},
cobordism  edge/.style={draw},
at=(b-outgoing boundary 1),
];
\node at (0,-4.5) {$\vdots$};
\pic[   
tqft/pair of pants,
name=d,
every incoming upper boundary component/.style={draw},
every incoming  boundary component/.style={draw},
cobordism  edge/.style={draw}
];
\pic[
tqft/reverse pair of pants,
name=e,
every outgoing lower boundary component/.style={draw},
cobordism  edge/.style={draw},
at=(b-outgoing boundary 2),
% at=(0,-6.5),
];
\end{tikzpicture}

\end{document}

这给了我这个准形状:

在此处输入图片描述

我知道这是由于边界的定义,所以我尝试切换到坐标方法,您可以在下面看到注释掉的方法,这是有充分理由的。如果我用注释行编译我的代码(当然后者会替换at=(b-outgoing boundary 2),),编译本身就永远不会完成。

我请你向我展示一种合适的方法,pic通过坐标在环境中定位构图,当然,与我的努力类似。我也热切地请求你修复一个小细节:在拓扑构造的底部,我们看到了“管”的入口;我想要椭圆的另一半在后面构造来表示此特定部分被覆盖,并给出“3D”透视感。椭圆的“高度”是通过更改序言y中的值来调整的tikzpicture,但我不知道如何实现虚线部分。

先感谢您。

答案1

软件包作者为软件包的 s 设置了非标准语法,这相当无益pic。这破坏了通常的pic语法,包括\pic at ...通常用于放置它们的 。但是,您可以使用提供的非标准语法来使用坐标。您只需用花括号将坐标括起来即可。例如,

\documentclass[border=10pt]{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tqft}

\begin{document}

\begin{tikzpicture}
  [
    every tqft/.append style={%
      transform shape,
      rotate=0,
      tqft/circle x radius=7pt,
      tqft/circle y radius=3pt,
      tqft/boundary separation=1.3cm
    },
  ]
  \pic [
  tqft/pair of pants,
  name=b,
  every incoming upper boundary component/.style={draw},
  every incoming  boundary component/.style={draw},
  cobordism  edge/.style={draw}
  ];
  \pic[
  tqft/reverse pair of pants,
  name=c,
  every outgoing lower boundary component/.style={draw},
  cobordism  edge/.style={draw},
  at=(b-outgoing boundary 1),
  ];
  \node at (0,-4.5) {$\vdots$};
  \pic[
  tqft/pair of pants,
  name=d,
  every incoming upper boundary component/.style={draw},
  every incoming  boundary component/.style={draw},
  cobordism  edge/.style={draw}
  ];
  \pic[
  tqft/reverse pair of pants,
  name=e,
  every outgoing lower boundary component/.style={draw},
  cobordism  edge/.style={draw},
%   at=(b-outgoing boundary 2),
  at={(0,-6.5)},
  ];
\end{tikzpicture}
\end{document}

工作正常。

放置带有坐标的异常 <code>pic</code>

您可以使用样式绘制椭圆的另一半every boundary component。例如,

\documentclass[border=10pt]{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tqft}

\begin{document}

\begin{tikzpicture}
  [
    every tqft/.append style={%
      transform shape,
      rotate=0,
      tqft/circle x radius=7pt,
      tqft/circle y radius=3pt,
      tqft/boundary separation=1.3cm,
      tqft/every boundary component/.style={draw, densely dashed, opacity=.5}
    },
  ]
  \pic [
  tqft/pair of pants,
  name=b,
  every incoming upper boundary component/.style={draw},
  every incoming  boundary component/.style={draw},
  cobordism  edge/.style={draw}
  ];
  \pic[
  tqft/reverse pair of pants,
  name=c,
  every outgoing lower boundary component/.style={draw},
  cobordism  edge/.style={draw},
  at=(b-outgoing boundary 1),
  ];
  \node at (0,-4.5) {$\vdots$};
  \pic[
  tqft/pair of pants,
  name=d,
  every incoming upper boundary component/.style={draw},
  every incoming  boundary component/.style={draw},
  cobordism  edge/.style={draw}
  ];
  \pic[
  tqft/reverse pair of pants,
  name=e,
  every outgoing lower boundary component/.style={draw},
  cobordism  edge/.style={draw},
%   at=(b-outgoing boundary 2),
  at={(0,-6.5)},
  ];
\end{tikzpicture}
\end{document}

通过 3D 手势

相关内容