複数の tikz 図の左端に (a) (b) 記号を配置するにはどうすればよいですか?

複数の tikz 図の左端に (a) (b) 記号を配置するにはどうすればよいですか?

(a)2 つの tikz 図について、と が(b)最も左側に配置されている次の例の形式を使用します。

参考例: Cormen/アルゴリズム入門 2022 ページ: 341

ここに画像の説明を入力してください

(a)私が興味を持っているのは、、、、... ラベルを配置することだけであることに注意してください(b)(c)


私が思いついた解決策は TikZ 図にラベル/タグを付けるにはどうすればいいですか?しかし、ここでは方程式の番号を(2)(a)に変更することができませんでした。また、それらの位置を一番左側に変更することもできませんでした。(3)(b)

私のTEXコード:

\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}

コンパイル結果は以前と同じです。

関連情報