这是我在这里的第一个问题!:)
我最近开始使用 Latex 工作,我正在编写自己的积分/微分表,我遇到了中间出现空白的问题,我想知道如何删除它。这是它的样子(请记住我创建的红色方块以突出显示我要删除的空间)和我的代码:
\setlength{\columnsep}{3cm}
\begin{multicols}{3}
\begin{center}
\textbf{Derivative} \\ [10pt] $\frac{d}{dx}f(x)$
\end{center}
\columnbreak
\begin{center}
\textbf{Function} \\ [10pt] $f(x)$
\end{center}
\columnbreak
\begin{center}
\textbf{Integral} \\ [10pt] $\int f(x) dx$
\end{center}
\end{multicols}
\noindent\rule{12.8cm}{1pt}
\setlength{\columnsep}{3cm}
\begin{multicols}{3} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{center}
\begin{equation*}
\begin{aligned}
nx^{n-1}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
-\frac{1}{x^{2}}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
e^{x}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
a^{x}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
\frac{1}{x}
\end{aligned}
\end{equation*}
\end{center}
\columnbreak %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{center}
\begin{equation*}
\begin{aligned}
x^{n}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
\frac{1}{x}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
e^{x}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
a^{x}ln(x)
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
ln(x)
\end{aligned}
\end{equation*}
\end{center}
\columnbreak %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{center}
\begin{equation*}
\begin{aligned}
\frac{x^{n+1}}{n+1}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
ln|x|
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
e^{x}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
\frac{a^{x}}{ln(x)}
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
x[ln(x)-1]
\end{aligned}
\end{equation*}
\end{center}
\columnbreak %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{multicols}
答案1
您想使用tabular
或其变体,而不是multicol
。
\documentclass{article}
\usepackage{amsmath}
\usepackage{array,booktabs}
\begin{document}
\begin{center}
\begin{tabular*}{0.6\textwidth}{
@{\extracolsep{\fill}} % spread the columns
*{3}{>{$\displaystyle}c<{\vphantom{\frac{1}{2}}$}} % \vphantom to equalize the row heights
@{} % no space at the end
}
\toprule
\multicolumn{1}{@{}c}{\bfseries Derivative} &
\multicolumn{1}{c}{\bfseries Function} &
\multicolumn{1}{c@{}}{\bfseries Integral} \\
\addlinespace
\frac{d}{dx}f(x) & f(x) & \int f(x)\,dx \\
\addlinespace
\midrule
\addlinespace
nx^{n-1} & x^n & \frac{x^{n+1}}{n+1} \\
\addlinespace
-\frac{1}{x^2} & \frac{1}{x} & \ln\lvert x\rvert \\
\addlinespace
e^x & e^x & e^x \\
\addlinespace
a^x\ln a & a^x & \frac{a^x}{\ln a} \\
\addlinespace
\frac{1}{x} & \ln x & x(\ln x-1) \\
\addlinespace
\bottomrule
\end{tabular*}
\end{center}
\end{document}
我们要求tabular*
TeX 将表格扩展到指定的宽度,这里是整个文本宽度的 70%。
每个单元格都排版为一个数学公式\displaystyle
,但添加了一个“幻影分数”以保持所有行的高度相同。
通过 在行之间添加了一个小但明显的垂直空间\addlinespace
。