乳胶小型表对齐

时间:2017-10-18 03:59:58

标签: latex

我试图将Latex文档中的两个表对齐,以便彼此相邻。虽然这是有效的,但表格的位置是关闭的。第一个位于低于第二个: enter image description here

有谁知道如何解决这个问题?以下是我的代码:

\begin{table}[t]
\begin{minipage}{.55\linewidth}
    \begin{tabular}{l|l}
        \multicolumn{1}{c|}{\textbf{WordNet}} & \textbf{FreeBase} \\ \hline
        domain\_region                                      & cause\_of\_death                \\
        domain\_topic                                       & ethnicity                       \\
        has\_instance                                       & gender                          \\
        has\_part                                           & institution                     \\
        member\_holonym                                     & nationality                     \\
        member\_meronym                                     & profession                      \\
        part\_of                                            & religion                        \\
        similar\_to                                         &                                 \\
        subordinate\_instance\_of                           &                                 \\
        synset\_domain\_topic                               &                                 \\
        type\_of                                            &                                
    \end{tabular}
    \label{table1}
    \caption{Relationships in WordNet \& FreeBase KBs}
\end{minipage}%
\begin{minipage}{.5\linewidth}
    \centering
    \begin{tabular}{cccc}
        \multicolumn{4}{c}{\textbf{Holdout Set Construction}}                                   \\
        \multicolumn{2}{c}{\textbf{WordNet}}           & \multicolumn{2}{c}{\textbf{FreeBase}} \\ \hline
        Word Removed & \multicolumn{1}{c|}{\# Triples} & Name Removed        & \# Triples       \\
        adult        & \multicolumn{1}{c|}{166}        & Alan Turing         & 15               \\
        botany       & \multicolumn{1}{c|}{166}        & Carl Sagan          & 18               \\
        building     & \multicolumn{1}{c|}{185}        & Frank Zappa         & 16               \\
        center       & \multicolumn{1}{c|}{180}        & Isaac Asimov        & 20               \\
        form         & \multicolumn{1}{c|}{172}        & John Denver         & 16               \\
        game         & \multicolumn{1}{c|}{267}        & Karl Marx           & 13               \\
        lake         & \multicolumn{1}{c|}{227}        & Mary Astor          & 14               \\
        land         & \multicolumn{1}{c|}{153}        & Su Song             & 13               \\
        mythology    & \multicolumn{1}{c|}{178}        & Tupac Shakur        & 14               \\
        room         & \multicolumn{1}{c|}{189}        & ...                 & ...             
    \end{tabular}
    \caption{Ten words and a sample of 60 names used for constructing Holdout sets for WordNet and FreeBase, respectively. The numbers of triples that each             entity occurs in are listed to the right. These triples comprise the Holdout sets}
    \label{table2}
\end{minipage}
\end{table}

1 个答案:

答案 0 :(得分:1)

您可以尝试使用相同的内容设置tabular,即使某些行可能为空。这将确保它们具有相同的高度:

enter image description here

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[landscape]{geometry}% Just for this example

\usepackage{booktabs}

\begin{document}

\begin{table}
  \mbox{}\hfill
  \begin{minipage}[t]{.48\linewidth}
    \centering{\ttfamily
    \begin{tabular}{ l l }
      \toprule
      \\
      \multicolumn{1}{ c }{\normalfont\bfseries WordNet} & \multicolumn{1}{ c }{\normalfont\bfseries FreeBase} \\
      \midrule
      domain\_region                                      & cause\_of\_death              \\
      domain\_topic                                       & ethnicity                     \\
      has\_instance                                       & gender                        \\
      has\_part                                           & institution                   \\
      member\_holonym                                     & nationality                   \\
      member\_meronym                                     & profession                    \\
      part\_of                                            & religion                      \\
      similar\_to                                         &                               \\
      subordinate\_instance\_of                           &                               \\
      synset\_domain\_topic                               &                               \\
      type\_of                                            &                               \\
      \bottomrule
    \end{tabular}}

    \caption{Relationships in WordNet \& FreeBase KBs.}
  \end{minipage}\hfill
  \begin{minipage}[t]{.48\linewidth}
    \centering
    \begin{tabular}{ c c c c }
      \toprule
      \multicolumn{4}{c}{\bfseries Holdout Set Construction}                                   \\
      \multicolumn{2}{c}{\bfseries WordNet}           & \multicolumn{2}{c}{\bfseries FreeBase} \\
      \midrule
      \itshape Word Removed & \itshape\# Triples & \itshape Name Removed & \itshape \# Triples       \\
      adult        & 166        & Alan Turing         & 15               \\
      botany       & 166        & Carl Sagan          & 18               \\
      building     & 185        & Frank Zappa         & 16               \\
      center       & 180        & Isaac Asimov        & 20               \\
      form         & 172        & John Denver         & 16               \\
      game         & 267        & Karl Marx           & 13               \\
      lake         & 227        & Mary Astor          & 14               \\
      land         & 153        & Su Song             & 13               \\
      mythology    & 178        & Tupac Shakur        & 14               \\
      room         & 189        & \ldots              & \ldots           \\
      \bottomrule
    \end{tabular}

    \caption{Ten words and a sample of 60 names used for constructing Holdout sets for WordNet and FreeBase, 
      respectively. The numbers of triples that each entity occurs in are listed to the right. 
      These triples comprise the Holdout sets.}
  \end{minipage}\hfill
  \mbox{}
\end{table}

\end{document}

我已经

  • fontenc\_ ypewri t er字体(在左侧表格中使用)中生成更好的t;

    < / LI>
  • booktabs提供更好看的表格。

  • \itshape区分右侧表格中的子标题与同一张表格中的其他内容。