我正在尝试整理我的表格。我有 4 个表格,想将它们并排摆放,每个表格都有不同的标题,整个组都有一个名称。我尝试使用 \minipage 和 subcaption,但没有成功。我想分别为它们使用这些标题。
Maximum value of $y_{2} $
Mean value of $y_{2}$
Median value of $y_{2} $
Equilibrium value of $y_{2}$
我的桌子是:
\documentclass[14pt, a4paper, twoside]{report} % 'twoside' when printing
\usepackage[utf8]{inputenc} % UTF-8 input
\usepackage[english]{babel} % Set language to english
\usepackage{blindtext} % Use \Blinddocument or \blindmathpaper
\usepackage{graphicx}
\graphicspath{ {/Users/farha/Documents/Master_oppgave/images/} } % For graphics
\usepackage{fancyhdr} % Fancy headers
\usepackage{hyperref} % Internal and external hyperlinks
\usepackage{amsmath} % Math from AMS
\usepackage{amsfonts} % Fonts from AMS
\usepackage{amsthm} % Theorems
\usepackage{amssymb} % Symbols
\usepackage{enumitem} % Enumeration
\usepackage{mathtools} % Bonus
\usepackage{color} % Colors
\usepackage{booktabs} % Professional tables
\usepackage{pdfpages} % To include PDFs
\usepackage{parskip}
\usepackage{multicol} % For multiple columns
\usepackage[sharp]{easylist} % For easy lists
\usepackage{makeidx} % For the index
\usepackage[linesnumbered,ruled]{algorithm2e} % For algorithms
\usepackage{tikz-cd} % For diagrams
\usepackage{listings} % To include Python-code
\usepackage{etoolbox} % To add symbol at end of examples
\usepackage[expansion=false]{microtype} % Fixes to make typography better
\usepackage[toc, page]{appendix} % To include appendices
%\usepackage[headings]{fullpage} % Smaller margins
\usepackage[margin = 3cm, includehead, includefoot]{geometry}
%\usepackage[sc]{mathpazo} % A nice font, alternative to CM
\usepackage{framed} % To frame comments
\usepackage{multirow} % For multiple rows in tables
\usepackage{afterpage} % To insert blank pages
\usepackage{blindtext} % To insert some blind text
\usepackage{graphics}
\usepackage{xcolor}
\usepackage{gensymb}
\usepackage{bm}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{physics}
\usepackage[makeroom]{cancel}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{xpatch,amsthm}
\usepackage{fourier, erewhon}
\usepackage{geometry}
\usepackage{array, caption, floatrow, tabularx, makecell, booktabs}%
\captionsetup{labelfont = sc}
\setcellgapes{3pt}
\usepackage{subcaption}
\makeatletter
\xpatchcmd{\@thm}{\fontseries\mddefault\upshape}{}{}{} % same font as thm-header
\makeatother
\newtheorem{theorem}{Theorem}[section]
\theoremstyle{plain}
%\newtheorem{thm}{Theorem}[chapter] % reset theorem numbering for each chapter
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{remark}
\newtheorem*{remark}{Remark}
%\newtheorem{exmp}[thm]{Example} % same for example numbers
\theoremstyle{plain}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{plain}
\newtheorem{prop}{Proposition}
\makeatletter
\def\th@plain{%
\thm@notefont{}% same as heading font
\itshape % body font
}
\def\th@definition{%
\thm@notefont{}% same as heading font
\normalfont % body font
}
\makeatother
\usepackage{array}
% Center the table horizontally
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
% Center the table vertically
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
% Center the table horizontally and vertically
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
%\usepackage[norsk]{babel}
%\newtheorem{theorem}{Theorem}
%\theoremstyle{definition}
%\newtheorem{definition}{Definition}[section]
% Custom mathematics commands
\newcommand{\DIV}{\div}
\newcommand{\BP}{\left<BP\right>}
\newcommand{\Bzero}{\left<Bzero\right>}
\newcommand{\BQ}{\left<BQ\right>}
\newcommand{\p}{\left<p\right>}
\newcommand{\BF}{\left<BF\right>}
\newcommand{\vect}[1]{\boldsymbol{#1}}
\newcommand*\conj[1]{\overline{#1}}
\DeclarePairedDelimiterX{\innerprod}[2]{\langle}{\rangle}{#1, #2}
\DeclareMathOperator{\lcm}{lcm}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\C}{\mathbb{C}}
\DeclareMathOperator{\R}{\mathbb{R}}
\DeclareMathOperator{\Z}{\mathbb{Z}}
\DeclareMathOperator{\conv}{\ast}
\DeclareMathOperator{\GL}{\operatorname{GL}}
\makeatletter
\newenvironment{xvmatrix}% eXtended vmatrix
{\left.\array{@{}r |@{\,}*\c@MaxMatrixCols c}}
{\endarray\kern-\arraycolsep\right|}
% A command to add a blank page
\newcommand\blankpage{%
\null
\newpage}
% Header set up with fancyhdr
\lhead[\nouppercase{\leftmark}]{\thepage} % EVEN, ODD
\rhead[\thepage]{\nouppercase{\rightmark}} % EVEN, ODD
\cfoot[]{}
\pagestyle{fancy}
\fancypagestyle{normal}{%
% Header set up with fancyhdr
\lhead[\nouppercase{\leftmark}]{\thepage} % EVEN, ODD
\rhead[\thepage]{\nouppercase{\rightmark}} % EVEN, ODD
\cfoot[]{}}
\fancypagestyle{noheadername}{%
% Header set up with fancyhdr
\lhead[]{\thepage} % EVEN, ODD
\rhead[\thepage]{} % EVEN, ODD
\cfoot[]{}}
% Declare first page in every chapter as 'fancy' pagestyle
\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{fancy}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$x_{0}$ & 0.999098 \\
$\omega_{11}$ & 0.000131 \\
$\omega_{22}$ & 0.000091 \\
$\phi_{12}$ & 0.000022 \\
$\beta_{2}$ & 0.000015 \\
${y_{1}}_{0}$ & -0.000019 \\
$\epsilon_{1}$ & -0.000075 \\
${y_{2}}_{0}$ & -0.000094 \\
$f_{1}$ & -0.000113 \\
$r$ & -0.000150 \\
$f_{2}$ & -0.000154 \\
$\beta_{1}$ & -0.000157 \\
$\epsilon_{2}$ & -0.000161 \\
$\psi_{12}$ & -0.000218 \\
$k$ & -0.000295 \\
\bottomrule
\end{tabular}
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$f_{2}$ & 0.032545 \\
$f_{1}$ & 0.006636 \\
$\beta_{1}$ & 0.003933 \\
$r$ & 0.000856 \\
$\beta_{2}$ & 0.000193 \\
$\omega_{22}$ & 0.000160 \\
$\psi_{12}$ & 0.000151 \\
$x_{0}$ & 0.000126 \\
$\epsilon_{1}$ & 0.000117 \\
$\omega_{11}$ & 0.000025 \\
${y_{1}}_{0}$ & -0.000004 \\
${y_{2}}_{0}$ & -0.000096 \\
$\phi_{12}$ & -0.000140 \\
$\epsilon_{2}$ & -0.000157 \\
$k$ & -0.000176 \\
\bottomrule
\end{tabular}
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$f_{2}$ & 0.028406 \\
$f_{1}$ & 0.006187 \\
$\beta_{1}$ & 0.003582 \\
$r$ & 0.000620 \\
$\omega_{22}$ & 0.000150 \\
$\epsilon_{1}$ & 0.000113 \\
$\psi_{12}$ & 0.000108 \\
$\beta_{2}$ & 0.000031 \\
$\omega_{11}$ & 0.000024 \\
$x_{0}$ & 0.000011 \\
${y_{1}}_{0}$ & -0.000001 \\
${y_{2}}_{0}$ & -0.000114 \\
$\phi_{12}$ & -0.000135 \\
$\epsilon_{2}$ & -0.000163 \\
$k$ & -0.000168 \\
\bottomrule
\end{tabular}
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$f_{2}$ & 0.007005 \\
$f_{1}$ & 0.001013 \\
$\beta_{1}$ & 0.000588 \\
$r$ & 0.000264 \\
$\psi_{12}$ & 0.000079 \\
$\omega_{11}$ & 0.000073 \\
$\epsilon_{1}$ & 0.000062 \\
$\epsilon_{2}$ & 0.000015 \\
${y_{2}}_{0}$ & 0.000009 \\
$x_{0}$ & 0.000005 \\
$\omega_{22}$ & 0.000003 \\
$k$ & -0.000021 \\
$\beta_{2}$ & -0.000063 \\
$\phi_{12}$ & -0.000086 \\
${y_{1}}_{0}$ & -0.000090 \\
\bottomrule
\end{tabular}
\结束{文档}
答案1
我尝试过subcaption
并且它确实有效。
\documentclass{article}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{subcaption}
\begin{document}
\begin{table}[h]
\centering
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$x_{0}$ & 0.999098 \\
$\omega_{11}$ & 0.000131 \\
$\omega_{22}$ & 0.000091 \\
$\phi_{12}$ & 0.000022 \\
$\beta_{2}$ & 0.000015 \\
${y_{1}}_{0}$ & -0.000019 \\
$\epsilon_{1}$ & -0.000075 \\
${y_{2}}_{0}$ & -0.000094 \\
$f_{1}$ & -0.000113 \\
$r$ & -0.000150 \\
$f_{2}$ & -0.000154 \\
$\beta_{1}$ & -0.000157 \\
$\epsilon_{2}$ & -0.000161 \\
$\psi_{12}$ & -0.000218 \\
$k$ & -0.000295 \\
\bottomrule
\end{tabular}
\caption{Maximum value of $y_{2}$.}
\end{subtable}\hfill
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$f_{2}$ & 0.032545 \\
$f_{1}$ & 0.006636 \\
$\beta_{1}$ & 0.003933 \\
$r$ & 0.000856 \\
$\beta_{2}$ & 0.000193 \\
$\omega_{22}$ & 0.000160 \\
$\psi_{12}$ & 0.000151 \\
$x_{0}$ & 0.000126 \\
$\epsilon_{1}$ & 0.000117 \\
$\omega_{11}$ & 0.000025 \\
${y_{1}}_{0}$ & -0.000004 \\
${y_{2}}_{0}$ & -0.000096 \\
$\phi_{12}$ & -0.000140 \\
$\epsilon_{2}$ & -0.000157 \\
$k$ & -0.000176 \\
\bottomrule
\end{tabular}
\caption{Mean value of $y_{2}$.}
\end{subtable}\hfill
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$f_{2}$ & 0.028406 \\
$f_{1}$ & 0.006187 \\
$\beta_{1}$ & 0.003582 \\
$r$ & 0.000620 \\
$\omega_{22}$ & 0.000150 \\
$\epsilon_{1}$ & 0.000113 \\
$\psi_{12}$ & 0.000108 \\
$\beta_{2}$ & 0.000031 \\
$\omega_{11}$ & 0.000024 \\
$x_{0}$ & 0.000011 \\
${y_{1}}_{0}$ & -0.000001 \\
${y_{2}}_{0}$ & -0.000114 \\
$\phi_{12}$ & -0.000135 \\
$\epsilon_{2}$ & -0.000163 \\
$k$ & -0.000168 \\
\bottomrule
\end{tabular}
\caption{Median value of $y_{2}$.}
\end{subtable}\hfill
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & $S_{1}$ \\
\midrule
$f_{2}$ & 0.007005 \\
$f_{1}$ & 0.001013 \\
$\beta_{1}$ & 0.000588 \\
$r$ & 0.000264 \\
$\psi_{12}$ & 0.000079 \\
$\omega_{11}$ & 0.000073 \\
$\epsilon_{1}$ & 0.000062 \\
$\epsilon_{2}$ & 0.000015 \\
${y_{2}}_{0}$ & 0.000009 \\
$x_{0}$ & 0.000005 \\
$\omega_{22}$ & 0.000003 \\
$k$ & -0.000021 \\
$\beta_{2}$ & -0.000063 \\
$\phi_{12}$ & -0.000086 \\
${y_{1}}_{0}$ & -0.000090 \\
\bottomrule
\end{tabular}
\caption{Equilibrium value of $y_{2}$.}
\end{subtable}
\caption{Blub.}
\end{table}
\end{document}
当然,我们可以通过在数学模式下排版数值来改进这一点(也许使用siunitx
)。
\documentclass{article}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{subcaption}
\begin{document}
\begin{table}[h]
\centering
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
$x_{0}$ & $ 0.999098$\\
$\omega_{11}$ & $ 0.000131$\\
$\omega_{22}$ & $ 0.000091$\\
$\phi_{12}$ & $ 0.000022$\\
$\beta_{2}$ & $ 0.000015$\\
${y_{1}}_{0}$ & $-0.000019$\\
$\epsilon_{1}$ & $-0.000075$\\
${y_{2}}_{0}$ & $-0.000094$\\
$f_{1}$ & $-0.000113$\\
$r$ & $-0.000150$\\
$f_{2}$ & $-0.000154$\\
$\beta_{1}$ & $-0.000157$\\
$\epsilon_{2}$ & $-0.000161$\\
$\psi_{12}$ & $-0.000218$\\
$k$ & $-0.000295$\\
\bottomrule
\end{tabular}
\caption{Maximum value of $y_{2}$.}
\end{subtable}\hfill
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
$f_{2}$ & $ 0.032545$\\
$f_{1}$ & $ 0.006636$\\
$\beta_{1}$ & $ 0.003933$\\
$r$ & $ 0.000856$\\
$\beta_{2}$ & $ 0.000193$\\
$\omega_{22}$ & $ 0.000160$\\
$\psi_{12}$ & $ 0.000151$\\
$x_{0}$ & $ 0.000126$\\
$\epsilon_{1}$ & $ 0.000117$\\
$\omega_{11}$ & $ 0.000025$\\
${y_{1}}_{0}$ & $-0.000004$\\
${y_{2}}_{0}$ & $-0.000096$\\
$\phi_{12}$ & $-0.000140$\\
$\epsilon_{2}$ & $-0.000157$\\
$k$ & $-0.000176$\\
\bottomrule
\end{tabular}
\caption{Mean value of $y_{2}$.}
\end{subtable}\hfill
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
$f_{2}$ & $ 0.028406$\\
$f_{1}$ & $ 0.006187$\\
$\beta_{1}$ & $ 0.003582$\\
$r$ & $ 0.000620$\\
$\omega_{22}$ & $ 0.000150$\\
$\epsilon_{1}$ & $ 0.000113$\\
$\psi_{12}$ & $ 0.000108$\\
$\beta_{2}$ & $ 0.000031$\\
$\omega_{11}$ & $ 0.000024$\\
$x_{0}$ & $ 0.000011$\\
${y_{1}}_{0}$ & $-0.000001$\\
${y_{2}}_{0}$ & $-0.000114$\\
$\phi_{12}$ & $-0.000135$\\
$\epsilon_{2}$ & $-0.000163$\\
$k$ & $-0.000168$\\
\bottomrule
\end{tabular}
\caption{Median value of $y_{2}$.}
\end{subtable}\hfill
\begin{subtable}[t]{.22\linewidth}
\centering
\begin{tabular}{lr}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
$f_{2}$ & $ 0.007005$\\
$f_{1}$ & $ 0.001013$\\
$\beta_{1}$ & $ 0.000588$\\
$r$ & $ 0.000264$\\
$\psi_{12}$ & $ 0.000079$\\
$\omega_{11}$ & $ 0.000073$\\
$\epsilon_{1}$ & $ 0.000062$\\
$\epsilon_{2}$ & $ 0.000015$\\
${y_{2}}_{0}$ & $ 0.000009$\\
$x_{0}$ & $ 0.000005$\\
$\omega_{22}$ & $ 0.000003$\\
$k$ & $-0.000021$\\
$\beta_{2}$ & $-0.000063$\\
$\phi_{12}$ & $-0.000086$\\
${y_{1}}_{0}$ & $-0.000090$\\
\bottomrule
\end{tabular}
\caption{Equilibrium value of $y_{2}$.}
\end{subtable}
\caption{Blub.}
\end{table}
\end{document}
或者将标题放在顶部并自动插入$
(也可以使用array
)。
\documentclass{article}
\usepackage{geometry}
\usepackage{array}
\usepackage{booktabs}
\usepackage{subcaption}
\begin{document}
\begin{table}[h]
\centering
\begin{subtable}[b]{.22\linewidth}
\centering
\caption{Maximum value of $y_{2}$.}
\begin{tabular}{>{$}l<{$}>{$}r<{$}}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
x_{0} & 0.999098\\
\omega_{11} & 0.000131\\
\omega_{22} & 0.000091\\
\phi_{12} & 0.000022\\
\beta_{2} & 0.000015\\
{y_{1}}_{0} & -0.000019\\
\epsilon_{1} & -0.000075\\
{y_{2}}_{0} & -0.000094\\
f_{1} & -0.000113\\
r & -0.000150\\
f_{2} & -0.000154\\
\beta_{1} & -0.000157\\
\epsilon_{2} & -0.000161\\
\psi_{12} & -0.000218\\
k & -0.000295\\
\bottomrule
\end{tabular}
\end{subtable}\hfill
\begin{subtable}[b]{.22\linewidth}
\centering
\caption{Mean value of $y_{2}$.}
\begin{tabular}{>{$}l<{$}>{$}r<{$}}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
f_{2} & 0.032545\\
f_{1} & 0.006636\\
\beta_{1} & 0.003933\\
r & 0.000856\\
\beta_{2} & 0.000193\\
\omega_{22} & 0.000160\\
\psi_{12} & 0.000151\\
x_{0} & 0.000126\\
\epsilon_{1} & 0.000117\\
\omega_{11} & 0.000025\\
{y_{1}}_{0} & -0.000004\\
{y_{2}}_{0} & -0.000096\\
\phi_{12} & -0.000140\\
\epsilon_{2} & -0.000157\\
k & -0.000176\\
\bottomrule
\end{tabular}
\end{subtable}\hfill
\begin{subtable}[b]{.22\linewidth}
\centering
\caption{Median value of $y_{2}$.}
\begin{tabular}{>{$}l<{$}>{$}r<{$}}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
f_{2} & 0.028406\\
f_{1} & 0.006187\\
\beta_{1} & 0.003582\\
r & 0.000620\\
\omega_{22} & 0.000150\\
\epsilon_{1} & 0.000113\\
\psi_{12} & 0.000108\\
\beta_{2} & 0.000031\\
\omega_{11} & 0.000024\\
x_{0} & 0.000011\\
{y_{1}}_{0} & -0.000001\\
{y_{2}}_{0} & -0.000114\\
\phi_{12} & -0.000135\\
\epsilon_{2} & -0.000163\\
k & -0.000168\\
\bottomrule
\end{tabular}
\end{subtable}\hfill
\begin{subtable}[b]{.22\linewidth}
\caption{Equilibrium value of $y_{2}$.}
\centering
\begin{tabular}{>{$}l<{$}>{$}r<{$}}
\toprule
{} & \multicolumn{1}{c}{$S_{1}$} \\
\midrule
f_{2} & 0.007005\\
f_{1} & 0.001013\\
\beta_{1} & 0.000588\\
r & 0.000264\\
\psi_{12} & 0.000079\\
\omega_{11} & 0.000073\\
\epsilon_{1} & 0.000062\\
\epsilon_{2} & 0.000015\\
{y_{2}}_{0} & 0.000009\\
x_{0} & 0.000005\\
\omega_{22} & 0.000003\\
k & -0.000021\\
\beta_{2} & -0.000063\\
\phi_{12} & -0.000086\\
{y_{1}}_{0} & -0.000090\\
\bottomrule
\end{tabular}
\end{subtable}
\caption{Blub.}
\end{table}
\end{document}
像往常一样,如果没有完整的示例,就必须猜测某些内容,例如页面几何形状。无法判断猜测是否与实际文档有很大关系,这就是为什么强烈建议用户上传完整的最小工作示例。