![\captionsetup{option} 不适用于表格](https://linux22.com/image/324148/%5Ccaptionsetup%7Boption%7D%20%E4%B8%8D%E9%80%82%E7%94%A8%E4%BA%8E%E8%A1%A8%E6%A0%BC.png)
我对\captionsetup{}
首先,singlelinecheck=off
它对我的表格不起作用,我为表格定义的任何其他选项也不起作用,例如 labelfont=bf。
有趣的是,它适用于同一文档中的图形。
有人有建议吗?
这是我的代码:
\documentclass[journal=jacsat,manuscript=article]{achemso}
\usepackage[version=3]{mhchem} % Formula subscripts using \ce{}
\usepackage{caption}
\usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = blue]{hyperref}
%\usepackage{cleveref}
\usepackage{upgreek}
\newcommand*\mycommand[1]{\texttt{\emph{#1}}}
\author{Some author}
\affiliation{some affiliation}
\email{[email protected]}
\makeatletter
\let\acs@address@list\relax
\setlength\acs@space@post@address{0pt}
\makeatother
\title[An \textsf{achemso} demo]
{Some title}%\footnote{A footnote for the title}}
\begin{document}
\begin{abstract}
...
\end{abstract}
\newpage
\section{Introduction}
...
\section{Results and discussion}
...
\subsection{Subsection 1}
...
\subsection{Subsection 2}
...
\section{Outline}
...
\section{Experimental}
...
\begin{acknowledgement}
Some acknowledgement
\end{acknowledgement}
\cleardoublepage
\section{Tables}
\begin{table}
\captionsetup{format=hang, labelfont=bf, singlelinecheck=off}
\caption{Test test}
\label{T1}
\begin{center}
{\renewcommand{\arraystretch}{1.3}
\begin{tabular}{ccc}
\hline
Random1 & Random2 & Random3 \\
\hline
1 & 1 & 1 \\
2 & 2 & 2 \\
3 & 3 & 3 \\
\hline
\end{tabular}}
\end{center}
\end{table}
\cleardoublepage
\section{Tables}
\begin{figure}[htb]
\noindent\includegraphics[width=1\textwidth]{./pics/somepic}
\centering
\captionsetup{format=hang, labelfont=bf}
\caption{Test test test test test test test test test test test test test test test test test test test test test test test test test}
\label{F1}
\end{figure}
\end{document}
singlelinecheck=off
我尝试在加载包时在文档开头预先定义caption
。不幸的是,当我这样做时,我收到一条错误消息,指出我已经加载了包。
提前致谢!
希望它现在可以工作;这是 achemso Latex 模板
答案1
这提供了悬挂缩进(并且我已经删除了\begin{center}...\end{center}
浮动表中的一个对。
该错误很可能是由于缺少一个\title{...}
语句造成的!
singlelinecheck=off
作为软件包的一个选项caption
也有效!
\documentclass[journal=jacsat,manuscript=article]{achemso}
\usepackage[version=3]{mhchem} % Formula subscripts using \ce{}
\usepackage[singlelinecheck=off]{caption}
\usepackage{upgreek}
\usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = blue]{hyperref}
%\usepackage{cleveref}
\title{Theory of Brontosaurs}
\author{Ann Elk}
\begin{document}
\begin{table}
\captionsetup{format=hang, labelfont=bf}
\caption{Test test test test test test test test test test test test test test test test test test test test test test test test test}
\label{T1}
% \begin{center}
\centering
{\renewcommand{\arraystretch}{1.3}
\begin{tabular}{ccc}
\hline
Random1 & Random2 & Random3 \\
\hline
1 & 1 & 1 \\
2 & 2 & 2 \\
3 & 3 & 3 \\
\hline
\end{tabular}}
\end{table}
\begin{figure}[htb]
% \noindent\includegraphics[width=1\textwidth]{./pics/pic}
\centering
\captionsetup{format=hang, labelfont=bf}
\caption{Test test test test test test test test test test test test test test test test test test test test test test test test test}
\label{F1}
\end{figure}
\end{document}