我怎样才能改进这个表格?

我怎样才能改进这个表格?

使用 MikTex/pdfLatex

问题:我该如何改进桌子?

考虑列标题:我想删除表格编号?(即删除“表 0.1”)

考虑列标题:我想让单行列出现在第二行。

考虑第二列:我想在第二行的括号中获取数字。

考虑第三列:所有条目均为 {XXXXX vs YYYYY} 样式。我想让 YYYY 出现在单独的行上。

        \documentclass[letterpaper,10pt]{memoir}
        \usepackage{lipsum}
        \usepackage{enumerate}
    \usepackage{outlines}
    \usepackage{booktabs}

    \begin{document}
    \pagenumbering{gobble}

    \begin{quotation}
    Isay yousay igpay atinlay modi tempora incidunt ut labore et dolore magnam aliquam quaerat.\sourceatright{Maximus Minimus }
    \end{quotation}

    \begin{table}[ht]
    \begin{LARGE}
    \caption{\textsc{\Large{
     Consectetu Neque Porros ab ubi Quisu Dolo Ipsum
    }}}
    \centering
    \end{LARGE}

    \begin{tabular}%
    {p{0.50in}p{0.90in}p{1.50in}p{2.75in}}
    \toprule
    \\
    %Column Headings
    \textbf{Amet} &
    \textbf{Sed (quis)} &
    \textbf{Cumque Voluptas} &
    \textbf{Quis autem vel eum iure reprehenderit qui in ea voluptate}
    \\
    \midrule
    %Row Entries
    1 &
    Culparu &
    Facil vs. laborum & 
    Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
    \tabularnewline
    \\
    2 &
    Laboriosame (2-3) &
    Solentia vs. conse qua turti &
    Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? 
    \tabularnewline
    \\
    3 & 
    Eaque provident (4-5) & 
    Solutanobi vs. animi & 
    Doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo
    \tabularnewline
    \\
    \end{tabular}
    \end{table}
    \end{document}

答案1

您会发现很多空白行,我已将其删除(\\它们是\tabularnewline同一件事),并且不要在标题中添加字体格式,这是不好的风格(并且会弄乱表格列表。为了避免我\caption*从标题包中使用数字,尽管回忆录可能有自己的方式(回忆录对标题包的使用发出警告。)

我曾经tabularx计算过列宽,以便表格适合页面

 \documentclass[letterpaper,10pt]{memoir}
    \usepackage{lipsum,caption}
    \usepackage{enumerate}
\usepackage{outlines}
\usepackage{booktabs,tabularx}

\begin{document}
\pagenumbering{gobble}

\begin{quotation}
Isay yousay igpay atinlay modi tempora incidunt ut labore et dolore magnam aliquam quaerat.\sourceatright{Maximus Minimus }
\end{quotation}


\begin{table}[ht]
\centering
\noindent X\dotfill X


\caption*{Consectetu Neque Porros ab ubi Quisu Dolo Ipsum}

\begin{tabularx}{\textwidth}
{@{}l>{\raggedright}p{0.60in}>{\raggedright}p{1in}X@{}}
\toprule
%Column Headings
\textbf{Amet} &
\textbf{Sed (quis)} &
\textbf{Cumque Voluptas} &
\textbf{Quis autem vel eum iure reprehenderit qui in ea voluptate}
\\
\midrule
%Row Entries
1 &
Culparu &
Facil\\ vs.\\ laborum & 
Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
\\[5pt]
2 &
Labor\-iosame (2-3) &
Solentia\\ vs.\\ conse qua turti &
Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? 
\\[5pt]
3 & 
Eaque provident (4-5) & 
Solutanobi\\ vs.\\ animi & 
Doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo
\end{tabularx}
\end{table}
\end{document}

答案2

你问:

列标题:我想删除表格编号?(即删除“表格 0.1”)

通过加载caption包并写入\caption*{...}而不是\caption{...}

列标题:如何让单行列出现在第二行?

我不确定我是否理解了这个问题。

第二列:如何获取第二行括号中的数字?

第三列:所有条目的样式均为 {XXXXX vs YYYYY} 。如何让 YYYY 出现在单独的行上?

您可以设置自定义tabular环境。在下面的答案中,我设置了一个mysplit仅用于此作业的环境。

另外,我建议您使用tabularx环境而不是基本tabular环境,并使用(自定义版本的)X列类型作为表的最后一列。

在此处输入图片描述

\documentclass[letterpaper,10pt]{memoir}
%%%\usepackage{lipsum}   %%% I've commented out the unneeded packages and macros
%%%\usepackage{enumerate}
%%%\usepackage{outlines}
\usepackage{booktabs}
\usepackage[margin=1in]{geometry}
\usepackage{caption}  % for '\caption*' macro
\usepackage{tabularx} % for 'tabularx' environment
\usepackage{ragged2e} % for '\RaggedRight' macro
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X} % customized form of 'X' column type
\newenvironment{mysplit}%
  {\begin{tabular}[t]{@{}l@{}}}{\end{tabular}}
\begin{document}
\pagenumbering{gobble}

%\begin{quotation}  % have commented out the quotation as well
%Isay yousay igpay atinlay modi tempora incidunt ut labore et dolore magnam aliquam quaerat.\sourceatright{Maximus Minimus }
%\end{quotation}

\begin{table}[ht]
%%%\begin{LARGE}
\captionsetup{font={sc,Large}}  %% separate declaration of caption style
\caption*{Consectetu Neque Porros ab ubi Quisu Dolo Ipsum}
%%%\end{LARGE}

\begin{tabularx}{\textwidth}{@{} p{0.5in} p{1.0in} p{1.50in} Y @{}}
\toprule
%Column Headings
\textbf{Amet} &
\textbf{Sed (quis)} &
\textbf{Cumque Voluptas} &
\textbf{Quis autem vel eum iure reprehenderit qui in ea voluptate}
\\
\midrule
%Row Entries
1 &
Culparu &
\begin{mysplit}Facil vs. \\ laborum \end{mysplit} & 
Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
\\[1\baselineskip]
2 &
\begin{mysplit}Laboriosame\\(2--3)\end{mysplit} &
\begin{mysplit}Solentia vs.\\conse qua turti \end{mysplit}&
Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? 
\\[1\baselineskip]
3 & 
\begin{mysplit}Eaque provident\\ (4--5) \end{mysplit} & 
\begin{mysplit}Solutanobi vs.\\ animi \end{mysplit}& 
Doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo
\\
\end{tabularx}
\end{table}
\end{document}

相关内容