我想使字幕对齐,并将其间距设置为 1.5。同时,我希望能够\linebreak
在字幕环境中使用命令在所需位置分割线。
例子:
\documentclass[a4paper, 12pt]{article}
\usepackage{geometry}
\geometry{margin=25mm}
\setlength{\parskip}{1em}
\setlength\parindent{0em}
\usepackage{float}
\usepackage[onehalfspacing]{setspace}
\begin{document}
\begin{table}[H]
\caption{Gas permeability and CO2-CH4 selectivity of PEI-GO MMM (Koolivand et al. [34])}
\label{tab:mmm1}
\vspace*{-\baselineskip}
\begin{center}
table is here
\end{center}
\end{table}
\end{document}
这里我有一个两端对齐的标题。我想设置一个半间距。我还想在“PEI-GO MMM”之后拆分行,并使第一行两端对齐。
当使用caption
带font=onehalfspacing
选项的包时,标题的第一行会缩进。其次,命令\linebreak
运行出错。结果如下:
\documentclass[a4paper, 12pt]{article}
\usepackage{geometry}
\geometry{margin=25mm}
\setlength{\parskip}{1em}
\setlength\parindent{0em}
\usepackage{float}
\usepackage[onehalfspacing]{setspace}
\usepackage[style=base,font=onehalfspacing]{caption}
\begin{document}
\begin{table}[H]
\caption{Gas permeability and CO2-CH4 selectivity of PEI-GO MMM \linebreak (Koolivand et al. [34])}
\label{tab:mmm1}
\vspace*{-\baselineskip}
\begin{center}
table is here
\end{center}
\end{table}
\end{document}
出现linebreak
错误:
Argument of \caption@ydblarg has an extra }. ... (Koolivand et al. \cite{Koolivand2014})}
Paragraph ended before \caption@ydblarg was complete. ... (Koolivand et al. \cite{Koolivand2014})}
有人可以重现这个错误并建议如何删除第一行缩进和错误吗?
完整文档的日志文件是这里。
答案1
\abovecaptionskip
您可以使用长度和来控制标题周围的间距\belowcaptionskip
。请注意,表格环境内部和标题内部的本地更改。
\documentclass[a4paper, 12pt]{article}
\usepackage{geometry}
\geometry{margin=25mm}
\setlength{\parskip}{1em}
\setlength\parindent{0em}
\usepackage{float}
\usepackage[onehalfspacing]{setspace}
\begin{document}
\begin{table}[H]
\hrule
\caption{\baselineskip=1.5\baselineskip
Gas permeability and CO2-CH4 selectivity of PEI-GO MMM (Koolivand et al. [34])}
\label{tab:mmm1}
\hrule
\end{table}
\end{document}
答案2
还有一些其他的解决方案,包括copyrightbox
和threeparttable
。对于标题和表格之间的间距,caption
包中有键,并且它足够智能,可以在调用标题时交换和skip=
的值\abovecaptionskip
\belowcaptionskip
前表格代码。
\documentclass[a4paper, 12pt]{article}
\usepackage{geometry, copyrightbox, threeparttable}
\geometry{showframe, margin=25mm}
\setlength{\parskip}{1em}
\setlength\parindent{0em}
\usepackage{float}
\usepackage[onehalfspacing]{setspace}
\usepackage[style=base, font=onehalfspacing, format=hang, skip = 6pt]{caption}
\begin{document}
\begin{table}[H]
\caption{Gas permeability and CO2-CH4 selectivity of PEI-GO MMM \\ (Koolivand et al. [34])\medskip}
\label{tab:mmm1}
\centering
\fbox{\makebox[0.5\linewidth]{ table is here}}
\end{table}
\vskip1cm
\begin{table}[H]
\centering
\captionsetup{font=singlespacing, skip = 0pt}
\caption{Gas permeability and CO2-CH4 selectivity of PEI-GO MMM}
\label{tab:mmm2}
\copyrightbox[b]{\fbox{\makebox[0.5\linewidth]{ table is here}}}{(Koolivand et al. [34]}
\end{table}
\vskip1cm
\begin{table}[H]
\centering
\captionsetup{font=singlespacing}
\begin{threeparttable}
\caption{Gas permeability and CO2-CH4 selectivity of PEI-GO MMM\tnote{*} }
\label{tab:mmm3}
\begin{tabular}{@{}c@{}}
\fbox{\makebox[0.5\linewidth]{ table is here}}
\end{tabular}
\begin{tablenotes}[flushleft]\footnotesize\smallskip
\item[*]Koolivand et al. [34]
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}