如何使 IEEEtran 类文件中的表格标题居中?

如何使 IEEEtran 类文件中的表格标题居中?

我需要将表格的标题放在 ieeetran 类文件的中央。有什么办法吗?我尝试了很多方法,但都失败了。任何帮助都将不胜感激。提前致谢。

我正在使用名为以下的文档类:

\documentclass[journal,compsoc]{IEEEtran}

我的表的 MWE 如下:

\documentclass[journal,compsoc]{IEEEtran}
\usepackage{caption,graphicx}
\begin{document}
\title{ABC Study}
\section{RM}
\begin{table}
\centering
\caption{Results of the search process.}
\label{ts}
\renewcommand{\arraystretch}{1.2}
\small
\scalebox{0.65}{
\begin{tabular}{|p{5cm}|l|p{4.7cm}|p{3cm}|p{3.9cm}|p{3.7cm}|p{3.5cm}|}
\hline
Authors with Ref. & Year & Theme & Parameter & Technique & Method Validation & Dimension \\ 
\hline
B.~Tansey, E.~Stroulia & 2007 & Estimation of potential business value of evolving SOA applications & effort estimation & COCOMO2 and real options theory & not shown & \\ \hline
L.~Santillo & 2007 & Discusses the boundary problem from the software measurement and estimation perspective & size estimation & COSMIC functional size measurement for SOA environment & not shown & \\ \hline
J.~Lee et al. & 2008 & Estimating project plans and service costs of packaged business process applications & cost estimation & Normative and constructive models & not shown & \\ \hline
\end{tabular}
}
\end{table}
\end{document}

我想像所有其他以前的表格一样显示当前表格的标题。

在此处输入图片描述

建议将表格标题居中对齐,但喜欢这种格式。

在此处输入图片描述

答案1

要解决您的初始问题,请table用替换table*。您的标题实际上是居中的,但仅相对于一列居中,因为table标记一列浮点数,而table*是跨越两列的浮点数。

下面的代码建议进一步进行两项修改。首先,执行不是重新调整表格大小,但避免使用竖线(它们只会占用空间,而且会分散注意力,而不是帮助定位),并使用tabularx允许您自动等距列的环境。此外,该booktabs包会产生间距合适的行和线。

在此处输入图片描述

\listfiles
\documentclass[journal,compsoc]{IEEEtran}
\usepackage{graphicx}
\usepackage{tabularx,booktabs}
\usepackage{blindtext}% Only needed for dummy text
\begin{document}
\title{ABC Study}
\author{The author}
\maketitle
\section{RM}

For the results of the search process, see table~\ref{ts}.

\begin{table*}
\centering
\caption{Results of the search process.}\label{ts}

\begin{tabularx}{\textwidth}{XlXXXXX}
\toprule
  Authors with Ref. & Year & Theme & Parameter & Technique & Method Validation & Dimension
\\\midrule
  B.~Tansey, E.~Stroulia & 2007
  & Estimation of potential business value of evolving SOA applications
  & effort estimation & COCOMO2 and real options theory & not shown &
\\\midrule
  L.~Santillo & 2007
  & Discusses the boundary problem from the software measurement and estimation perspective
  & size estimation & COSMIC functional size measurement for SOA environment & not shown &
\\\midrule
  J.~Lee et al. & 2008
  & Estimating project plans and service costs of packaged business process applications
  & cost estimation & Normative and constructive models & not shown &
\\\bottomrule
\end{tabularx}
\end{table*}
\Blindtext

\Blindtext
\end{document}

在上面的代码中,我添加了\listfiles第一行。这会使 LaTeX 将使用的文件列表写入日志文件(包括版本信息)。上面的代码适用于以下版本的软件包:

 *File List*
IEEEtran.cls    2015/08/26 V1.8b by Michael Shell
  ot1ppl.fd    2001/06/04 font definitions for OT1/ppl.
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2017/01/12 v0.06k Graphics/color for pdfTeX
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
tabularx.sty    2016/02/03 v2.11 `tabularx' package (DPC)
   array.sty    2016/10/06 v2.4d Tabular extension package (FMi)
booktabs.sty    2016/04/27 v1.618033 publication quality tables
blindtext.sty    2012/01/06 V2.0 blindtext-Package
  xspace.sty    2014/10/28 v1.13 Space after command names (DPC,MH)
supp-pdf.mkii
pdftexcmds.sty    2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
   ifpdf.sty    2017/03/15 v3.2 Provides the ifpdf switch
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
  ot1phv.fd    2001/06/04 scalable font definitions for OT1/phv.
    upzd.fd    2001/06/04 font definitions for U/pzd.
 ***********

答案2

也许这可能有用

\documentclass[journal,compsoc]{IEEEtran}
\usepackage{graphicx}
\newcommand{\mycaption}[1]{\stepcounter{table}\raisebox{-7pt}{\footnotesize Table. \thetable.\hspace{3pt} #1}}
\begin{document}
\title{ABC Study}
\section{RM}
Table. \ref{ts}
\begin{table*}
\centering
    \mycaption{Results of the search process.}
\label{ts}
\renewcommand{\arraystretch}{1.2}
\small
\scalebox{0.65}{
    \begin{tabular}{|p{5cm}|l|p{4.7cm}|p{3cm}|p{3.9cm}|p{3.7cm}|p{3.5cm}|}
        \hline
        Authors with Ref. & Year & Theme & Parameter & Technique & Method Validation & Dimension \\ 
        \hline
        B.~Tansey, E.~Stroulia & 2007 & Estimation of potential business value of evolving SOA applications & effort estimation & COCOMO2 and real options theory & not shown & \\ \hline
        L.~Santillo & 2007 & Discusses the boundary problem from the software measurement and estimation perspective & size estimation & COSMIC functional size measurement for SOA environment & not shown & \\ \hline
        J.~Lee et al. & 2008 & Estimating project plans and service costs of packaged business process applications & cost estimation & Normative and constructive models & not shown & \\ \hline
    \end{tabular}
}
\end{table*}
\end{document}

在此处输入图片描述

相关内容