
現在、いくつかのゲートとその操作をまとめた表がありますが、場違いな感じがして、フォーマットも正しくありません。画像とテキストを揃える方法をご存知の方はいらっしゃいますか? また、「効果」列では、テキストを上下に並べたいです。以下の LaTex コードと添付の画像をご覧ください。
\begin{figure}
\centering
\begin{threeparttable}
\begin{tabular}{cccc}
%{m{15mm} m{70mm} m{18mm}}
Gates & Circuit Symbol & Matrix Representation & Effect\\
\midrule\midrule
Pauli-X &
\includegraphics[scale = 1 , trim= {50 50 32 25}, clip
]{Chapter2/Figs/Raster/x.png} &
$U(\pi, 0 , \pi) =
\begin{pmatrix}
0 & 1 \\
1& 0
\end{pmatrix}$ &
\begin{itemize}
\item $\emph{X}\ket{0}\longrightarrow\ket{1}$
\item $\emph{X}\ket{1}\longrightarrow\ket{0}$
\end{itemize}
\\%new row
Pauli-Y &
\includegraphics[scale = 1 , trim= {50 50 32 25}, clip
]{Chapter2/Figs/Raster/y.png} &
$U(\pi , \frac{\pi}{2},\frac{\pi}{2}) =
\begin{pmatrix}
0 & -i \\
i & 0
\end{pmatrix}$ &
\begin{itemize}
\item $\emph{Y}\ket{0}\longrightarrow i\ket{1}$
\item $\emph{Y}\ket{1}\longrightarrow-i\ket{0}$,
\end{itemize}
\\%new row
Pauli-Z &
\includegraphics[scale = 1 , trim= {50 50 32 25}, clip
]{Chapter2/Figs/Raster/z.png} &
$U(0 , 0 , \pi) =
\begin{pmatrix}
1 & 0 \\
0 & -1
\end{pmatrix}$ &
\begin{itemize}
\item $\emph{Z}\ket{0}\longrightarrow\ket{0}$
\item $\emph{Z}\ket{1}\longrightarrow-\ket{1}$
\end{itemize}
\\%new row
Hadamard &
\includegraphics[scale = 1 , trim= {50 50 32 25}, clip
]{Chapter2/Figs/Raster/h.png} &
$U(\frac{\pi}{2},0 , \pi) = \frac{1}{\sqrt{2}}
\begin{pmatrix}
1 & 1 \\
1 & -1
\end{pmatrix}$ &
\begin{itemize}
\item $\emph{H}\ket{0}\longrightarrow \frac{1}{\sqrt{2}}(\ket{0}+\ket{1})$
\item $\emph{H}\ket{1}\longrightarrow \frac{1}{\sqrt{2}}(\ket{0}-\ket{1})$ \end{itemize}
\\% end of rows
\midrule\midrule
\end{tabular}
\begin{tablenotes}
\caption{Names, circuit symbols and unitary matrix representation for common single qubit gates.}
\end{tablenotes}
\end{threeparttable}
\end{figure}
答え1
\raisebox{-0.5\height}
表のセル内で画像を垂直に中央揃えにするには、の前にを使用します\includegraphics
。シンプルな表と標準的なサンプル画像を使用した場合、 ありと なしの場合の結果は次のようになります。\raisebox{-0.5\height}
完全なコードは
\documentclass[leqno]{article}
\usepackage{graphicx}
\usepackage{booktabs}
\begin{document}
%
%
\begin{table}
\centering
\caption{Vertical centering of figures in cells.}
\begin{tabular}{lll}
\toprule
Column1 & Column2 & Column3 \\
\midrule
Cols1 & \raisebox{-0.5\height}{\includegraphics[width=2cm]{example-image}} & Cols3 \\
Cols1 & \raisebox{-0.5\height}{\includegraphics[width=4cm]{example-image}} & Cols3 \\
Cols1 & Cols2 & Cols3 \\
\bottomrule
\end{tabular}
\end{table}
%
\begin{table}
\centering
\caption{NO vertical centering of figures in cells.}
\begin{tabular}{lll}
\toprule
Column1 & Column2 & Column3 \\
\midrule
Cols1 & \includegraphics[width=2cm]{example-image} & Cols3 \\
Cols1 & \includegraphics[width=4cm]{example-image} & Cols3 \\
Cols1 & Cols2 & Cols3 \\
\bottomrule
\end{tabular}
\end{table}
%
\end{document}
幸運を!
答え2
valign=c
パッケージに付属している の使用に関する私の提案を以下に示します。また、このテーブル内での使用のためにadjustbox
のカスタマイズ バージョンも追加しました。itemize
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{amsmath}
\usepackage{booktabs}
%\usepackage{threeparttable}
\usepackage{array}
\usepackage{physics}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1}
\setlist[tabitem]{wide=0pt, leftmargin= * ,label=\textbullet}
\begin{document}
\begin{figure}
\centering
% \begin{threeparttable}
\begin{tabular}{cccm{37mm}}
%{m{15mm} m{70mm} m{18mm}}
Gates & Circuit Symbol & Matrix Representation & Effect\\
\midrule\midrule
Pauli-X &
\includegraphics[width=1cm, valign=c]{example-image} &
$U(\pi, 0 , \pi) =
\begin{pmatrix}
0 & 1 \\
1& 0
\end{pmatrix}$ &
\begin{tabitem}
\item $\emph{X}\ket{0}\longrightarrow\ket{1}$
\item $\emph{X}\ket{1}\longrightarrow\ket{0}$
\end{tabitem}
\\%new row
Pauli-Y &
\includegraphics[width=1cm, valign=c]{example-image} &
$U(\pi , \frac{\pi}{2},\frac{\pi}{2}) =
\begin{pmatrix}
0 & -i \\
i & 0
\end{pmatrix}$ &
\begin{tabitem}
\item $\emph{Y}\ket{0}\longrightarrow i\ket{1}$
\item $\emph{Y}\ket{1}\longrightarrow-i\ket{0}$,
\end{tabitem}
\\%new row
Pauli-Z &
\includegraphics[width=1cm, valign=c]{example-image} &
$U(0 , 0 , \pi) =
\begin{pmatrix}
1 & 0 \\
0 & -1
\end{pmatrix}$ &
\begin{tabitem}
\item $\emph{Z}\ket{0}\longrightarrow\ket{0}$
\item $\emph{Z}\ket{1}\longrightarrow-\ket{1}$
\end{tabitem}
\\%new row
Hadamard &
\includegraphics[width=1cm, valign=c]{example-image} &
$U(\frac{\pi}{2},0 , \pi) = \frac{1}{\sqrt{2}}
\begin{pmatrix}
1 & 1 \\
1 & -1
\end{pmatrix}$ &
\begin{tabitem}
\item $\emph{H}\ket{0}\longrightarrow \frac{1}{\sqrt{2}}(\ket{0}+\ket{1})$
\item $\emph{H}\ket{1}\longrightarrow \frac{1}{\sqrt{2}}(\ket{0}-\ket{1})$
\end{tabitem}
\\% end of rows
\midrule\midrule
\end{tabular}
% \begin{tablenotes}
%
%\end{tablenotes}
%\end{threeparttable}
\caption{Names, circuit symbols and unitary matrix representation for common single qubit gates.}
\end{figure}
\end{document}