
다음 테이블을 만들려고합니다.
그런데 문제는 세 번째 열의 큰 둥근 괄호가 수평선 위에 놓여 있다는 것입니다. 브래킷을 수직으로 쉽게 가운데 정렬할 수 있는 방법이 있습니까?
\begin{tabular}{ |c | c | c|}
\hline
\rowcolor{myblue} \textcolor{white}{Parabola} & \textcolor{white}{Equation of Tangent} & \textcolor{white}{Point of Contact} \\
\rule{0pt}{25pt}\bm{$y^2=4ax$} & \bm{$\displaystyle y=mx+\frac{a}{m}$} & \bm{$\displaystyle \bigg(\frac{a}{m^2},\frac{2a}{m}\bigg)$} \\ \hline
\rule{0pt}{25pt}\bm{$y^2=-4ax$} & \bm{$\displaystyle y=mx-\frac{a}{m}$} & \bm{$\displaystyle \bigg(-\frac{a}{m^2},\frac{2a}{m}\bigg)$} \\ \hline
\rule{0pt}{20pt}\bm{$x^2=4ay$} & \bm{$\displaystyle y=mx-am^2$} & \bm{$\displaystyle \big(2am,am^2\big)$} \\ \hline
\rule{0pt}{20pt}\bm{$x^2=-4ay$} & \bm{$\displaystyle y=mx+am^2$} & \bm{$\displaystyle \big(-2am,-am^2\big)$} \\ \hline
\end{tabular}
답변1
매개변수를 제공 하고 패키지의 길이 와 영감을 받은 것을 {NiceTabular}
사용 하는 것이 좋습니다 .nicematrix
cell-space-bottom-limit
cell-space-top-limit
\cellspacebottomlimit
\cellspacetoplimit
cellspace
{NiceTabular}
colortbl
규칙을 컬러 패널과 함께 사용할 때 PDF 뷰어에서 표준보다 더 나은 결과를 제공하도록 설계되었습니다 . 그러나 여러 가지 편집이 필요합니다.
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{center}
\everymath{\displaystyle}
\NiceMatrixOptions{cell-space-top-limit=2pt,cell-space-bottom-limit=2pt}
\begin{NiceTabular}{ccc}[hvlines,colortbl-like]
\rowcolor{blue!50} \textcolor{white}{Parabola} & \textcolor{white}{Equation of Tangent} & \textcolor{white}{Point of Contact} \\
$y^2=4ax$& $y=mx+\frac{a}{m}$& $\biggl(\frac{a}{m^2},\frac{2a}{m}\biggr)$ \\
$y^2=-4ax$ & $y=mx-\frac{a}{m}$ & $ \biggl(-\frac{a}{m^2},\frac{2a}{m}\biggr)$ \\
$x^2=4ay$ & $y=mx-am^2$& $\bigl(2am,am^2\bigr)$ \\
$x^2=-4ay$ & $y=mx+am^2$& $\bigl(-2am,-am^2\bigr)$ \\
\end{NiceTabular}
\end{center}
\end{document}
답변2
nccmath
, cellspace
및 hhline
패키지를 사용 하고 array
테이블의 경우:
\documentclass{article}
\usepackage{nccmath}
\usepackage[table]{xcolor}
\usepackage{cellspace, hhline}
\setlength\cellspacetoplimit{5pt}
\setlength\cellspacebottomlimit{5pt}
\begin{document}
\[
\begin{array}{ |c | c | >{$}Sc<{$}|}
\hhline{---}
\rowcolor{blue!50}
\text{\textcolor{white}{Parabola}}
& \text{\textcolor{white}{Equation of Tangent}}
& \text{\textcolor{white}{Point of Contact}} \\
\hhline{---}
y^2=4ax
& y=mx+\frac{a}{m}
& \Bigl(\mfrac{a}{m^2},\mfrac{2a}{m}\Bigr) \\ \hhline{---}
y^2=-4ax
& y=mx-\dfrac{a}{m}
& \Bigl(-\mfrac{a}{m^2},\mfrac{2a}{m}\Bigr) \\ \hhline{---}
x^2=4ay
& y=mx-am^2
& \bigl(2am,am^2\bigr) \\ \hhline{---}
{x^2=-4ay}
& y=mx+am^2
& \bigl(-2am,-am^2\bigr) \\ \hhline{---}
\end{array}
\]
\end{document}
부록: 셀의 방정식이 등호 및 쉼표로 정렬되는 버전:
\documentclass{article}
\usepackage{nccmath}
\usepackage[table]{xcolor}
\usepackage{cellspace, hhline}
\setlength\cellspacetoplimit{5pt}
\setlength\cellspacebottomlimit{5pt}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcw{O{>{\color{white}}Sc|}m}
{\multicolumn{2}{#1}{#2}}
\usepackage[skip=1ex]{caption}
\begin{document}
\[
\setlength\arrayrulewidth{0.5pt}
\setlength\arraycolsep{12pt}
\begin{array}{ |r@{\,}l | >{\qquad}r@{\,}l | r@{,\,}>{$}Sl<{$}|}
\hhline{*{6}{-}}
\rowcolor{blue!50}
\mcw[|>{\color{white}}Sc|]{Parabola}
& \mcw{Equation of Tangent}
& \mcw{Point of Contact} \\
\hhline{*{6}{-}}
y^2 & = 4ax
& y & =mx+\frac{a}{m}
& \Bigl(\mfrac{a}{m^2} & \mfrac{2a}{m}\Bigr) \\
\hhline{*{6}{-}}
y^2 & = -4ax
& y & = mx-\dfrac{a}{m}
& \Bigl(-\mfrac{a}{m^2} & \mfrac{2a}{m}\Bigr) \\
\hhline{*{6}{-}}
x^2 & = 4ay
& y & = mx-am^2
& \bigl(2am & am^2\bigr) \\
\hhline{*{6}{-}}
x^2 & = -4ay
& y & = mx+am^2
& \bigl(-2am & -am^2\bigr) \\
\hhline{*{6}{-}}
\end{array}
\]
\end{document}