TikZ 사진과 테이블을 나란히 배치

TikZ 사진과 테이블을 나란히 배치

TikZ 다이어그램과 함께 테이블 형식 환경 테이블을 나란히 배치하고 있습니다. 그러나 이로 인해 이상한 레이아웃 문제가 발생하고 추가 공간이 생성됩니다. 내가 사용하는 코드는 다음과 같습니다.

\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[margin=0.75in]{geometry}
\usepackage{setspace}
\usepackage{chemfig}
\usepackage{adjustbox}
\usepackage[pdfversion=2.0]{hyperref}
\usepackage[numbered]{bookmark}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}

\newcommand{\titlehead}[1]{\begin{center}\pdfbookmark[chapter]{#1}{chapter#1}\section*{#1}\end{center}}
\newcommand{\sectionhead}[1]{\pdfbookmark[section]{#1}{sec#1}\section*{#1}\vspace*{-1em}}
\newcommand{\subsechead}[1]{\pdfbookmark[subsection]{#1}{sec#1}\textbf{\underline{#1}}\vspace*{-0.5em}}
\newenvironment{subcalc}[1]{\vspace{0.1cm}\\\underline{#1}\vspace{0.1cm}\\}{\vspace{0.1cm}}

\doublespacing
\begin{document}

\noindent\subsechead{Sodium Borohydride Product}
\\\begin{tabular}{p {0.5\textwidth} c }
  \vspace{-1em}\hspace{-0.5em}\subcalc{\textsuperscript{1}H NMR Spectroscopy:}
  \begin{tabular}{ l l l l }
    1.36 ppm  & multiplet & 6H & \textcolor{blue}{A} \\
    2.56 ppm  & doublet & 1H & \textcolor{blue}{B} \\
    4.23 ppm  & multiplet & 3H & \textcolor{blue}{C} \\
  \end{tabular} &
  \adjustbox{valign=T}{
    \begin{tikzpicture}
      \node[anchor=south west,inner sep=0] (image) at (0,0) {\chemfig{-[:30](-[::+60]OH)-[:-30]-[:30](=[:90]O)-[:-30]O-[:30]-[:-30]}};
      \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.2,1.14) {D};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.3,-0.23) {B};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.8,0.5) {C};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.12,-0.08) {C};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (-0.14,0) {A};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (1.06,0.06) {A};
      \end{scope}
  \end{tikzpicture}}\\
\end{tabular}

\noindent Lorem ipsum dolor sit amet

\end{document}

이는 다음과 같은 결과를 낳습니다(분자 구조의 불필요한 간격과 이상한 위치에 주목):

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

이것이 내가 원하는 방식입니다:

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

이를 달성하기 위한 어떤 제안이라도 주시면 감사하겠습니다.

답변1

해당 명령을 사용하지 마십시오 \vspace. 패키지 및 tikz 옵션의 m열 지정자를 사용합니다 . 실제 사례:arraybaseline=(current bounding box.west)

\documentclass[12pt,twoside]{report}
\usepackage[margin=0.75in]{geometry}
\usepackage{setspace}
\usepackage{chemfig}
\usepackage{array}
\usepackage[numbered]{bookmark}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\microtypecontext{spacing=nonfrench}
\usepackage{hyperref}
\newcommand{\subsechead}[1]{\pdfbookmark[subsection]{#1}{sec#1}\textbf{\underline{#1}}}
\doublespacing


\begin{document}
\noindent\subsechead{Sodium Borohydride Product}

\noindent\begin{tabular}{@{} m{0.5\textwidth} @{} m{0.5\textwidth} @{}}
\underline{\textsuperscript{1}H NMR Spectroscopy:}
  
\begin{tabular}{ l l l l }
    1.36 ppm  & multiplet & 6H & \textcolor{blue}{A} \\
    2.56 ppm  & doublet & 1H & \textcolor{blue}{B} \\
    4.23 ppm  & multiplet & 3H & \textcolor{blue}{C} \\
  \end{tabular} &
\begin{tikzpicture}[baseline=(current bounding box.west)]
      \node[anchor=south west,inner sep=0] (image) at (0,0) {\chemfig{-[:30](-[::+60]OH)-[:-30]-[:30](=[:90]O)-[:-30]O-[:30]-[:-30]}};
      \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.2,1.14) {D};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.3,-0.23) {B};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.8,0.5) {C};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (0.12,-0.08) {C};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (-0.14,0) {A};
          \node[draw,circle,inner sep=0.75pt,anchor=south west,blue, text=blue] at (1.06,0.06) {A};
      \end{scope}
  \end{tikzpicture}\\
\end{tabular}

\noindent Lorem ipsum dolor sit amet
\end{document}

산출:

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

관련 정보