回忆录侧标题、子底部和三部分包出现奇怪的错误

回忆录侧标题、子底部和三部分包出现奇怪的错误

我在使用 threepartable、sidecaption、subbottom 和 memoir 类时遇到了一个奇怪的错误

! 您无法在受限水平模式下使用 `\prevdepth'。\TPTdoTablenotes ->\par \prevdepth \z@ \TPT@hsize \list {}{\topsep \z@skip ... l.54 \label{pranking:b}}

这是 MWE(已更新答案)

% !TEX encoding =  UTF-8 Unicode
% -*- program: xelatex -*-
\documentclass[a4paper, 11pt,twoside, openright]{memoir}
\usepackage{polyglossia}
\usepackage[flushleft]{threeparttable}
\usepackage{multirow,multicol}
\usepackage{amssymb}
\usepackage{amsmath,mathtools}
\usepackage{mwe} % just for dummy images
\usepackage{graphicx}
\newsubfloat{figure}
\newsubfloat{table}

\begin{document}

\begin{table}[!p]

\begin{sidecaption}[fortoc]{bla with math}
  [tab:pranking]
  \centering
   \subbottom[blabla]{
      \includegraphics[width=.4\linewidth]{example-image-c}
    \label{pranking:a}}\qquad
  \subbottom[]{
  \begin{threeparttable}
  \begin{tabular}{>{$}l<{$} >{$}l<{$} >{$}l<{$} >{$}l<{$} >{$}l<{$} >{$}l<{$}}
      \toprule
      \text{solutions candidates} & f_1 & f_2 & \text{dominé par} & v_1 & v_2 \\
      \midrule
      a      & 3.5    & 1    &  \varnothing & 1 & 1 \\
      b      & 3      & 1,5  &  \varnothing & 1 & 1 \\
      c      & 2      & 2    &  \varnothing & 1 & 1 \\
      d      & 1      & 3    &  \varnothing & 1 & 1 \\
      e      & 0.5    & 4    &  \varnothing & 1 & 1 \\
      f      & 0.5    & 4.5  &  \{e \}      & 2 & 2 \\
      g      & 1.5    & 4.5  &  \{d,e,f,h \} & 5 & 3 \\
      h      & 1.5    & 3.5  &  \{d \}      & 2 & 2 \\
      i      & 2      & 3.5  &  \{c,d,h \}  & 4 & 3 \\
      j      & 2.5    & 3    &  \{c,d \}    & 3 & 2 \\
      k      & 3.5    & 2    &  \{a,b,c \}  & 4 & 2 \\
      l      & 4.5    & 1    &  \{a \}      & 2 & 2 \\
      m      & 4.5    & 2.5  &  \{a,b,c,k,l \} & 6 & 3 \\
      n      & 4      & 4    &  \{a,b,c,d,e,h,i,j,k,o \} & 11 & 5 \\
      o      & 3      & 4    &  \{b,c,d,e,h,i,j \} & 8 & 4 \\
      p      & 5     & 4.5   &  \{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o \} & 16 & 6 \\
      \bottomrule
  \end{tabular}
  \begin{tablenotes}
      \small
      \item bla
      \item bla
    \end{tablenotes}
 \end{threeparttable}

  \label{pranking:b}}
  \end{sidecaption}

\end{table}
\end{document}

答案1

效果很好。记住要准确说明threeparttable的位置。此外 的放置也是threeparttable节省您时间的方法。\subbottom不太喜欢之后的表格注释列表。但将其包装在 中threeparttable,现在它变成了一个框,如 所示\subbottom,这样就没问题了。

\documentclass[a4paper]{memoir}
\usepackage[flushleft]{threeparttable}
\newsubfloat{figure}
\newsubfloat{table}

\begin{document}

\begin{table}[!p]
\begin{sidecaption}[fortoc]{bla with math}
  [tab:pranking]
  \centering
   \subbottom[blabla]{
     some image
    \label{pranking:a}}\qquad
  \subbottom[]{
    \begin{threeparttable}
      \begin{tabular}{l}
        \toprule
        a table of data\\
        \bottomrule
      \end{tabular}
    \begin{tablenotes}
      \small
    \item bla
    \item bla
    \end{tablenotes}
    \label{pranking:b}
  \end{threeparttable}
  }
  \end{sidecaption}
\end{table}
\end{document}

相关内容