\makecell 在 \tabular{*} s 列中不起作用,但在 l 第一列中可以正常工作

\makecell 在 \tabular{*} s 列中不起作用,但在 l 第一列中可以正常工作

请看这个:

\documentclass[11pt]{article}
\usepackage[nopar]{lipsum}
\setlength\parindent{0pt}% globally suppress indentation
\usepackage[format=hang,labelfont=bf]{caption}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage[mathscr]{euscript}%for D ennsemble
\usepackage{amsfonts} %for R ennsembble
\makeatletter  %start here for colour number equation
\let\reftagform@=\tagform@
\def\tagform@#1{\maketag@@@{(\ignorespaces\textcolor{black}{#1}\unskip\@@italiccorr)}}
\renewcommand{\eqref}[1]{\textup{\reftagform@{\ref{#1}}}} %end here for colour numer equation
\makeatother
\usepackage{enumitem}
\usepackage{amssymb}
\usepackage{amsmath,stackengine} %arrow set neighour  1/1
\stackMath   %arrow set neighour 2/2
\usepackage[square,numbers]{natbib} %for citation
%\usepackage[round]{natbib} 
%\usepackage {natbib}
%\usepackage{natbib}
\usepackage{lmodern} % Latin Modern Mono
\usepackage[T1]{fontenc} %Latin Modern Mono suite
\usepackage{setspace}%set space between lines
\setstretch{1.5} % one-and-a-quarter spacing between lines
\usepackage{chngcntr}%count within section
\counterwithin{figure}{section} %count figure within section
\counterwithin{table}{section} %count figure within section
\usepackage{bm}
\usepackage{array}
\usepackage{adjustbox}
\usepackage{float}
\usepackage{seqsplit}
%\usepackage{url}
\usepackage[table,xcdraw,svgnames]{xcolor}
\usepackage{graphicx}
\usepackage{tikzexternal} %to include my tikz output
%\usetikzlibrary{external}
\tikzexternalize %to include my tikz output
%\usepackage[colorlinks]{hyperref}
%\usepackage[nameinlink,noabbrev]{cleveref}
\usepackage{hyperref}
\usepackage{cleveref}
\hypersetup{
    colorlinks=true,
    citecolor=blue,
    %linkcolor=ForestGreen,%
    linkcolor=magenta,
    filecolor=cyan,      
    urlcolor=ForestGreen,
} 

%\patchcmd{\@eqnnum}{\normalcolor}{\color{ForestGreen}}{\typeout{eqnnum patch: Flory}}{\typeout{eqnnum patch: Kg}}
\usepackage{xcolor}
\usepackage{sectsty}
%\sectionfont{\color{Black}}
%\hypersetup{colorlinks,
%citecolor=blue
%}
\newcommand{\fact}[1]{\left( #1\right)!}
\def\P(#1){\Phelper#1|\relax\Pchoice(#1)}
\def\Phelper#1|#2\relax{\ifx\relax#2\relax\def\Pchoice{\Pone}\else\def\Pchoice{\Ptwo}\fi}
\def\Pone(#1){\Pr\left( #1 \right)}
\def\Ptwo(#1|#2){\Pr\left( #1 \mid #2 \right)}
\def\Pr{\mathbf{Pr}}
\DeclareMathOperator{\Div}{Div} % <--- important!
\makeatletter
\newcommand{\labeltarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
\newcommand{\keyword}{\textbf{MCPR}}
\usepackage[margin=1in]{geometry}
\usepackage{titlesec}
%\titleformat{\section}[block]{\color{blue}\Large\bfseries\filcenter}{}{1em}{}
\newcommand{\sectionn}[1]{\section[#1]{\centering #1}}
\usepackage{xcolor,etoolbox}
\usepackage{rotating}
\usepackage{geometry}
\usepackage{siunitx}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{longtable} % for multiple pages table
\usepackage{adjustbox}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{pdflscape}
%\definecolor{Burgundy}{RGB}{144,0,32}
\definecolor{mg}{rgb}{139,0,139}
\definecolor{og}{rgb}{0,0.6,0}
\usepackage{colortbl,array} % für farbige cells
\usepackage{multirow,bigdelim}
\usepackage{booktabs}
\usepackage{fourier} 
\usepackage{array}

%\usepackage[flushleft]{threeparttable}
%\makeatletter
%\patchcmd{\@eqnnum}{\normalcolor}{\color{magenta}}{\typeout{eqnnum patch: OK!}}{\typeout{eqnnum patch: Oh, dear!}} %colour number equation
%\newcommand{\indep}{\rotatebox[origin=c]{90}{$\models$}} %works with package graphic

\begin{document}
      \begin{tablenotes}[flushleft]\small
      \item[a] capital and large cities; \item[b] continuous variable, so we refer to the number of total cases in figure X to see if the regression is fitted with it.
      \note   2003: DHS, 2010:DHS, 2014:PMA round 1, 2015:PMA round 2, 2016::PMA round 3, 2016-17:PMA round 4
      \source   Authors' calculations ...
      \end{tablenotes}
      \end{threeparttable}
    \end{table}
    %\end{landscape}
    \pagebreak
    %\end{sidewaystable}
     % \end{sidewaystable}


    %\begin{landscape}
    %\begin{sidewaystable}
    %\begin{sidewaystable}
    \begin{table}[p]
    \begin{threeparttable}
    % \resizebox{\textwidth}{!}{
      \centering
     %\caption{my tavle}\label{tab:scoring}
      \setlength\tabcolsep{0pt}
     %\begin{adjustbox}{width=\textwidth}
     %\begin{center}
    %\hspace*{-.5cm}
     \captionof{subtable}{Part 2}
     \hspace*{-3cm}
     \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}  
      %l *{18}{S[table-format=1.3]} @{}} 
    % l
                       %     S[table-format=-1.3]
                         % *{17}{S[table-format=1.3]} @{}}                            
     l
      *{5}{S[table-format=4]} 
       S[table-format=4]|  
       *{5}{S[table-format=4]} 
       S[table-format=4]|  
       *{5}{S[table-format=4]} 
       S[table-format=4]|  
       }
                                  %*{24}{S[table-format=4]} @{}}   

        \toprule
        &   \multicolumn{6}{s}{\textcolor{blue}{ \textbf{Boucle de mouhoun}}}   &   \multicolumn{6}{s}{ \textcolor{blue}{ \textbf{Cascades}}}  &   \multicolumn{6}{s}{\textcolor{blue}{ \textbf{Centre (- ouagadougou)}}} \\
        \cmidrule(){2-7}
        \cmidrule(){8-13}
         \cmidrule(){14-19}
              &  {\thead[b]{2003}}
                &   {\thead[b]{2010}}
                    &   {\thead[b]{2014}}
                        &   {\thead[b]{2015}}
                            &   {\thead[b]{2016}}
                            &   {\thead[b]{2016-17}}
              &  {\thead[b]{2003}}
                &   {\thead[b]{2010}}
                    &   {\thead[b]{2014}}
                        &   {\thead[b]{2015}}
                            &   {\thead[b]{2016}}
                            &   {\thead[b]{2016-17}}
              &  {\thead[b]{2003}}
                &   {\thead[b]{2010}}
                    &   {\thead[b]{2014}}
                        &   {\thead[b]{2015}}
                            &   {\thead[b]{2016}}
                            &   {\thead[b]{2016-17}}      
                                       \\
        \midrule
      \textcolor{og}{\textbf{Household wealth }} \\
     \textbf{quintiles for DHS}\\
       \textbf{tertiles\tnote{a} for PMA} \\
       lowest tertile \makecell[l]{poorest \\ poorer} & \makecell{131\\143 }\\
          middle tertile   \makecell[l]{middle }   \\
       richest tertile \makecell[l]{ richer \\richest }    \\

     %lowest tertile \makecell[l]{poorest \\ poorer} & \makecell[l]{131 \\143} \\
     %  middle tertile   \makecell[l]{middle }  & \\
      % richest tertile \makecell[l]{ richer \\richest }  &  \\

         \textcolor{og}{\textbf{Dejure place of residence}} \\
         metropolitan\tnote{a} & 0    &   0      &        0       &       0       &       0      &           0& 0    &   0      &        0       &       0       &       0      &           0& 0    &   0      &        0       &       0       &       0      &           0\\
         urban& 180   &  264     &        27     &        30      &       67       &         78&364   &  387            & 44        &     39     &        92       &         92&0    &   0      &        0       &       0       &       0      &           0\\
            rural &725 &   1082  &          115    &        119     &       190       &        215 & 531 &    698            & 41       &      62      &       90       &         87 & 333 &     372    &         38   &          30      &       38               & 36\\ 
             \textcolor{og}{\textbf{Schooling}} \\
              no education &725 &   1030      &      82     &        84      &      140         &      151&648    & 783        &     54     &        67     &       110         &      115 &283   &  267        &     32       &      22            & 31        &        27\\
               primary       &        119   &  197    &        36      &       56       &     103         &      120 &151    & 172       &       9     &        29       &      62         &      54 &38  &    73      &        2     &         7             & 5          &       7\\
               secondary or above    &  61  &   118    &         21     &         7       &      10        &        16&  96  &   130      &      21      &        4     &         8       &          6&12   &   32       &       0        &      0             & 0      &           0\\
                \textcolor{og}{\textbf{Parity}}\tnote{b} \\
               \text{ 0} $\cdots$ \text{ 20}\\

        \bottomrule
      \end{tabular*}
      \hspace*{-3cm}
    %  }
     % \end{center}
     %  \end{adjustbox}
      \begin{tablenotes}[flushleft]\small
      \item[a] the categories are detailed enough and doesn't over-crumble frequencies; \item[b] continuous variable, so we refer to the number of total cases in figure X to see if the regression is fitted with it.
      \note   2003: DHS, 2010:DHS, 2014:PMA round 1, 2015:PMA round 2, 2016::PMA round 3, 2016-17:PMA round 4
      \source   Authors' calculations ...
      \end{tablenotes}
      \end{threeparttable}
    \end{table}
    \end{landscape}
\end{document}  

相关内容