tqft 패키지의 경계원에 화살표를 넣는 방법

tqft 패키지의 경계원에 화살표를 넣는 방법

나는 tikz와 tqft를 사용하여 몇 가지 간단한 cobordism을 그리고 있습니다. 들어오고 나가는 원의 방향을 화살촉으로 표시하고 싶습니다. 그렇게 하는 간단한 방법이 있나요?

내가 사용하는 코드는 다음과 같습니다.

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{tikz}
\usepackage{tqft}
\begin{tikzpicture}[tqft/flow=east]
\node[tqft, incoming boundary components=1,
outgoing boundary components=1,draw, boundary lower style={dashed,draw}] at (0,0) {};
\end{tikzpicture}

(더 나은 해상도이지만) 다음을 생성합니다.

실린더

제가 가지고 싶은 화살의 종류는 이 사진과 같습니다. (밝은 녹색 부분만)여기에 이미지 설명을 입력하세요

답변1

새 버전을 업로드했습니다.tqftCTAN(2014년 4월 7일). 이것이 시스템을 통해 전파되면 다음 코드가 작동하여 경계 원의 위쪽 호에 화살표를 배치합니다.

\documentclass{article}
%\url{http://tex.stackexchange.com/q/166698/86}
\usepackage{tikz}
\usetikzlibrary{calc,tqft,decorations.markings}

\begin{document}

\begin{tikzpicture}[every tqft/.style={transform shape},rotate=90]
  \pic[
  tqft,
  incoming boundary components=1,
  outgoing boundary components=1,
  draw,
  every lower boundary component/.style={draw},
  every incoming lower boundary component/.style={dashed,draw},
  every outgoing upper boundary component/.style={
    decorate,
    decoration={
      markings,
      mark=at position .5 with {\arrow{>}},
    },
  },
  every incoming upper boundary component/.style={
    decorate,
    decoration={
      markings,
      mark=at position .5 with {\arrowreversed{>}},
    },
  },
  name=a
];
  \end{tikzpicture}

\end{document}

이를 위해서는 TikZ3.0(또는 그 이상)이 필요합니다. 또한 패키지를 로드하는 방법은 이제 별도의 스타일 파일이 아닌 TikZ 라이브러리로 로드됩니다.

더 큰 화살표를 원할 수도 있지만 이는 별개의 문제입니다.

화살표가 있는 TQFT

답변2

수정된 답변(방법 설명은 아래 원래 답변 참조)

\documentclass{article}
\usepackage{tikz, tqft, graphicx, stackengine}
\parskip 1ex
\begin{document}
\def\figraw{\begin{tikzpicture}[tqft/flow=east]
\node[tqft, incoming boundary components=1,
outgoing boundary components=1,draw, boundary lower style={dashed,draw}] at (0,0) {};
\end{tikzpicture}}
\savestack{\fig}{\figraw}
\def\OUT{-1.60pt}
\def\IN{8.03pt}
\def\WW{1.5pt}
\def\VV{-1.5pt}
\def\VEE{\scalebox{0.6}{$\vee$}}
\def\WEDGE{\scalebox{0.6}{$\wedge$}}
\stackinset{r}{\IN}{c}{\VV}{\VEE}{\fig}\par
\stackinset{l}{\OUT}{c}{\VV}{\VEE}{%
  \stackinset{r}{\IN}{c}{\WW}{\WEDGE}{%
    \fig%
}}\par
\stackinset{l}{\OUT}{c}{\WW}{\WEDGE}{%
  \stackinset{r}{\IN}{c}{\VV}{\VEE}{%
    \fig%
}}\par
\end{document}

여기에 이미지 설명을 입력하세요

그리고 와 같은 구문을 허용하기 위해 매개변수화하는 노력을 기울였으므로 \LeftSideArrow\setoutside\uppointing{\fig}여기에 해당 코드를 표시합니다.

\documentclass{article}
\usepackage{tikz, tqft, graphicx, stackengine}
\parskip 1ex
%
\def\OUT{-1.60pt}
\def\IN{8.03pt}
\def\WW{1.5pt}
\def\VV{-1.5pt}
\def\VEE{\scalebox{0.6}{$\vee$}}
\def\WEDGE{\scalebox{0.6}{$\wedge$}}
%
\def\LeftSideArrowHelper{\stackinset{l}}
\def\RightSideArrowHelper{\stackinset{r}}
\def\setinside{\IN}
\def\setoutside{\OUT}
\def\uppointing{{c}{\WW}{\WEDGE}}
\def\downpointing{{c}{\VV}{\VEE}}
\def\LeftSideArrow{\expandafter\expandafter\expandafter\LeftSideArrowHelper\expandafter}
\def\RightSideArrow{\expandafter\expandafter\expandafter\RightSideArrowHelper\expandafter}

\begin{document}
\def\figraw{\begin{tikzpicture}[tqft/flow=east]
    \node[tqft, incoming boundary components=1,
    outgoing boundary components=1,draw, boundary lower style={dashed,draw}] at (0,0) {};
  \end{tikzpicture}}
\savestack{\fig}{\figraw}

\LeftSideArrow\setoutside\uppointing{%
  \RightSideArrow\setinside\downpointing{%
    \fig}}
\end{document}

원래 답변(OP가 이미지를 게시하기 전)

tikz여기서는 화살표를 만들기 위해 밖에서 작업합니다 . 대신에 \stackinset. 먼저 원시 \stackinset구문을 사용한 다양한 사용 사례를 보여드리겠습니다. 그러나 이것이 일반적으로 발생한다면 MWE 끝부분에 표시된 대로 사용법을 매개변수화할 수 있습니다.

\documentclass{article}
\usepackage{tikz, tqft, graphicx, stackengine}
\parskip 1ex
\begin{document}
\def\fig{\begin{tikzpicture}[tqft/flow=east]
\node[tqft, incoming boundary components=1,
outgoing boundary components=1,draw, boundary lower style={dashed,draw}] at (0,0) {};
\end{tikzpicture}}
\stackinset{r}{-18pt}{c}{-1.8pt}{\scalebox{2.5}{$\rightarrow$}}{\fig}\par
\stackinset{r}{-18pt}{c}{-1.8pt}{\scalebox{2.5}{$\leftarrow$}}{\fig}\par
\stackinset{r}{3pt}{c}{-1.8pt}{\scalebox{2.5}{$\leftarrow$}}{\fig}\par
\stackinset{l}{3pt}{c}{-1.8pt}{\scalebox{2.5}{$\leftarrow$}}{%
  \stackinset{r}{-18pt}{c}{-1.8pt}{\scalebox{2.5}{$\leftarrow$}}{%
    \fig%
}}\par
\stackinset{l}{-18pt}{c}{-1.8pt}{\scalebox{2.5}{$\rightarrow$}}{%
  \stackinset{r}{-18pt}{c}{-1.8pt}{\scalebox{2.5}{$\rightarrow$}}{%
    \fig%
}}\par
If this element were used often, it could be parameterized:
\def\LeftArrow{{\scalebox{2.5}{$\leftarrow$}}}
\def\RightArrow{{\scalebox{2.5}{$\rightarrow$}}}
\edef\insideleft{{l}{3pt}{c}{-1.8pt}}
\edef\outsideleft{{l}{-18pt}{c}{-1.8pt}}
\edef\insideright{{r}{3pt}{c}{-1.8pt}}
\edef\outsideright{{r}{-18pt}{c}{-1.8pt}}
\def\MakeArrow{\expandafter\stackinset}

\MakeArrow\outsideleft\LeftArrow{%
\MakeArrow\outsideright\RightArrow{%
\fig%
}}
\end{document}

여기에 이미지 설명을 입력하세요


tikz이미지를 계속해서 사용한다면 한번 만들어서 박스에 담아두는 것이 시간을 절약해줍니다 . 따라서 이 경우 \def\fig{...}내 MWE의 는 다음으로 대체될 수 있습니다.

\def\figraw{\begin{tikzpicture}[tqft/flow=east]
\node[tqft, incoming boundary components=1,
outgoing boundary components=1,draw, boundary lower style={dashed,draw}] at (0,0) {};
\end{tikzpicture}}
\savestack{\fig}{\figraw}

그런 다음 \fig의 내용물이 들어 있는 기성품 상자로 사용할 수 있습니다 \figraw.


다른 화살표 스타일을 원한다면 mathabx프리앰블에 다음을 삽입하여 스텔스 화살표 글리프를 에서 가져올 수 있습니다.

% Setup the matha font (from mathabx.sty)
\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{
      <5> <6> <7> <8> <9> <10> gen * matha
      <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12
      }{}
\DeclareSymbolFont{matha}{U}{matha}{m}{n}

% Define a subset character from that font (from mathabx.dcl)
% to completely replace the \subset character, you can replace
% \varsubset with \subset

\DeclareMathSymbol{\varleftarrow}{3}{matha}{"D0}
\DeclareMathSymbol{\varrightarrow}{3}{matha}{"D1}

그런 다음 \varleftarrowand \varrightarrow대신 \leftarrowand 를 사용하면 \rightarrow예를 들어 다음과 같은 결과가 생성됩니다.

여기에 이미지 설명을 입력하세요

답변3

다음은 tikz 및 tqft 내의 솔루션입니다. tqft-package 내에 제공된 노드를 사용합니다. 전체 cobordism은 "a"라는 노드입니다. 여기에는 "a.incoming 경계 n"이라는 하위 노드가 있습니다. 여기서 n은 들어오는 경계 원을 열거하고 나가는 경계 원에 대해서도 마찬가지입니다.

불행히도 변위는 손으로 발견되며 tikz의 내부 작동에 대해 전혀 모릅니다. 스케일링이나 다른 것에 어떻게 반응하는지 모르겠습니다. 확실히 좋은 점은 tqft 패키지에 이 작은 화살표를 원에 배치하는 옵션이 있다는 것입니다.

\begin{tikzpicture}[tqft/flow=east]
  \node[tqft, incoming boundary components=1,
  outgoing boundary components=1,draw, boundary lower style={dashed,draw}](a) at (0,0) {};
  \node at ($(a.incoming boundary 1)+(-0.166,0)$) {$\wedge$};
  \node at ($(a.outgoing boundary 1)+(-0.172,0)$) {$\vee$};
  \end{tikzpicture}

관련 정보