投影机中的表格和箭头

投影机中的表格和箭头

我只能创建如下表:

\begin{tabular}{|c|c|c|c|c|c|c|}
\hline 
\multicolumn{7}{|c|}{DTE to DEC} \\ 
\hline 
DTE device (Computer) & \multicolumn{2}{|c|}{DB9} & Connection & DTE device (Computer) & \multicolumn{2}{|c|}{DCE device (Modem)} \\ 
\hline 
\multicolumn{3}{|c|}{Pin DB9 R232 Signal name} & Signal Direction & \multicolumn{3}{|c|}{Pin DB9 R232 Signal name} \\
\hline 
\end{tabular}

但是如何设计和创建一个像下图这样带有彩色箭头的表格呢?

在此处输入图片描述

答案1

作为起点:

在此处输入图片描述

\documentclass{beamer}
\usepackage{tikz}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}

\usepackage{makecell}
\begin{document}
\begin{frame}
\frametitle{Modem cable - Straight Cable DB9 to DB9}
\framesubtitle{DTRE to DCE}

\centering
\scriptsize
\setlength\tabcolsep{3pt}
\setcellgapes{3pt}
\makegapedcells
    \begin{tabular}{|c|l|c| c |c|l|c|}
\mc{}   &   \mc{DTE device (Computer)}  &   \mc{DB9}    
    &   \mc{Connection}
        &   \mc{}   &   \mc{DCE device (Modem)}  &   \mc{DB9}                \\
    \hline
\multicolumn{3}{|c|}{Pin DB9 R232 Signal name} 
    &    Direction  
        &   \multicolumn{3}{|c|}{Pin DB9 R232 Signal name}                  \\
    \hline
\#1     &   Carrier Detector (DCD)  &   CD  
    &   \tikz[baseline=-2pt]\draw[ultra thick,blue, <-] (0,0) -- (0.9,0);
        &   \#1 &   Carrier Detector (DCD)  &   CD                          \\
    \hline
\#2     &   Receive Data (Rx)       &   RD
    &   \tikz[baseline=-2pt]\draw[ultra thick,green, <-] (0,0) -- (0.9,0);
        &   \#2 &   Receive Data (Rx)       &   RD                          \\
    \hline
\#3     &   Transmith Data (Rx)     &   RD
    &   \tikz[baseline=-2pt]\draw[ultra thick,red, ->] (0,0) -- (0.9,0);
        &   \#3 &   Transmith Data (Rx)     &   RD                          \\
    \hline
    \end{tabular}
\end{frame}
\end{document}

按照所示方式,您可以写出表格中缺失的行。

相关内容