侧边表和普通表中的“设置”标题不同

侧边表和普通表中的“设置”标题不同

我正在使用以下内容:

\usepackage[labelsep=newline,
justification=centering, labelsep=period,
singlelinecheck=off, font=bf]{caption}

但是,然后使用sidewaystable我得到了一个中心:

          Table I. My Caption is here behind the numbering

但是当使用table正常时,我会集中注意力:

                 Table I
  My Caption is here below the numbering

我怎样才能使我的sidewaystable行为像正常table设置一样?

仅供参考,上述标题设置用于我的图表:

Figure 1. Some short caption (which shows in the list of figures). HERE HERE some longer 
description which do not pop up in the list of figures.

编辑:添加屏幕截图:Sidewaystable 没有新行,正常表格换行

编辑 2:我在序言中包括了所有内容以及我制作表格的方式。我希望我捕获了可能导致问题的所有内容(抱歉代码太长了)

\documentclass[11pt,a4paper,english,oneside]{article}
\usepackage{etex} %Because of many packages --> Extended TeX.
\usepackage[left=4cm, right=3cm, top=3cm, bottom=3cm]{geometry} %Helps to structure the paper layout.
\usepackage[Lenny]{fncychap} %Design of the thesis.
\usepackage[utf8]{inputenc} %Due to vowels.
\usepackage[british]{babel} %Define the language style.
\usepackage{dsfont} %Nice style for the indicator function.
\usepackage{fancyhdr} %To customize the headers and footers.
\usepackage{booktabs} %In case you need \cmidrule or \addlinespace in tables.
\usepackage[hang,bottom,stable,multiple]{footmisc} %Style of footnotes.
\usepackage{appendix} %For the \appendixpage command.
%Load some mathematical packages.
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[sort,round]{natbib} %For the bibliography.
\usepackage{etoolbox} %To remove the page number on \appendixpage.
\usepackage{amsthm} %For theorems, definitions etc.
\usepackage{thmtools} %For theorems, definitions etc.
\usepackage{setspace} %Use double spacing.
\usepackage{lipsum} %For the \lipsum command to generate a text.
\usepackage{datetime} %For the specification of the date.
%\usepackage{tocloft} %The ToC, LoF and LoT each appear not necessarily on a new page.
\usepackage{rotating}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[outdir=./]{epstopdf}
\usepackage{graphicx}
\usepackage{float}
\usepackage{pdfpages}
%\usepackage{mcode} %To implement a Matlab code.
\usepackage[margin=0pt, font=small, labelfont=bf, labelsep=endash]{caption} %Customize the captions.
\usepackage{chngcntr} %To use counterwithout.
\usepackage{epstopdf} %For inserting .eps files into the document.
\usepackage{hyperref} %Must be loaded at the end.
\usepackage{xparse} %Load for \NewDocumentCommand command.
\usepackage{cleveref} %For the command \cref, load after hyperref.
\usepackage{arydshln} %Due to the capability to draw horizontal/vertical dash-lines.
\usepackage{array,hhline} %To create tables and matrices.
\usepackage{rotating} %To rotate a table.
\usepackage{tabularx} %An extended version of tabular.
\usepackage{fixltx2e}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage{pdflscape, longtable}
\usepackage{capt-of}
\usepackage{makecell}
\usepackage{textgreek}

\usepackage[justification=centering, labelsep=period,
singlelinecheck=off, font=bf]{caption}

%\captionsetup[figure]{justification=justified,singlelinecheck=false}

\usepackage{subcaption}
\usepackage{siunitx}
\usepackage{etoolbox}
\robustify\bfseries 
\sisetup{detect-weight=true,detect-inline-weight=math}
\usepackage{fancybox}
\usepackage{array}

\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}

%Setup of the reference links.
\hypersetup{
     colorlinks=false,
     linkcolor=blue,
     citecolor=blue,
     filecolor=magenta,
     urlcolor=blue}

%Define some reasonable margins.
\setlength{\textwidth}{6.6in}
\setlength{\textheight}{8.8in}
\setlength{\topmargin}{-0.1in}
\setlength{\oddsidemargin}{0in}
\setlength{\parskip}{1mm}

\bibliographystyle{abbrvnat} %Reference style.
\allowdisplaybreaks[1] %Page breaks of equations are allowed, but avoided if possible. 2-4 more relaxed.

%New command for the HSG logo.
\newcommand*{\plogo}{\includegraphics[scale=0.5]{HSG_Logo}}

%New command for the differential d to have an ordinary d.
\makeatletter
  \newcommand{\ud}{\mathrm{d}}
\makeatother

%Remove page number on \appendixpage. Use the package 'etoolbox'.
\makeatletter
\patchcmd{\@chap@pppage}{\thispagestyle{plain}}{\thispagestyle{empty}}{}{}
\makeatother

%Declare Definitions, Theorems etc.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\declaretheorem[style=definition,qed=$\blacktriangleleft$, numberwithin=section]{remark} %additional options; numberwithin=,..., see 'Thmtools' Users’ Guide
\declaretheorem[style=definition,qed=$\triangle$,numberwithin=section]{definition}
\newtheorem{ass}{Assumption}[section]
\newtheorem{prop}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]
\declaretheorem[style=definition,qed=$\perp$,numberwithin=section]{example}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{coroll}{Corollary}[section]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%% Journal of Finance %%%%%%%%%%

%%%%%%%%%% Footnote Issue %%%%%%%%%%

% Footnotes
\makeatletter
\newlength{\myFootnoteWidth}
\newlength{\myFootnoteLabel}
\setlength{\myFootnoteLabel}{1.2em}% <-- can be changed to any valid value
\renewcommand{\@makefntext}[1]{%
    \setlength{\myFootnoteWidth}{\columnwidth}%
    \addtolength{\myFootnoteWidth}{-\myFootnoteLabel}%
    \noindent\makebox[\myFootnoteLabel][r]{\@makefnmark\ }%
    \parbox[t]{\myFootnoteWidth}{#1}%
}
\makeatother

%%%%%%%%%% End: Footnotes Issue %%%%%%%%%%

\renewcommand{\thesection}{\Roman{section}} 
\renewcommand{\thesubsection}{\Alph{subsection}} 
\renewcommand{\thetable}{\Roman{table}} 
\renewcommand{\abstractname}{\textsc{ABSTRACT}}
\makeatletter
% we need a period (.) after sectioning numbers, but not in cites thereto.
\renewcommand{\@seccntformat}[1]{{\csname the#1\endcsname}.\hspace{0.5em}}

\long\def\@makefigcaption#1#2{%
    \vskip\abovecaptionskip
    %#1\\\footnotesize#2
    %\sbox\@tempboxa{\footnotesize\bf#1.\footnotesize#2}%
    %\sbox\@tempboxa{\footnotesize{\textbf{#1.}} footnotesize#2}%
    %\sbox\@tempboxa{\textbf{#1.} footnotesize#2}%
    %\sbox\@tempboxa
    \footnotesize\textbf{#1.} \footnotesize#2
    \ifdim \wd\@tempboxa >\hsize
    \textbf{#1. #2}\par
    \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
    \fi
    \vskip\belowcaptionskip}

%\renewcommand{\figure}{\let\@makecaption\@makefigcaption\@float{figure}}

\long\def\@maketblcaption#1#2{%
    \vskip\abovecaptionskip %Same size for Numbering and Caption of Tables
    \begin{center}\normalsize\bf#1\\\normalsize#2\end{center}
    % \sbox\@tempboxa{\textbf{#1.} #2}%
    % \global \@minipagefalse
    % \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
    \vskip\belowcaptionskip} 

\renewcommand{\table}{\let\@makecaption\@maketblcaption\@float{table}}
%\renewcommand{\sidewaystable}{\let\@makecaption\@maketblcaption\@float{sidewaystable}}
\makeatother

\setlength{\abovecaptionskip}{0.1cm}
%\setlength{\belowcaptionskip}{-2mm}

%%%%%%%%%% End: Journal of Finance%%%%%%%%%%

\captionsetup[figure]{justification = justified}
\captionsetup[subfigure]{margin={0cm, 1cm}, font=md, justification = justified}

\makeatletter
\setlength{\@fptop}{0pt}
\makeatother

%Readjust the numbering.
\counterwithout{footnote}{section}
\numberwithin{equation}{section}

%\setlength{\parindent}{0cm} %Uncomment this if you don't want to have indents.

\include{titlepage}

%Special header and footer style for the executive summary and Task Assignment section.
\fancypagestyle{firststyle}{%
    \fancyhf{}%
    \renewcommand{\headrulewidth}{0pt}
    \fancyfoot[C]{\thepage}}

%Customize headers and footers.
\pagestyle{fancy}
\fancyhead[R]{\thepage}
\fancyhead[L]{\rightmark}
%\fancyfoot[L]{[ Your Name ]}
%\fancyfoot[C]{}
%\fancyfoot[R]{[ Running Master Thesis Title ]}

%Define the signature line with dots.
\NewDocumentCommand \dotbox {o O{.5\linewidth} m O{3ex} O{\linewidth}}
{
    \begin{minipage}{7cm}
        \makebox[7cm][l]{\,.\dotfill}
        \\
        \makebox[7cm][l]{\,#3}
    \end{minipage}
}

\begin{document}

    \newpage
    \begin{sidewaystable}[htp!]
        \robustify\bfseries
        \robustify\itshape
        \footnotesize
        \sisetup{group-separator={}}
        \caption{Summary Statistics of the Short Leg of the Pairs Trading Strategy}
        \label{tab:SummaryStatsShort}
        \begin{threeparttable}
        \begin{tabular*}{\textwidth}
        \end{tabular*}
        \end{threeparttable}
      \end{sidewaystable}
        \vfill

\newpage
\begin{table}[ht!]
    \setlength\tabcolsep{0.1pt}  % default value: 6.0pt

    \caption{Performance Measures } \label{tab:PerfMeas}

    \footnotesize
    \begin{threeparttable}
        \begin{tabular*}{\textwidth}%
            { @{\extracolsep{\fill}} l *{8}{d{-2.4}} }
\end{tabular*}
    \end{threeparttable}
\end{table}
\vfill

\end{document}

答案1

您可以重新定义\@makecaption(排版标题)表格标题,但不能重新定义侧边栏标题:

\long\def\@maketblcaption#1#2{%
    \vskip\abovecaptionskip %Same size for Numbering and Caption of Tables
    \begin{center}\normalsize\bf#1\\\normalsize#2\end{center}
    % \sbox\@tempboxa{\textbf{#1.} #2}%
    % \global \@minipagefalse
    % \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
    \vskip\belowcaptionskip}

\renewcommand{\table}{\let\@makecaption\@maketblcaption\@float{table}}
%\renewcommand{\sidewaystable}{\let\@makecaption\@maketblcaption\@float{sidewaystable}}

由于您使用自己的代码来制作表格标题,因此此代码将用于制作表格标题,而来自标题包的代码将用于制作侧向可调整标题。因此,它们的外观尤其不同。

我建议要么使用 caption 包(并简单地删除您自己的定义\@makecaption),要么使用您自己的 caption 代码(并放弃使用 caption 包),但不要两者混合使用。(对于图形也一样,因为您也使用您自己的代码来编写图形标题。)

相关内容