如何在三部分錶格中對齊表格註釋

如何在三部分錶格中對齊表格註釋

編輯:現在我意識到很長的筆記有問題,特別是因為我正在使用 A5 紙。使用 Mica 的解決方案:

長註

擁有tablenotes flushleft然而就很好了。

兩個問題合而為一:

  • 如何將tablenotes表格和圖形的左側開始對齊? (flushleft的選項threeparttable確實會影響整個三部分錶並造成不一致)
  • tablenotes為什麼我的程式碼在比較圖形和表格時在 ,中顯示這種差異?

表註錯位

\documentclass{memoir}
\usepackage{lmodern}            % Usa a fonte Latin Modern          
\usepackage[T1]{fontenc}        % Selecao de codigos de fonte.
\usepackage[utf8]{inputenc}     % Codificacao do documento (conv. auto. dos acentos)
\usepackage[brazil]{babel}
\usepackage[range-phrase={\,a\,}]{siunitx}
\sisetup{
    group-digits=true,
    group-four-digits=true,
    group-separator={\,},
    output-decimal-marker={,}
}
\usepackage{caption}
\captionsetup{
    justification=justified,
    %labelsep=quad,
    labelsep=endash, %% ABNT q manda
    position=above,
    skip=\onelineskip,
    width=0.95\linewidth,
}
\setfloatadjustment{table}{\centering}
\setfloatadjustment{figure}{\centering}
\setfloatadjustment{threeparttable}{\centering}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage[]{threeparttable}


\begin{document}        
\begin{figure}[]
    \captionof{figure}{Pressão}
    \label{fig:pvapor2}
    \begin{threeparttable}
        \begin{tikzpicture}[]
        \begin{axis}[grid=both,trim axis left, trim axis right,
        xlabel={Something else}, ylabel={Something},
        xmin= 1150,
        xmax=1550,
        ymin=-0.02
        ]
        \addplot+[ultra thick] coordinates { 
            (1300-273,101325*4.278*10^-11)
            (1400-273,101325*8.133*10^-10)
            (1500-273,101325*1.040*10^-8)
            (1600-273,101325*9.636*10^-8)
            (1687-273,101325*5.377*10^-7)
            (1700-273,101325*6.662*10^-7)
            (1800-273,101325*3.117*10^-6)
            (1900-273,101325*1.238*10^-5)
        };
        \end{axis}
        \end{tikzpicture}
        \begin{tablenotes}
            \item Fonte: Autor.
        \end{tablenotes}
    \end{threeparttable}
\end{figure}

\begin{table}
    \captionof{table}{Planejamento}
    \label{tab:planejamentoexperimental}
    \begin{threeparttable}[t]
        \begin{tabular}{@{}SSSS @{}}
            \toprule
            \text{Ordem} & \text{Ensaio} & \text{Fator A} & \text{Fator B} \\
            \midrule
            12 & 1 & 0 & 0\\
            5 & 2 & -1.41421 & 0\\
            2 & 3 & 1 & -1\\
            11 & 4 & 0 & 0\\
            13 & 5 & 0 & 0\\
            10 & 6 & 0 & 0\\
            8 & 7 & 0 & 1.41421\\
            1 & 8 & -1 & -1\\
            9 & 9 & 0 & 0\\
            7 & 10 & 0 & -1.41421\\
            3 & 11 & -1 & 1\\
            4 & 12 & 1 & 1\\
            6 & 13 & 1.414214 & 0\\
            \bottomrule
        \end{tabular}
        \begin{tablenotes}
            \item Fonte: Autor.
        \end{tablenotes}
    \end{threeparttable}
\end{table}
\end{document}

答案1

在下面的範例中,我使用了flushleft各個tablenotes環境的選項。我還將其嵌入到tikzpicture一個tabular環境中以克服那裡的對齊問題。

在此輸入影像描述

\documentclass{memoir}
\usepackage{lmodern}            % Usa a fonte Latin Modern          
\usepackage[T1]{fontenc}        % Selecao de codigos de fonte.
\usepackage[utf8]{inputenc}     % Codificacao do documento (conv. auto. dos acentos)
\usepackage[brazil]{babel}
\usepackage[range-phrase={\,a\,}]{siunitx}
\sisetup{
    group-digits=true,
    group-four-digits=true,
    group-separator={\,},
    output-decimal-marker={,}
}
\usepackage{caption}
\captionsetup{
    justification=justified,
    %labelsep=quad,
    labelsep=endash, %% ABNT q manda
    position=above,
    skip=\onelineskip,
    width=0.95\linewidth,
}
\setfloatadjustment{table}{\centering}
\setfloatadjustment{figure}{\centering}
\setfloatadjustment{threeparttable}{\centering}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage[]{threeparttable}


\begin{document}        
\begin{figure}[]
    \caption{Pressão}
    \label{fig:pvapor2}
    \begin{threeparttable}
    \begin{tabular}{@{}c@{}}
        \begin{tikzpicture}[]
        \begin{axis}[grid=both,trim axis left, trim axis right,
        xlabel={Something else}, ylabel={Something},
        xmin= 1150,
        xmax=1550,
        ymin=-0.02
        ]
        \addplot+[ultra thick] coordinates { 
            (1300-273,101325*4.278*10^-11)
            (1400-273,101325*8.133*10^-10)
            (1500-273,101325*1.040*10^-8)
            (1600-273,101325*9.636*10^-8)
            (1687-273,101325*5.377*10^-7)
            (1700-273,101325*6.662*10^-7)
            (1800-273,101325*3.117*10^-6)
            (1900-273,101325*1.238*10^-5)
        };
        \end{axis}
        \end{tikzpicture}
        \end{tabular}
        \begin{tablenotes}[flushleft]
            \item Fonte: Autor.
        \end{tablenotes}
    \end{threeparttable}
\end{figure}

\begin{table}
    \caption{Planejamento}
    \label{tab:planejamentoexperimental}
    \begin{threeparttable}[t]
        \begin{tabular}{@{}SSSS @{}}
            \toprule
            \text{Ordem} & \text{Ensaio} & \text{Fator A} & \text{Fator B} \\
            \midrule
            12 & 1 & 0 & 0\\
            5 & 2 & -1.41421 & 0\\
            2 & 3 & 1 & -1\\
            11 & 4 & 0 & 0\\
            13 & 5 & 0 & 0\\
            10 & 6 & 0 & 0\\
            8 & 7 & 0 & 1.41421\\
            1 & 8 & -1 & -1\\
            9 & 9 & 0 & 0\\
            7 & 10 & 0 & -1.41421\\
            3 & 11 & -1 & 1\\
            4 & 12 & 1 & 1\\
            6 & 13 & 1.414214 & 0\\
            \bottomrule
        \end{tabular}
        \begin{tablenotes}[flushleft]
            \item Fonte: Autor.
        \end{tablenotes}
    \end{threeparttable}
\end{table}
\end{document}

答案2

鑑於您沒有使用任何\tnote指令,使用threeparttable機器和tablenotes環境似乎是不合適的,或者至少像是大規模的殺傷力過大。對於您的格式化目標來說,最簡單的解決方案似乎包括放置“Fonte”(“來源”,對吧?)行進入身體環境的tabular。在下面的程式碼中,這是透過編寫完成的

\multicolumn{4}{@{}l}{\footnotesize Fonte: Autor.}

當您進行調整時,您應該更加謹慎地使用S列類型,特別是考慮到SSSS一刀切的方法是不明智的。

同樣的論點也適用於環境中材料的處理figure:不需要threeparttable環境機械。只需將tikzpicture環境放置在單列tabular環境中,列類型為@{}l@{},並讓第二行包含

\footnotesize Fonte: Autor. % second "row"

在此輸入影像描述

\documentclass{memoir}
\usepackage{lmodern}     % Usa a fonte Latin Modern          
\usepackage[T1]{fontenc} % Selecao de codigos de fonte.
\usepackage[utf8]{inputenc} 
\usepackage[brazil]{babel}
\usepackage{siunitx}
\sisetup{range-phrase={\,a\,},
         group-digits=true,
         group-four-digits=true,
         group-separator={\,},
         output-decimal-marker={,}
         }
\usepackage{caption}
\captionsetup{justification=justified,
              %labelsep=quad,
              labelsep=endash, %% ABNT q manda
              position=above,
              skip=1ex,
              %width=0.95\linewidth,
              }
\setfloatadjustment{table}{\centering}

\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}        
\setcounter{chapter}{2} % just for this example

\begin{table}
    \caption{Planejamento}
    \label{tab:planejamentoexperimental}
    \begin{tabular}{@{} *{2}{S[table-format=2.0]}
                        *{2}{S[table-format=-1.5]} @{}}
    \toprule
    {Ordem} & {Ensaio} & {Fator A} & {Fator B} \\
    \midrule
    12 & 1 & 0 & 0\\
    5 & 2 & -1.41421 & 0\\
    2 & 3 & 1 & -1\\
    11 & 4 & 0 & 0\\
    13 & 5 & 0 & 0\\
    10 & 6 & 0 & 0\\
    8 & 7 & 0 & 1.41421\\
    1 & 8 & -1 & -1\\
    9 & 9 & 0 & 0\\
    7 & 10 & 0 & -1.41421\\
    3 & 11 & -1 & 1\\
    4 & 12 & 1 & 1\\
    6 & 13 & 1.414214 & 0\\
    \bottomrule
    \addlinespace
    \multicolumn{4}{@{}l}{\footnotesize Fonte: Autor.}
    \end{tabular}
\end{table}

\begin{figure}[h!]
    \centering
    \caption{Pressão}
    \label{fig:pvapor2}
    \begin{tabular}{@{}l@{}}
    \begin{tikzpicture}[]
    \begin{axis}[grid=both,trim axis left, trim axis right,
        xlabel={Something else}, ylabel={Something},
        xmin= 1150,
        xmax=1550,
        ymin=-0.02
        ]
        \addplot+[ultra thick] coordinates { 
            (1300-273,101325*4.278*10^-11)
            (1400-273,101325*8.133*10^-10)
            (1500-273,101325*1.040*10^-8)
            (1600-273,101325*9.636*10^-8)
            (1687-273,101325*5.377*10^-7)
            (1700-273,101325*6.662*10^-7)
            (1800-273,101325*3.117*10^-6)
            (1900-273,101325*1.238*10^-5)
        };
    \end{axis}
    \end{tikzpicture}\\ % end of first "row"
    \footnotesize Fonte: Autor. % second "row"
    \end{tabular}
\end{figure}
\end{document}

相關內容