表格标题应左对齐

表格标题应左对齐

如何使表格标题左对齐。

我试过了\usepackage[singlelinecheck=off]{caption},但是没有成功。换句话说,它给出了一个错误:

\DeclareFloatFont {tiny}{\tiny}% "scriptsize" is defined by floatrow, "t...

    \documentclass[a4paper]{article}
    \usepackage{graphicx}
    \usepackage[cmex10]{amsmath}
    \usepackage{mathtools}
    \usepackage[usenames]{color}
    \usepackage[table]{xcolor}
    \usepackage[left=2cm, right=2cm]{geometry}
    \usepackage{authblk}

    \usepackage{floatrow}
    \usepackage[labelsep=space]{caption}

    \DeclareFloatFont{tiny}{\tiny}
    \floatsetup[table]{font=footnotesize,capposition=top}

    \linespread{1.6}
    \renewenvironment{abstract}{%
    \noindent\bfseries\abstractname:\normalfont}{}

    \newcommand{\affilmark}[1]{\rlap{\textsuperscript{\itshape#1}}}

    \begin{document}

    \centerline{\LARGE Title}
    \vspace*{3ex}
    \begin{flushleft}\large
    A.B \affilmark{a},\quad
    A.D\affilmark{b}\\[2ex]
    \normalsize\itshape
    \textsuperscript{a}\,University of nowhere,\
    \upshape Corresponding author's email: \texttt{[email protected]}
    \end{flushleft}
    \date{}

    \begin{abstract}
    abstract goes here
    \end{abstract}


    \section{Introduction}
    some text goes here.

    \begin{figure}[!t]
    \includegraphics[width=0.4\textwidth, height=0.2\textwidth]
    \ffigbox[\FBwidth]
    \caption{Conventional  (a) ABCD. (b) EFGH.}
    \label{ABCDEFGH}
    \end{figure}

    \begin{table}[!t]

    \caption{performance of .}
    \label{tableII}
    \centering
    \definecolor{latexbl}{RGB}{28,220,240}
    \rowcolors{12}{black}{latexbl}

    \begin{tabular}  {|m{0.8cm}|m{0.6cm}|m{1.35cm}|m{1.1cm}|m{1.5cm}|m{1.1cm}|m{1.4cm}|m{0.7cm}|m{1.75cm}|m{1.2cm}|m{0.5cm}|}
    \hline
    \center Ref. & A &  B& C & D& E& F &G &H&I &J\\
    \hline
    \end{tabular}
    \begin{flushleft}
    some explanation
    \end{flushleft}
    \end{table}
    \end{document}

由 LOCKSTEP 编辑(从单独的“答案”移出):

这是一个可编译的示例,它没有显示您提到的问题行为。请使用它作为启动帮助来发布一个可编译的示例,该示例确实显示了该行为。

\documentclass{article}

\usepackage{floatrow}
\usepackage[singlelinecheck=off]{caption}

\begin{document}


\begin{table}
(Table content)
\caption{A table}
\end{table}

\end{document}

答案1

似乎您希望标题的宽度与其图形/表格的宽度相同。如果是这种情况,您可以使用包中的\ffigbox、 和\ttabbox命令floatrow。一个小例子:

\documentclass{article}
\usepackage{floatrow}
\usepackage[labelsep=space]{caption}

\DeclareFloatFont{tiny}{\tiny}
\floatsetup[table]{font=footnotesize,capposition=top}

\newcommand\Text{text text text text text text text}% just for the example

\begin{document}

\begin{figure}[!ht]
\ffigbox[\FBwidth]
{\caption{A figure with its caption having equal width to the figure width}\label{fig:test1}}
{\rule{4cm}{2cm}}
\end{figure}

\begin{table}[!ht]
\ttabbox[\FBwidth]
{\caption{A table with its caption having equal width to the table width}\label{fig:test1}}
{\begin{tabular}{p{3cm}p{3cm}}
\Text\Text & \Text\Text \\
\Text\Text & \Text\Text 
\end{tabular}
}
\end{table}

\end{document}

在此处输入图片描述

答案2

\usepackage{caption}
\captionsetup{labelsep=space,justification=justified,singlelinecheck=off}

将执行您所要求的操作。没有关于“tiny”的错误。

相关内容