表格不需要的填充

表格不需要的填充

我希望我的文档是一份很长(多页)的定义列表。我想以表格格式进行。这是我目前所拥有的:

\documentclass{article}

\usepackage{fancyhdr}
\usepackage{array}
\usepackage{tabularx}
\usepackage{pbox}
\pagestyle{fancyplain}

\title{Definitions \\ \large{G484 - Newtonian World}}
\author{Todd Davies}
\date{\today}

\begin{document}

\rhead{Definitions}
\lhead{\today}

\maketitle

\thispagestyle{empty}

\begin{tabularx}{\textwidth}{>{\bf\centering\arraybackslash}m{1in} | X}
  \large{Name} & \large{\textbf{Definition}}\\ \hline
  Newton's first law & An object will remain at rest or keep 
    travelling at a constant velocity unless it is acted upon by an external 
    force.\\ \hline
  Newton's second law & The net force acting on an object is equal
    to the rate of change of it's momentum. The net force and change in momentum
    are in the same direction.\\ \hline
  Newton's third law & When two bodies interact, the forces they
    exert on each other are equal and opposite.\\ \hline
  Linear momentum & The product of an object's mass and velocity
    ($p=mv$). Momentum is a vector quantity.\\ \hline
  Net force on a body & Is said to be equal to the rate of change
    of the momentum of the body (Impulse).\\ \hline
  Impulse of a force & The product of the force ($F$) and the time ($\Delta t$)
    for which it acts ($impulse = F \Delta t$).\newline \newline This is the
    area under a force time graph.\newline \newline Impulse = change in momentum
    ($impulse = \Delta p$)\\ \hline
  Principle of conservation of momentum & In a closed system, when bodies
    interact, the total momentum in any specified direction remains constant.\\
    \hline
  Perfectly elastic collision & A collision is perfectly elastic
    when kinetic energy is conserved. Momentum and total energy are always
    conserved.\\ \hline
  Inelastic collision & A collision is inelastic when the kinetic
    energy is not conserved, and some is transferred to other forms such as
    heat. Momentum and total energy are always conserved.\\ \hline
  Radian & $\pi$ radians = $180^\circ$\\ \hline
  Gravitational field strength & The gravitational force 
    experienced by an object per unit mass ($g = \frac{F}{m}$).\\ \hline
  Newton's law of gravitation & Any two point masses attract each other with a force that is directly proportional to the square of their masses and inversely proportional to the square of their seperation\\ \hline
\end{tabularx}

\end{document}

这是输出:在此处输入图片描述

我有两个问题

  1. 我希望表格跨越多页。这似乎没有发生
  2. 注意,当左侧的单元格跨多行时,右列单元格的顶部填充会发生变化。如何消除这种情况?

我怀疑我做错了所有事情,并且愿意接受关于如何实现我想要的布局或只是解决这两个问题的新建议。

非常感谢!

答案1

使用longtablecalc包装。

在此处输入图片描述

\documentclass{article}

\usepackage{fancyhdr}
\usepackage{array}
\usepackage{longtable}
\usepackage{calc}
\pagestyle{fancyplain}

\title{Definitions \\ \large{G484 - Newtonian World}}
\author{Todd Davies}
\date{\today}

\begin{document}

\rhead{Definitions}
\lhead{\today}

\maketitle

\thispagestyle{empty}

\begin{longtable}{>{\bf\centering\arraybackslash}p{1in} | p{\textwidth-4\tabcolsep-1in}}
  \large{Name} & \large{\textbf{Definition}}\\ \hline
  Newton's first law & An object will remain at rest or keep 
    travelling at a constant velocity unless it is acted upon by an external 
    force.\\ \hline
  Newton's second law & The net force acting on an object is equal
    to the rate of change of it's momentum. The net force and change in momentum
    are in the same direction.\\ \hline
  Newton's third law & When two bodies interact, the forces they
    exert on each other are equal and opposite.\\ \hline
  Linear momentum & The product of an object's mass and velocity
    ($p=mv$). Momentum is a vector quantity.\\ \hline
  Net force on a body & Is said to be equal to the rate of change
    of the momentum of the body (Impulse).\\ \hline
  Impulse of a force & The product of the force ($F$) and the time ($\Delta t$)
    for which it acts ($impulse = F \Delta t$).\newline \newline This is the
    area under a force time graph.\newline \newline Impulse = change in momentum
    ($impulse = \Delta p$)\\ \hline
  Principle of conservation of momentum & In a closed system, when bodies
    interact, the total momentum in any specified direction remains constant.\\
    \hline
  Perfectly elastic collision & A collision is perfectly elastic
    when kinetic energy is conserved. Momentum and total energy are always
    conserved.\\ \hline
  Inelastic collision & A collision is inelastic when the kinetic
    energy is not conserved, and some is transferred to other forms such as
    heat. Momentum and total energy are always conserved.\\ \hline
  Radian & $\pi$ radians = $180^\circ$\\ \hline
  Gravitational field strength & The gravitational force 
    experienced by an object per unit mass ($g = \frac{F}{m}$).\\ \hline
  Newton's law of gravitation & Any two point masses attract each other with a force that is directly proportional to the square of their masses and inversely proportional to the square of their seperation\\ \hline
\end{longtable}

\end{document}

进行了一些改进,使用booktabshline来替换midrule

在此处输入图片描述

\documentclass{article}

\usepackage{fancyhdr}
\usepackage{array}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{calc}
\pagestyle{fancyplain}

\title{Definitions \\ \large{G484 - Newtonian World}}
\author{Todd Davies}
\date{\today}

\begin{document}

\rhead{Definitions}
\lhead{\today}

\maketitle

\thispagestyle{empty}

\begin{longtable}{>{\bf\centering\arraybackslash}p{1in} p{\textwidth-4\tabcolsep-1in}}

\large{Name} & \large{\textbf{Definition}}\\ \midrule
\endfirsthead
\large{Name} & \large{\textbf{Definition}}\\ \midrule
\endhead
\bottomrule
\multicolumn{2}{r}{continued \ldots}
\endfoot
\bottomrule
\endlastfoot

  Newton's first law & An object will remain at rest or keep 
    travelling at a constant velocity unless it is acted upon by an external 
    force.\\ \midrule
  Newton's second law & The net force acting on an object is equal
    to the rate of change of it's momentum. The net force and change in momentum
    are in the same direction.\\ \midrule
  Newton's third law & When two bodies interact, the forces they
    exert on each other are equal and opposite.\\ \midrule
  Linear momentum & The product of an object's mass and velocity
    ($p=mv$). Momentum is a vector quantity.\\ \midrule
  Net force on a body & Is said to be equal to the rate of change
    of the momentum of the body (Impulse).\\ \midrule
  Impulse of a force & The product of the force ($F$) and the time ($\Delta t$)
    for which it acts ($impulse = F \Delta t$).\newline \newline This is the
    area under a force time graph.\newline \newline Impulse = change in momentum
    ($impulse = \Delta p$)\\ \midrule
  Principle of conservation of momentum & In a closed system, when bodies
    interact, the total momentum in any specified direction remains constant.\\
    \midrule
  Perfectly elastic collision & A collision is perfectly elastic
    when kinetic energy is conserved. Momentum and total energy are always
    conserved.\\ \midrule
  Inelastic collision & A collision is inelastic when the kinetic
    energy is not conserved, and some is transferred to other forms such as
    heat. Momentum and total energy are always conserved.\\ \midrule
  Radian & $\pi$ radians = $180^\circ$\\ %\midrule
  Gravitational field strength & The gravitational force 
    experienced by an object per unit mass ($g = \frac{F}{m}$).\\ \midrule
  Newton's law of gravitation & Any two point masses attract each other with a force that is directly proportional to the square of their masses and inversely proportional to the square of their seperation\\
\end{longtable}

\end{document}

答案2

我认为另一个答案给出了您最初想要表达的意思。

然而,对于你的任务,我倾向于使用一个简单的itemize环境,并使用enumitem以帮助格式化。

截屏

我用过

\begin{itemize}[font=\bfseries,align=parleft,labelwidth=3cm]

在下面的 MWE 中,但你可以使用

\setlist[itemize]{font=\bfseries,align=parleft,labelwidth=3cm}

在你的序言中,然后简单地

\begin{itemize}

在您的文档中 - 选择权在您手中。

\documentclass{article}
\usepackage{enumitem}
\usepackage{fancyhdr}

\title{Definitions \\ \large{G484 - Newtonian World}}
\author{Todd Davies}
\date{\today}

\begin{document}

\rhead{Definitions}
\lhead{\today}

\maketitle

\thispagestyle{empty}

\begin{itemize}[font=\bfseries,align=parleft,labelwidth=3cm]
    \item[Name] {\bfseries Definition}
    \item[Newton's first law] An object will remain at rest or keep 
    travelling at a constant velocity unless it is acted upon by an external 
    force.
    \item[Newton's second law] The net force acting on an object is equal
    to the rate of change of it's momentum. The net force and change in momentum
    are in the same direction.
    \item[Newton's third law] When two bodies interact, the forces they
    exert on each other are equal and opposite.
    \item[Linear momentum]  The product of an object's mass and velocity
    ($p=mv$). Momentum is a vector quantity.
    \item[Net force on a body] Is said to be equal to the rate of change
    of the momentum of the body (Impulse).
    \item[Impulse of a force] The product of the force ($F$) and the time ($\Delta t$)
    for which it acts ($impulse = F \Delta t$).

    This is the area under a force time graph.

    Impulse = change in momentum
    ($impulse = \Delta p$)
    \item[Principle of conservation of momentum] In a closed system, when bodies
    interact, the total momentum in any specified direction remains constant.
    \item[Perfectly elastic collision] A collision is perfectly elastic
    when kinetic energy is conserved. Momentum and total energy are always
    conserved.
    \item[Inelastic collision] A collision is inelastic when the kinetic
    energy is not conserved, and some is transferred to other forms such as
    heat. Momentum and total energy are always conserved.
    \item[Radian] $\pi$ radians = $180^\circ$
    \item[Gravitational field strength] The gravitational force 
    experienced by an object per unit mass ($g = \frac{F}{m}$).
    \item[Newton's law of gravitation] Any two point masses attract each other with a 
    force that is directly proportional to the square of their masses and 
    inversely proportional to the square of their seperation.
\end{itemize}

\end{document}

相关内容