%20(b)-Zeichen%20ganz%20links%20von%20mehreren%20Tikz-Figuren%20haben%3F.png)
Ich möchte das folgende Beispielformat für zwei Tikz-Figuren haben, wobei (a)
und (b)
sich ganz links von ihnen befinden.
Beispielreferenz: Cormen/Einführung in Algorithmen 2022 Seite: 341
Bitte beachten Sie, dass ich nur an der Platzierung der Beschriftungen (a)
, (b)
, (c)
, ... interessiert bin.
Die Lösung, die mir einfällt, ist die Verwendung Wie beschrifte/tagge ich TikZ-Diagramme?. Aber hier war ich nicht in der Lage, die Gleichungsnummern (2)
in (a)
und (3)
in zu ändern (b)
, noch war ich in der Lage, ihre Position ganz nach links zu verschieben.
mein Tex-Code:
\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}
Ausgabe:
gewünschte Ausgabe:
Antwort1
Ich vermute, dass Sie Folgendes erhalten möchten:
Verwendung von @Andrew SwannAntwortDu kannst schreiben:
\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}
Ich frage mich, warum Sie das sidcap
Paket nicht nutzen und zum Beispiel als
\begin{SCfigure}
\includegraphics{image}
\caption{A figure and its caption framed}
\label{fig:test}
\end{SCfigure}
und ändern Sie für sie die Nummerierung der Überschriften auf die gleiche Weise, wie oben beschrieben.
Bearbeiten: Einfacherer Code mit manueller Markierung der Gleichung:
\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}
Das Kompilierungsergebnis ist das gleiche wie zuvor.