#Struggling with TikZ positioning
1 messages · Page 1 of 1 (latest)
When i adjust the second number of the node, it doesn't move it in the y-direction as expected and instead changes the x-direction
\setchemfig{%
atom sep = 1.75em,
stack sep = 0.3em,% dim for chemabove and below
bond offset = 1.25pt,
double bond sep = .25em
}
\begin{tabular}{p {0.5\textwidth} c }
\noindent\begin{tabular}{ l l l l }
3.39 ppm & triplet & 2H & \textcolor{blue}{A} \\
3.61 ppm & triplet & 2H & \textcolor{blue}{B} \\
\end{tabular} &
\adjustbox{valign=T}{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\chemfig{-[:-30]-[:30]-[:-30]-[:30]Cl}};
\node[anchor=south west,inner sep=0] (image) at (3,0) {\chemfig{-[:-30]-[:30]-[:-30]-[:30]Br}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\footnotesize
\node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.83,0) {A};
\node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0,0) {B};
\end{scope}
\end{tikzpicture}}\\
\end{tabular}```
\setchemfig{%
atom sep = 1.75em,
stack sep = 0.3em,% dim for chemabove and below
bond offset = 1.25pt,
double bond sep = .25em
}
\begin{tabular}{p {0.5\textwidth} c }
\noindent\begin{tabular}{ l l l l }
3.39 ppm & triplet & 2H & \textcolor{blue}{A} \\
3.61 ppm & triplet & 2H & \textcolor{blue}{B} \\
\end{tabular} &
\adjustbox{valign=T}{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\chemfig{-[:-30]-[:30]-[:-30]-[:30]Cl}};
\node[anchor=south west,inner sep=0] (image) at (3,0) {\chemfig{-[:-30]-[:30]-[:-30]-[:30]Br}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\footnotesize
\node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.83,0.1) {A};
\node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0,0) {B};
\end{scope}
\end{tikzpicture}}\\
\end{tabular}```
Notice how the (A) moved to the right instead of moving up as expected
I finally got it how i wanted it but it took a lot of trial and error
\begin{tabular}{p {0.5\textwidth} c }
\noindent\begin{tabular}{ l l l l }
3.39 ppm & triplet & 2H & \textcolor{blue}{A} \\
3.61 ppm & triplet & 2H & \textcolor{blue}{B} \\
\end{tabular} &
\adjustbox{valign=T}{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\chemfig{-[:-30]-[:30]-[:-30]-[:30]Cl}};
\node[anchor=south west,inner sep=0] (image) at (3,0) {\chemfig{-[:-30]-[:30]-[:-30]-[:30]Br}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\footnotesize
\node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.5,0.6) {A};
\node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0,0.57) {B};
\end{scope}
\end{tikzpicture}}\\
\end{tabular}```
Fanman03
hmm, this looks very convoluted