表中的虚线表示 p{0.5\textwidth} 选项

表中的虚线表示 p{0.5\textwidth} 选项

我正在处理以下文档。如图所示,表格的编译结果很奇怪。我认为这是由于p{0.5\textwidth}选项引起的,但我找不到任何解决方案。我该如何解决这个问题?

\documentclass[12pt]{article}
\usepackage[left=30mm,right=30mm,top=35mm,bottom=30mm]{geometry}
\usepackage{amsmath} % math
\usepackage{amssymb} % math
\usepackage{graphicx} % to use \includegraphics{}
\usepackage{diagbox} % to make tables
\usepackage{multirow}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{bm, array, tabularx, pifont}
\usepackage{apacite}

\begin{document}
\section{Introduction}
\begin{table}[h]
    \begin{tabularx}{\textwidth}{|p{0.5\textwidth}|p{0.5\textwidth}|}
    \hline
    \multicolumn{1}{|c|}{from the textbook}&\multicolumn{1}{c|}{from the articles}\\
    \hline
    \ding{172} p.34 Explaining significance\newline \textbf{fundamental issue}\newline Explaining the mechanisms of high-temperature superconductors has been a fundamental issue after BCS theory proposed in 20th century.& \ding{174} Problem \newline \textbf{ambiguous} \newline For a wave packet with a spread in wavenumber $k$, some \emph{ambiguity} arises in the values of the phase and group velocities because of the spread in $k$, but, for narrow packets in $k$ space, the uncertainties in these values are small \cite{intro1}. \\
    \hline
    \ding{173} p.35 Verbs to present current research\newline \textbf{prove}\newline This paper proves the Riemann-Zeta hypothesis. & \ding{173} Verbs used to present previous research\newline \textbf{indicate} \newline With the increased current, investigations \emph{indicated} that wear is associated with the intensification of the abrasive properties of the metal counterbody surface \cite{intro2}.\\
    \hline
    \ding{174} p.37 Problem\newline \textbf{computationally demanding, an alternative approach}\newline Since the simulation method in the previous researches are \emph{computationally demanding}, \emph{an alternative approach} was needed for this paper.& \ding{175} The present work \newline \textbf{propose, discuss, this paper} \newline \emph{This paper proposes} and \emph{discusses} a definition of internal energy \cite{intro3}.\\
    \hline
    \end{tabularx}

\end{table} 

\bibliography{ref}
\bibliographystyle{apacite}
\end{document}

在此处输入图片描述

答案1

  1. tabularx如果没有柱子就不要使用X

  2. 您应该考虑到列分隔线和垂直线占用空间;您对列的规范0.5\textwidth将遇到问题,因为 0.5+0.5 + 其他存在的分隔线 >1,因此 LaTeX 在适应您的表格时会遇到问题

关于建议:

  1. 删除垂直分隔符,因为它们不好看,没有任何用处并且使表格变得更笨重,不便于阅读。

  2. (建议的解决方案)也取消水平线,以\renewcommand{\arraystretch}{1.5}增强表格行之间的空间

  3. apply@{}可抑制宽表中第一列规范之前和最后一列规范之后的额外间距。这样可以让文本很好地适应。关于何时适合这样做存在争议,它是一种设计选择。

  4. 您还应该考虑将raggedright设置应用于第一列,因为其内容通常难以证明。我将这留作额外的解决方案

  5. 加载booktabs包以获得优雅的规则(toprule midrule bottomrule)来排版您的表格

尽管如此,这里有一些代码:

    \documentclass[12pt]{article}
\usepackage[left=30mm,right=30mm,top=35mm,bottom=30mm]{geometry}
\usepackage{amsmath} % math
\usepackage{amssymb} % math
\usepackage{graphicx} % to use \includegraphics{}
\usepackage{diagbox} % to make tables
\usepackage{multirow}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{bm, array, booktabs, pifont,tabularx}
\usepackage{apacite}
\begin{document}
\section{Introduction}
\begin{table}
\renewcommand{\arraystretch}{1.5}
    \begin{tabularx}{\textwidth}{@{}XX@{}}
    \toprule
        \multicolumn{1}{c}{from the textbook}&\multicolumn{1}{c}{from the articles}\\
    \midrule
    \ding{172} p.34 Explaining significance\newline \textbf{fundamental issue}\newline Explaining the mechanisms of high-temperature superconductors has been a fundamental issue after BCS theory proposed in 20th century.
  & \ding{174} Problem \newline \textbf{ambiguous} \newline For a wave packet with a spread in wavenumber $k$, some \emph{ambiguity} arises in the values of the phase and group velocities because of the spread in $k$, but, for narrow packets in $k$ space, the uncertainties in these values are small \cite{intro1}. \\

    \ding{173} p.35 Verbs to present current research\newline \textbf{prove}\newline This paper proves the Riemann-Zeta hypothesis. 
    & \ding{173} Verbs used to present previous research\newline \textbf{indicate} \newline With the increased current, investigations \emph{indicated} that wear is associated with the intensification of the abrasive properties of the metal counterbody surface \cite{intro2}.\\

    \ding{174} p.37 Problem\newline \textbf{computationally demanding, an alternative approach}\newline Since the simulation method in the previous researches are \emph{computationally demanding}, \emph{an alternative approach} was needed for this paper.& 
    \ding{175} The present work \newline \textbf{propose, discuss, this paper} \newline \emph{This paper proposes} and \emph{discusses} a definition of internal energy \cite{intro3}.\\
    \bottomrule
    \end{tabularx}

\end{table} 

\bibliography{ref}
\bibliographystyle{apacite}
\end{document}

其输出如下:

在此处输入图片描述

第一列右侧参差不齐:

\documentclass[12pt]{article}
\usepackage[left=30mm,right=30mm,top=35mm,bottom=30mm]{geometry}
\usepackage{amsmath} % math
\usepackage{amssymb} % math
\usepackage{graphicx} % to use \includegraphics{}
\usepackage{diagbox} % to make tables
\usepackage{multirow}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{bm, array, booktabs, pifont,tabularx}
\usepackage{apacite}
\begin{document}
\section{Introduction}
\begin{table}
\renewcommand{\arraystretch}{1.5}
    \begin{tabularx}{\textwidth}{@{}>{\raggedright\arraybackslash}XX@{}}
    \toprule
        \multicolumn{1}{c}{from the textbook}&\multicolumn{1}{c}{from the articles}\\
    \midrule
    \ding{172} p.34 Explaining significance\newline \textbf{fundamental issue}\newline Explaining the mechanisms of high-temperature superconductors has been a fundamental issue after BCS theory proposed in 20th century.
  & \ding{174} Problem \newline \textbf{ambiguous} \newline For a wave packet with a spread in wavenumber $k$, some \emph{ambiguity} arises in the values of the phase and group velocities because of the spread in $k$, but, for narrow packets in $k$ space, the uncertainties in these values are small \cite{intro1}. \\

    \ding{173} p.35 Verbs to present current research\newline \textbf{prove}\newline This paper proves the Riemann-Zeta hypothesis. 
    & \ding{173} Verbs used to present previous research\newline \textbf{indicate} \newline With the increased current, investigations \emph{indicated} that wear is associated with the intensification of the abrasive properties of the metal counterbody surface \cite{intro2}.\\

    \ding{174} p.37 Problem\newline \textbf{computationally demanding, an alternative approach}\newline Since the simulation method in the previous researches are \emph{computationally demanding}, \emph{an alternative approach} was needed for this paper.& 
    \ding{175} The present work \newline \textbf{propose, discuss, this paper} \newline \emph{This paper proposes} and \emph{discusses} a definition of internal energy \cite{intro3}.\\
    \bottomrule
    \end{tabularx}

\end{table} 

\bibliography{ref}
\bibliographystyle{apacite}
\end{document}

在此处输入图片描述

答案2

您搞错了用途tabularx。您需要做的只是计算列宽:删除填充和规则宽度。

\documentclass{article}
\usepackage{calc,pifont}

\begin{document}
\section{Introduction}

\noindent
\begin{tabular}{|*{2}{p{0.5\textwidth-2\tabcolsep-1.5\arrayrulewidth}|}}
\hline
\multicolumn{1}{|c|}{from the textbook}&\multicolumn{1}{c|}{from the articles}\\
\hline
\ding{172} p.34 Explaining significance\newline \textbf{fundamental issue}\newline Explaining the mechanisms of high-temperature superconductors has been a fundamental issue after BCS theory proposed in 20th century.& \ding{174} Problem \newline \textbf{ambiguous} \newline For a wave packet with a spread in wavenumber $k$, some \emph{ambiguity} arises in the values of the phase and group velocities because of the spread in $k$, but, for narrow packets in $k$ space, the uncertainties in these values are small \cite{intro1}. \\
\hline
\ding{173} p.35 Verbs to present current research\newline \textbf{prove}\newline This paper proves the Riemann-Zeta hypothesis. & \ding{173} Verbs used to present previous research\newline \textbf{indicate} \newline With the increased current, investigations \emph{indicated} that wear is associated with the intensification of the abrasive properties of the metal counterbody surface \cite{intro2}.\\
\hline
\ding{174} p.37 Problem\newline \textbf{computationally demanding, an alternative approach}\newline Since the simulation method in the previous researches are \emph{computationally demanding}, \emph{an alternative approach} was needed for this paper.& \ding{175} The present work \newline \textbf{propose, discuss, this paper} \newline \emph{This paper proposes} and \emph{discusses} a definition of internal energy \cite{intro3}.\\
\hline
\end{tabular}

\end{document}

在此处输入图片描述

答案3

除了提供的其他答案之外,表格是显示此信息的正确方法吗?一对列表怎么样?这可能会带来更自然和美观的布局。

我很难解释表格中的各个单元格如何链接在一起,但我可能会提出类似的建议:

\begin{itemize}
  \item[] From the textbook
    \item[\ding{172}] p.34 Explaining significance\newline \textbf{fundamental issue}\newline Explaining the mechanisms of high-temperature superconductors has been a fundamental issue after BCS theory proposed in 20th century.
    \item[\ding{173}] p.35 Verbs to present current research\newline \textbf{prove}\newline This paper proves the Riemann-Zeta hypothesis.
    \item[\ding{174}] p.37 Problem\newline \textbf{computationally demanding, an alternative approach}\newline Since the simulation method in the previous researches are \emph{computationally demanding}, \emph{an alternative approach} was needed for this paper.
  \item[] From the articles
    \item[\ding{174}] Problem \newline \textbf{ambiguous} \newline For a wave packet with a spread in wavenumber $k$, some \emph{ambiguity} arises in the values of the phase and group velocities because of the spread in $k$, but, for narrow packets in $k$ space, the uncertainties in these values are small \cite{intro1}.
    \item[\ding{173}] Verbs used to present previous research\newline \textbf{indicate} \newline With the increased current, investigations \emph{indicated} that wear is associated with the intensification of the abrasive properties of the metal counterbody surface \cite{intro2}.
    \item[\ding{175}] The present work \newline \textbf{propose, discuss, this paper} \newline \emph{This paper proposes} and \emph{discusses} a definition of internal energy \cite{intro3}.
\end{itemize}

然后产生 在此处输入图片描述

相关内容