我正在尝试在 Latex 中复制该文档,但无法实现以下操作:
- 标题为阴影
- 公式的高度非常小并且与公式相交,我想为整个表格设置固定的高度。
- 垂直和水平居中。
请问有什么帮助吗?
输入:
\documentclass{article}[12pt]
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amsthm, amsfonts}
\usepackage{graphicx,colortbl}
\usepackage[lmargin=3.0cm,rmargin=3.0cm,tmargin=2.0cm,bmargin=4.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{\includegraphics[width=50mm]{image.png}}
\chead{{\bf\scshape\large Exercises}\vspace{0.3cm}}
\begin{document}
\thispagestyle{fancy}
\setlength{\headheight}{40pt}
\noindent
Course: \textsc{Analytical mathematics 5}
\begin{center}
TABLA DE TRANSFORMADA DE LAPLACE
\end{center}
\vspace{0.25cm}
\hrule\hrule
\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|}
\hline
& $f(t)=\mathcal{L}^{-1}[F(s)]$ & $F(s)=\mathcal{L}[f(t)]=\displaystyle\int_0^{\infty}f(t)e^{-st}dt$\\
\hline
$1$ & $af(t)+g(t)$ & $aF(s)+bG(s)$\\
\hline
$2$ & $1$ & $\dfrac{1}{s}$\\
\hline
\end{tabular}
\end{table}
\end{document}
输出:
答案1
\documentclass[12pt,a4paper]{article}
\usepackage{tabularray}
\usepackage{amsmath, amsthm, amsfonts,xcolor}
\NewTblrTheme{CaptionWithoutTable}{%
\DeclareTblrTemplate{caption-tag}{default}{}
\DeclareTblrTemplate{caption-sep}{default}{}
\DeclareTblrTemplate{caption-text}{default}{\InsertTblrText{caption}}
}
\begin{document}
\begin{table}[h]
\begin{talltblr}[theme=CaptionWithoutTable,
caption = {TABLA DE TRANSFORMADA DE LAPLACE},
label={tab:my_table}
]{
colspec = {c *{2}{X[c,m]}},
columns = {mode=math},
rows = {3em, m, rowsep=2pt}, %<-- change row height from 3em to anything as required
row{1}={gray8},
rowhead={1},
hlines={solid},
vlines={solid}
}
& f(t)=\mathcal{L}^{-1}[F(s)] & F(s)=\mathcal{L}[f(t)]=\displaystyle\int_0^{\infty}f(t)e^{-st}dt\\
1 & af(t)+g(t) & aF(s)+bG(s)\\
2 & 1 & \dfrac{1}{s}\\
\end{talltblr}
\end{table}
\end{document}
根据需要更新包。
如果您的表格很长且跨越多页,则可以使用longtblr
代替。在这种情况下,删除和并替换为。talltblr
\begin{table}[h]
\end{table}
talltblr
longtblr
答案2
只关注表格......
通过使用该tabularray
包可以轻松获得您想要的东西:
\documentclass{article}[12pt]
\usepackage[hmargin=3.0cm,vmargin={2.0cm,4.5cm}]{geometry}
\usepackage{lmodern}
\usepackage{amsmath, amsthm}
\usepackage{graphicx}
%\usepackage{fancyhdr} %not used in this MWE
%\usepackage{tikz} %loaded by tcolorbox
%\usepackage[most]{tcolorbox} % not used in this MWE
\usepackage{xcolor}
\usepackage{tabularray}
%\renewcommand{\headrulewidth}{0pt}
%\fancyhead[R]{\includegraphics[width=50mm]{example-image-duck}}
%\chead{{\bf\scshape\large Exercises}\vspace{0.3cm}}
\begin{document}
%\thispagestyle{fancy}
%\setlength{\headheight}{40pt}
%\noindent
%Course: \textsc{Analytical mathematics 5}
\begin{center}
TABLA DE TRANSFORMADA DE LAPLACE
\end{center}
\hrule\hrule
\begin{table}[h]
\centering
\begin{tblr}{hlines, vlines,
colspec = {c *{2}{X[c, mode=dmath]}},
row{1} = {bg=gray8, rowsep=5pt},
row{2-Z} = {12mm, % set rows height
rowsep=0pt}
}
& f(t)=\mathcal{L}^{-1}[F(s)]
& F(s)=\mathcal{L}[f(t)]=\displaystyle\int_0^{\infty}f(t)e^{-st}dt \\
1 & af(t)+g(t)
& aF(s)+bG(s) \\
2 & 1
& \dfrac{1}{s} \\
3 & & \\
\end{tblr}
\end{table}
\end{document}
如果您的表格可以放入一页,则此方法有效。如果它太长,则应删除table
并tblr
改用longtblr
:
\begin{longtblr}[
entry=none,
label=none
]{hlines, vlines,
colspec = {c *{2}{X[c, mode=dmath]}},
row{1} = {bg=gray8, rowsep=5pt},
row{2-Z}= {12mm, % set rows height
rowsep=0pt},
rowhead = 1
}