我一直在尝试复制第 7 页上的一个包含方程式的表格这个文件。我在排版该页面的最后几行时遇到了问题。例如,我不太确定 Parseval 方程的标题如何才能在两列中居中。我用蓝色圈出的部分在我的实现中看起来不对劲。
任何帮助都将不胜感激。谢谢。
答案1
看起来您主要在为如何排版横跨两列表格的两列的材料而苦苦挣扎。在这件事上,您的好帮手命令是\multicolumn{2}{...}{...}
,其中2
是应跨越的列数。请参阅下面的代码,了解三个\multicolumn
调用实例。
\documentclass{article} % or some other suitable document class
\usepackage[hmargin=3cm]{geometry} % set page parameters suitably
\usepackage{mathtools} % for \DeclarePairedDelimiter macro
\DeclarePairedDelimiter\abs\lvert\rvert
\usepackage{amssymb,booktabs}
\usepackage{array}
\newcolumntype{L}{>{\displaystyle}l}
\newcolumntype{C}{>{\displaystyle}c}
\newcommand\angleN{{<}N{>}}
\usepackage{sectsty}
\sectionfont{\centering\large\mdseries\scshape}
\subsectionfont{\large\mdseries\itshape}
\renewcommand{\thesection}{\Roman{section}}
\renewcommand{\thesubsection}{\Alph{subsection}}
% add dots after "numbers" in section and subsection headers
% (method proposed in "The LaTeX Companion", 2nd ed.)
\makeatletter
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
{\csname the#1\endcsname\space}% default
{\csname #1@cntformat\endcsname}}% enable individual control
\newcommand\section@cntformat{\thesection.\space} % section
\newcommand\subsection@cntformat{\thesubsection.\space} % subsection
\makeatother
\newcommand\mytab[1]{\begin{tabular}{@{}l@{}} #1 \end{tabular}}
\begin{document}
\setcounter{section}{2}
\section{Discrete-time Fourier series}
\subsection{Properties of discrete-time Fourier series}
\begin{center}
$\begin{array}{@{} LL @{}}
\toprule
\multicolumn{1}{@{}c}{\textit{Periodic signal}} &
\multicolumn{1}{c@{}}{\textit{Fourier series coefficients}} \\
\midrule
x[n]=\sum_{k=\angleN}a_ke^{jk(2\pi)/N} &
a_k=\frac{1}{N}\sum_{n=\angleN}x[n]e^{-jk(2\pi/N)n} \\
\vdots & \vdots \\
x_{(m)}[n]=\begin{cases}
x[n/m], &\text{if $n$ is a multiple of $m$}\\
\hfill 0,&\text{otherwise}
\end{cases} &
\frac{1}{m}a_k,\quad \text{period $mN$} \\
\vdots & \vdots \\
\addlinespace
\sum_{k=-\infty}^{\infty}x[k] \quad
\mytab{Bounded and periodic\\only if $a_0=0$} &
\frac{1}{1-e^{-jk2\pi/N}} a_k\\
\addlinespace
\multicolumn{2}{c}{\textit{If $x[n]$ is real-valued then}} \\
\addlinespace
x[n] &
\left\{
\begin{aligned}
&a_k = a^*_{-k} \\
&\Re\{a_k\}=\Re\{a_{-k}\} \\
&\Im\{a_k\}=-\Im\{a_{-k}\} \\
&\abs{a_k} = \abs{a_{-k}} \\
&\arg\{a_k\} = -\arg\{a_{-k}\}
\end{aligned}
\right.
\\
\addlinespace
x_e[n] = \mathcal{E}\{x[n]\} &
\Re\{a_k\} \\
x_o[n] = \mathcal{O}\{x[n]\} &
j\Im\{a_k\} \\
\addlinespace
\multicolumn{2}{c}{\textit{Parseval's relation for periodic signals}} \\
\addlinespace
\multicolumn{2}{C}{%
\frac{1}{N}\sum_{n=\angleN} \abs{x[n]}^2 = \sum_{k=\angleN}\abs{a_k}^2} \\
\bottomrule
\end{array}$
\end{center}
\end{document}