如何在 tabularx 中将文本居中

如何在 tabularx 中将文本居中

我创建了一个如下所示的表格。我想将以下部分居中。

\gmc{4}{@{}p{0.8\textwidth}@{}}{Summary of monthly cross-portfolio regressions: 25 Fama-French portfolios (constructed on 5 size and 5 book-to-market portfolios, including dividends)}

表格的代码从这里开始。请帮忙。谢谢!

\documentclass[11pt]{article}
\usepackage{setspace,amssymb,amsmath}
\usepackage[tablename=TABLE,labelsep=newline,
aboveskip=0pt,font=bf,justification=centering]{caption}
\usepackage{booktabs,tabularx}
\usepackage[margin=1in]{geometry}
\usepackage[autostyle]{csquotes}
\usepackage[table]{xcolor}
%\usepackage{ltablex}

\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcommand{\gmc}[3]{\multicolumn{#1}{@{}#2@{}}{#3}}

\doublespacing

\begin{document}


    \newpage
    \begingroup % keep any font size changes local to group
    %\setlength\tabcolsep{2pt} % default value: 6pt
    \captionof{table}{Can Risk Explain the Documented Return Patterns?}
    \singlespacing
    \footnotesize
    \setlength\tabcolsep{6pt} %default
    \renewcommand{\arraystretch}{1.1}

    \begin{tabularx}{\linewidth}{@{}l*{4}{Y}@{}}
        \toprule
        & \gmc{4}{c}{Summary of monthly cross-portfolio regressions: 48 Fama-French industry portfolios} \\\midrule
        & Mean& Std. Dev.&  Std. Error& Fama-MacBeth t-statistic \\\cmidrule(l){2-5}
        $\kappa_{m+1}$& 0.008&  0.043&  0.004&  2.070\\
        $\gamma_{MKTRF,m+1}$ &  0.003&  0.052&  0.004&  0.610\\
        $\gamma_{SMB,m+1}$ &    0.003&  0.028&  0.002&  1.260\\
        $\gamma_{HML,m+1}$ &    0.006&  0.030&  0.003&  2.170\\
        $\gamma_{UMD,m+1}$ &    -0.001& 0.061&  0.005&  -0.100\\
        \rowcolor{gray!25} $\mathbf{\gamma_{FRegionalProfit,m+1}}$ &    \textbf{0.003} &    \textbf{0.030} &    \textbf{0.003} &    \textbf{1.140} \\\\
        Adjusted $R^2$ &    0.216            \\\midrule
        \gmc{5}{l}{Additional Analyses:} \\
        & \gmc{4}{@{}p{0.8\textwidth}@{}}{Summary of monthly cross-portfolio regressions: 25 Fama-French portfolios (constructed on 5 size and 5 book-to-market portfolios, including dividends)} \\\cmidrule(l){2-5}

        &Mean&  Std. Dev.&  Std. Error& Fama-MacBeth t-statistic  \\
        \rowcolor{gray!25} $\mathbf{\gamma_{FRegionalProfit,m+1}}$ & \textbf{-0.001} &  \textbf{0.036} &    \textbf{0.003} &    \textbf{-0.260} \\\cmidrule(l){2-5}

        & \gmc{4}{@{}p{0.8\textwidth}@{}}{Summary of monthly cross-portfolio regressions: 100 Fama-French portfolios (constructed on 10 size and 10 book-to-market portfolios, including dividends)}\\\cmidrule(l){2-5}

        &Mean&  Std. Dev.&  Std. Error& Fama-MacBeth t-statistic\\
        \rowcolor{gray!25}  $\mathbf{\gamma_{FRegionalProfit,m+1}}$ &   \textbf{-0.001}&    \textbf{0.027} &    \textbf{0.002} &    \textbf{-0.530} \\
    \end{tabularx}   

    \footnotesize \hrule \medskip 
    Notes: The table reports results from the second stage of the two-step Fama and Macbeth (1973) procedure. In the first step, I estimate time-series regressions at the portfolio level, as described in Equation (7). FRegionalProfit is a monthly factor-mimicking regional accounting profitability information portfolio formed based on regional accounting profitability information, following the procedure that Fama and French (1993) use in forming the HML and SMB factors. The analysis first focuses on the 48 industry portfolios (Fama and French 1997), with portfolio returns from Kenneth French’s website. The analysis also employs the 25 and 100 portfolios constructed on the intersection of 5-by-5 and 10-by-10 BTM and MVE portfolios, respectively, following Fama and French (1993). I use the time-series portfolio regressions to obtain predicted factor loadings (betas) for each of the portfolios, estimated using five-year rolling windows that end at month m, with the requirement of at least ten portfolio-month observations in each window. In the second step, I estimate cross-portfolio monthly regressions of portfolio excess returns for month m+1 on the predicted rolling betas, such that each regression pools predicted betas for the 48 (and then the 25 and 100) portfolios, as described in Equation (8). I aggregate and conduct tests on the estimates following the Fama and MacBeth (1973) procedure. Raw stock returns are from the CRSP Monthly Stock File, adjusted for delisting returns. Risk-free rate and Fama–French-Carhart factors are from the Fama–French Portfolios and Factors dataset on WRDS. Accounting data are from Compustat North America Fundamentals Quarterly. To ensure the feasibility of investing in REITs when housing data exist across all regions, the analysis uses quarterly observations for which there are future index data for all regions, which is January 2000 (the last region for which housing data are available is Dallas). Thus, I use quarterly accounting data beginning in Q4:1999. The sample consists of U.S. stocks in the intersection of CRSP and Compustat with data available to calculate quarterly changes to regional accounting profitability, with quarterly profitability changes beginning Q4:1999, and with future stock returns available as of March 2015. Because the analyses require future returns, the investment construction quarters are Q4:1999-Q2:2014, with monthly stock returns beginning in March 2000 (one month after all regional profitability changes are available) and ending in November 2014 (last of the three months of stock returns—for September, October, and November—required for investing based on the Q2:2014 regional accounting indices available in middle of August 2014).

    \medskip
    \hrule
    \endgroup                           


    \end{document}

答案1

如果要对居中的文本进行连字符处理,请使用:

\usepackage{ragged2e}
[...]
\gmc{4}{@{}p{0.8\textwidth}@{}}{\Centering Summary of monthly cross-portfolio regressions: 25 Fama-French portfolios (constructed on 5 size and 5 book-to-market portfolios, including dividends)}

并且不带连字符的文本使用\centering代替\Centering

相关内容