我得到了基于 MWE 的表格。它由 @Yiannis Lazarides 提供如何创建新的表环境 我如何创建两个标题,一个在顶部,一个在底部。
\documentclass{article}
\makeatletter
\usepackage[figurename=Figure.,
justification=RaggedRight,
labelfont={bf, footnotesize},
textfont={footnotesize},position=top]{caption}
\begin{document}
\listoftables
\def\starttable#1{%
\renewcommand{\arraystretch}{1.1}%
\minipage{0.45\textwidth}
\captionof{table}{#1}
\tabular{|c|c|c|c|}
\hline
Text-1 & Text-2 & Text-3 & Text-4 \\
\hline
}
\def\stoptable{%
\hline\endtabular
\endminipage\hspace{10pt}}
\def\R #1|#2|#3|#4{ #1}
\newpage
\begin{table}[h]
\centering
\starttable{First table caption}
\R test|test|test|test\\
\R test|test|test|test\\
\R test|test|test|test\\
\stoptable
%
\starttable{This is the second caption}
\R test|test|test|test\\
\R test|test|test|test\\
\R test|test|test|test\\
\stoptable
\end{table}
\end{document}
答案1
使用
\def\stoptable#1{%
\hline\endtabular\par\vspace{\abovecaptionskip}%
{\footnotesize #1}%
\endminipage}
允许您添加
\stoptable{<caption>}
并在表格下方显示标题:
\documentclass{article}
\usepackage[figurename=Figure.,
justification=RaggedRight,
labelfont={bf, footnotesize},
textfont={footnotesize},position=top]{caption}
\begin{document}
\listoftables
\def\starttable#1{%
\renewcommand{\arraystretch}{1.1}%
\minipage{0.45\textwidth}
\centering
\captionof{table}{#1}
\tabular{|c|c|c|c|}
\hline
Text-1 & Text-2 & Text-3 & Text-4 \\
\hline
}
\def\stoptable#1{%
\hline\endtabular\par\vspace{\abovecaptionskip}%
{\footnotesize #1}%
\endminipage}
\def\R #1|#2|#3|#4{ #1}
\newpage
\begin{table}[h]
\centering
\starttable{First table top caption}
\R test|test|test|test\\
\R test|test|test|test\\
\R test|test|test|test\\
\stoptable{First table bottom caption}
\hspace{10pt}%
\starttable{Second table top caption}
\R test|test|test|test\\
\R test|test|test|test\\
\R test|test|test|test\\
\stoptable{Second table bottom caption}
\end{table}
\end{document}