\documentclass{article}
\usepackage{enumitem,amssymb}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{hyperref}
\usepackage{multirow}
\usepackage{xcolor}
\usepackage{array}
\usepackage{makecell}
\usepackage{tabularx}
\usepackage{booktabs}
\newcolumntype{L}{>{\(} l <{\)}}
\begin{document}
\everymath{\displaystyle}
\renewcommand{\arraystretch}{2}
\begin{tabularx}{\textwidth}{|LLL|}
\hline
\sin 2x = 2 \cos x \sin x &
\parbox{101pt}{
\begin{flalign*}
\cos 2x & = \cos^2 x - \sin^2 x \\
& = 2\cos^2 x - 1 \\
& = 1 - 2\sin^2 x
\end{flalign*}
} &
\tan 2x = \frac{2\tan x}{1 - \tan^2 x} \\
\hline
\end{tabularx}
\end{document}
(为了简洁起见,这里只显示代码的重要部分。)
如图所示,我想将所有单元格对齐tabular
到顶部。该怎么做?
注意:我认为需要一个表格,因为我有很多行方程式要显示。见下图。
答案1
你实际上并不需要表格:framed
围绕flalign*
环境的简单环境就可以做到这一点:
\documentclass{article}
\usepackage{enumitem,amssymb}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{hyperref}
\usepackage{multirow}
\usepackage[svgnames]{xcolor}
\usepackage{makecell}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{framed}
\newcolumntype{L}{>{\(} l <{\)}}
\begin{document}
\setlength{\FrameRule}{0.6pt}
\renewcommand{\FrameCommand}{\setlength{\fboxrule}{0.6pt}\fcolorbox{Coral}{white}}
\begin{framed}
\begin{flalign*}
\sin 2x & = 2 \cos x \sin x & \cos 2x & = \cos^2 x - \sin^2 x & \tan 2x & = \smash{\frac{2\tan x}{1 - \tan^2 x}} \\
& & & = 2\cos^2 x - 1 \\
& & & = 1 - 2\sin^2 x
\end{flalign*}
\end{framed}
\end{document}