%20(b)%20%EA%B8%B0%ED%98%B8%EB%A5%BC%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%ED%91%9C%EC%8B%9C%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%82%98%EC%9A%94%3F.png)
두 개의 tikz 수치에 대해 다음 예제 형식을 갖고 싶습니다. 여기서 (a)
및 (b)
는 가장 왼쪽에 있습니다.
참조 예시: Cormen/알고리즘 소개 2022 페이지: 341
(a)
나는 , (b)
, (c)
, ... 라벨을 배치하는 데에만 관심이 있습니다 .
내가 생각해 낸 해결책은 다음과 같습니다. TikZ 다이어그램에 라벨을 지정/태그하는 방법은 무엇입니까?. 하지만 여기서는 방정식 번호를 과 (2)
로 변경할 수 없었고 위치도 가장 왼쪽으로 변경할 수 없었습니다.(a)
(3)
(b)
내 텍스트 코드:
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{blindtext}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\setcounter{page}{15}
\noindent
\begin{equation}
\begin{tikzcd}
x = 5 * 5; \\
\end{tikzcd}
\end{equation}
into a commutative diagramm
\begin{equation}
\begin{tikzcd}
B\times_A C \arrow{r}{\pi_2}\arrow{d}[swap]{\pi_1} & C\arrow{d}{g} \\
B \arrow{r}[swap]{f} & A;
\end{tikzcd}
\end{equation}
\begin{equation}
\begin{tikzpicture}[compute/.style={draw,thick,font=\sffamily,
append after command={
(\tikzlastnode.south west) edge[double=gray!50,double distance=3pt,
line cap=rect,
shorten >=-2pt,shorten <=-2pt]
(\tikzlastnode.south east)}}]
\node[compute] (n1) {Node};
\node[compute,right=2cm of n1] (n2) {More text};
\draw[thick,-stealth] (n1) -- (n2);
\end{tikzpicture}
\end{equation}
\end{document}
산출:
원하는 출력:
답변1
나는 당신이 다음을 얻고 싶어한다고 추측합니다.
@Andrew Swann 사용답변당신은 쓸 수 있습니다:
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\makeatletter
\newcommand{\leqnos}{\tagsleft@true\let\veqno\@@leqno}
\newcommand{\reqnos}{\tagsleft@false\let\veqno\@@eqno}
\reqnos
\makeatother
\newcounter{eqtn}
\usepackage{tikz-cd}
\usetikzlibrary{positioning}
\begin{document}
\setcounter{page}{15}
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\lipsum[3][1-3]
\begingroup\leqnos
\setcounter{eqtn}{\theequation}
\setcounter{equation}{0}
\renewcommand\theequation{\alph{equation}}
\begin{equation}
\begin{tikzcd}
x = 5 * 5; \\
\end{tikzcd}
\end{equation}
into a commutative diagramm
\begin{equation}
\begin{tikzcd}
B\times_A C \arrow{r}{\pi_2}\arrow{d}[swap]{\pi_1} & C\arrow{d}{g} \\
B \arrow{r}[swap]{f} & A;
\end{tikzcd}
\end{equation}
\begin{equation}
\begin{tikzpicture}[compute/.style={draw,thick,font=\sffamily,
append after command={
(\tikzlastnode.south west) edge[double=gray!50,double distance=3pt,
line cap=rect,
shorten >=-2pt,shorten <=-2pt]
(\tikzlastnode.south east)}}]
\node[compute] (n1) {Node};
\node[compute,right=2cm of n1] (n2) {More text};
\draw[thick,-stealth] (n1) -- (n2);
\end{tikzpicture}
\end{equation}
\setcounter{equation}{\theeqtn}
\endgroup
\lipsum[66]
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\end{document}
sidcap
왜 패키지를 사용하지 않고 예를 들어 다음과 같이 사용하는지 궁금합니다 .
\begin{SCfigure}
\includegraphics{image}
\caption{A figure and its caption framed}
\label{fig:test}
\end{SCfigure}
위와 비슷한 방식으로 캡션 번호 매기기를 변경합니다.
편집하다: 방정식에 수동으로 태그를 지정하는 더 간단한 코드:
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\makeatletter
\newcommand{\leqnos}{\tagsleft@true\let\veqno\@@leqno}
\newcommand{\reqnos}{\tagsleft@false\let\veqno\@@eqno}
\reqnos
\makeatother
\usepackage{tikz-cd}
\usetikzlibrary{positioning}
\begin{document}
\setcounter{page}{15}
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\lipsum[1][1-3]
\begingroup\leqnos
\begin{equation}
\begin{tikzcd}
x = 5 * 5; \tag{a}\\
\end{tikzcd}
\end{equation}
into a commutative diagramm
\begin{equation}
\begin{tikzcd}
B\times_A C \arrow{r}{\pi_2}\arrow{d}[swap]{\pi_1} & C\arrow{d}{g} \\
B \arrow{r}[swap]{f} & A;
\end{tikzcd} \tag{b}
\end{equation}
\begin{equation}
\begin{tikzpicture}[compute/.style={draw,thick,font=\sffamily,
append after command={
(\tikzlastnode.south west) edge[double=gray!50,double distance=3pt,
line cap=rect,
shorten >=-2pt,shorten <=-2pt]
(\tikzlastnode.south east)}}]
\node[compute] (n1) {Node};
\node[compute,right=2cm of n1] (n2) {More text};
\draw[thick,-stealth] (n1) -- (n2);
\end{tikzpicture} \tag{a}
\end{equation}
\endgroup
\lipsum[66]
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\end{document}
컴파일 결과는 이전과 동일합니다.