如何在不改變字體大小的情況下使表格均勻地超出左右邊距?

如何在不改變字體大小的情況下使表格均勻地超出左右邊距?

當我用來adjustbox修改表格的寬度時,甚至字體大小也會改變。如何增加表格寬度但讓它均勻地超過兩個邊距?

在此輸入影像描述

我的MWE

\documentclass{elsarticle}


    \usepackage{ragged2e}


    % ========== Caption packages ==========
    \usepackage{caption}

    % ========== Table packages ==========
    \usepackage{tabularx}
% BEGIN_FOLD

        \newcolumntype{L}{ >{\arraybackslash \RaggedRight}X }       
        \newcolumntype{C}{ >{\arraybackslash \Centering}X }
        \newcolumntype{R}{ >{\arraybackslash \RaggedLeft}X }
        \newcolumntype{J}{ >{\arraybackslash\justifying} X }        
        \renewcommand{\tabularxcolumn}[1]{ >{\centering}m{#1} }

        \newcommand{\scalelinespace}[1]{
            \rule{0pt}{#1\normalbaselineskip}
                                        }

% END_FOLD

    \usepackage{booktabs}
    \usepackage{makecell}
    \usepackage[flushleft]{threeparttable}

    % ========== Figures and tables locations packages ==========
    \usepackage{float}
    \usepackage{adjustbox}

    % ========== Font encoding packages ==========
    \usepackage[T1]{fontenc}
    \usepackage{fontspec}
% BEGIN_FOLD

    \setmainfont{TeX Gyre Pagella}
    \setmonofont{Courier}
    \newcommand{\textffam}[2]{{\fontencoding{T1} \fontfamily{#1} \selectfont#2}}

% END_FOLD

    % ========== Equations and math packages ==========
    \usepackage{amsmath}
    \usepackage{amssymb, amsfonts}
    \usepackage{stackengine}




\begin{document}

\begin{table*}[htp]

\begin{adjustbox}{width=1.5\textwidth, center}  

    \begin{threeparttable}

            % Table options

            % Caption
            \caption{Determination of Critical Lines Among RESs Based on Operational Interaction Operators}
            \label{table:critical_lines_w_ij_hat}


            % Center the table
            \centering

            \newcommand{\setfontsizeTable}{\fontsize{9}{9} \selectfont}

            \begin{tabularx}{1\textwidth}{c ||>{\hsize=0.5\hsize \setfontsizeTable}C >{\hsize=0.5\hsize}C >{\hsize=0.5\hsize}C >{\hsize=0.5\hsize}C >{\hsize=0.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C}

                \toprule

                \adjustbox{rotate=90, valign=c}{Quadrant} & \adjustbox{rotate=90, valign=c}{POI $i$} & \adjustbox{rotate=90, valign=c}{POI $j$} & \multicolumn{3}{c|}{Other POIs} &
                Critical Line Based on $\displaystyle \angle \bar{w}_{ij}$ or $\displaystyle \left| \bar{w}_{ij} \right|$ & Actual Critical Line (based on [Eq]) & $\displaystyle \left| S_{eq, \thinspace i} \right|$ & $\displaystyle \mathit{SDSCR}_{i}$ & $\displaystyle \frac{\mathit{Max} \medspace \mathit{SDSCR}_{i}}{\textit{Mean} \medspace \mathit{SDSCR}_{i}}$
                \\
                \Xhline{0.25mm}

                \scalelinespace{1.3} \adjustbox{rotate=90, valign=c}{III} & 101 & 64  & 96 & 106 & 37 & 86-87 & 86-87 & 4.38 & 2.02 & 1.41
                \\

                \scalelinespace{1.3} \adjustbox{rotate=90, valign=c}{IV} & 79 & 96  & 9 & 81 & 33 & 9-10 & 9-10 & 3.40 & 5.13 & 1.28
                \\

                \scalelinespace{1.3} \adjustbox{rotate=90, valign=c}{
                    \Shortstack[c]{{III} {IV \textsuperscript{a}}}
                                                                    }
                & 97 & 60  & 39 & 37 & 86 & 43-44 & 43-44 & 3.98 & 3.18 & 1.07
                \\

                \bottomrule
            \end{tabularx}

            \begin{tablenotes}

                \item[a] angles of $\displaystyle \angle \bar{w}_{ij}$ exist in both quadrants

            \end{tablenotes}

    \end{threeparttable}

\end{adjustbox}

\end{table*}

\end{document}

答案1

你寫了,

我使用它是adjustbox因為我想將表格擴展到預設邊距之外,

對於手頭上的表格,無需使其比文字區塊更寬。只需發出 a\small\footnotesize指令即可。當然,不要求助於該adjustbox設備。

一個單獨的觀察:您正在使用該fontspec套件並使用TeX Gyre Pagella文字字體。要使用相容的數學字體,我建議您載入unicode-math套件(它會自動載入fontspec套件)並發出指令\setmathfont{TeX Gyre Pagella Math}

並且,無需C對所有 10 列都採用該列類型。事實上,您只需要C兩列的類型;對於其他 8 個,只需使用普通c列類型。

在此輸入影像描述

\documentclass{elsarticle}
\usepackage{ragged2e}

\usepackage{tabularx}
\newcolumntype{C}{ >{\Centering\arraybackslash }X }
\renewcommand{\tabularxcolumn}[1]{>{\centering}m{#1}}

\usepackage[flushleft]{threeparttable}
\usepackage{adjustbox}
\usepackage{amsmath,amssymb}

\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}

\begin{document}

\begin{table*}[htp] 
\setlength\tabcolsep{5pt}
\setlength\extrarowheight{2pt}
\footnotesize
\begin{threeparttable}
\caption{Determination of critical lines among RESs based on operational interaction operators}
\label{table:critical_lines_w_ij_hat}

\begin{tabularx}{\textwidth}{@{} c | ccccc | *{2}{C} ccc @{}}
\hline
\adjustbox{rotate=90, valign=c}{Quadrant} & 
\adjustbox{rotate=90, valign=c}{POI $i$} & 
\adjustbox{rotate=90, valign=c}{POI $j$} & 
\multicolumn{3}{c|}{Other POIs} 
& Critical line based on $\angle\bar{w}_{\!ij}$ or $| \bar{w}_{\!ij}|$ 
& Actual Critical Line (based on [Eq]) 
& $| S_{\mathit{eq},i}|$ 
& $\mathit{SDSCR}_{i}$ 
& $\frac{\max \mathit{SDSCR}_{i}}{\mathrm{mean}\,\mathit{SDSCR}_{i}}$
\\
\hline
III & 101 & 64  & 96 & 106 & 37 & 86-87 & 86-87 & 4.38 & 2.02 & 1.41
\\
IV & 79 & 96  & 9 & 81 & 33 & 9-10 & 9-10 & 3.40 & 5.13 & 1.28
\\
III, IV\tnote{a} & 97 & 60  & 39 & 37 & 86 & 43-44 & 43-44 & 3.98 & 3.18 & 1.07
\\
\hline
\end{tabularx}

\begin{tablenotes}
\item[a] Angles of $\angle \bar{w}_{\!ij}$ exist in both quadrants.
\end{tablenotes}
\end{threeparttable}
\end{table*}

\end{document}

答案2

在此輸入影像描述

在開始使用餐桌之前\begin{adjustwidth}{-0.5<text width increase>}{0em}。在表序言中,使用1.<textwidth increase factor>.例如。如果您想要將表格寬度增加文字寬度的 0.3,請在序言中使用\begin{adjustwidth}{-0.15\textwidth}{0em}和。使用的主要目的是將表格向左移動等於表格寬度增加量一半的量,從而確保表格同等地超出兩個邊距。{1.3\textwidth}tabularx\begin{adjustwidth}{0.5<text width increase>}{0em}

這是完整的 MWE

\documentclass{elsarticle}


    \usepackage{ragged2e}


    % ========== Caption packages ==========
    \usepackage{caption}

    % ========== Table packages ==========
    \usepackage{tabularx}
% BEGIN_FOLD

        \newcolumntype{L}{ >{\arraybackslash \RaggedRight}X }       
        \newcolumntype{C}{ >{\arraybackslash \Centering}X }
        \newcolumntype{R}{ >{\arraybackslash \RaggedLeft}X }
        \newcolumntype{J}{ >{\arraybackslash\justifying} X }        
        \renewcommand{\tabularxcolumn}[1]{ >{\centering}m{#1} }

        \newcommand{\scalelinespace}[1]{
            \rule{0pt}{#1\normalbaselineskip}
                                        }

% END_FOLD

    \usepackage{booktabs}
    \usepackage{makecell}
    \usepackage[flushleft]{threeparttable}

    % ========== Figures and tables locations packages ==========
    \usepackage{float}
    \usepackage{adjustbox}

    % ========== Font encoding packages ==========
    \usepackage[T1]{fontenc}
    \usepackage{fontspec}
% BEGIN_FOLD

    \setmainfont{TeX Gyre Pagella}
    \setmonofont{Courier}
    \newcommand{\textffam}[2]{{\fontencoding{T1} \fontfamily{#1} \selectfont#2}}

% END_FOLD

    % ========== Equations and math packages ==========
    \usepackage{amsmath}
    \usepackage{amssymb, amsfonts}
    \usepackage{stackengine}


    \usepackage{changepage}


\begin{document}

\begin{table*}[htp]

\begin{adjustwidth}{-0.25\textwidth}{0em}

    \begin{threeparttable}

            % Table options

            % Caption
            \caption{Determination of Critical Lines Among RESs Based on Operational Interaction Operators}
            \label{table:critical_lines_w_ij_hat}


            % Center the table
            \centering

            \begin{tabularx}{1.5\textwidth}{c ||>{\hsize=0.5\hsize}C >{\hsize=0.5\hsize}C >{\hsize=0.5\hsize}C >{\hsize=0.5\hsize}C >{\hsize=0.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C |>{\hsize=1.5\hsize}C}

                \toprule

                \adjustbox{rotate=90, valign=c}{Quadrant} & \adjustbox{rotate=90, valign=c}{POI $i$} & \adjustbox{rotate=90, valign=c}{POI $j$} & \multicolumn{3}{c|}{Other POIs} &
                Critical Line Based on $\displaystyle \angle \bar{w}_{ij}$ or $\displaystyle \left| \bar{w}_{ij} \right|$ & Actual Critical Line (based on [Eq]) & $\displaystyle \left| S_{eq, \thinspace i} \right|$ & $\displaystyle \mathit{SDSCR}_{i}$ & \maxsizebox{\hsize}{!}{$\displaystyle \frac{\mathit{Max} \medspace \mathit{SDSCR}_{i}}{\textit{Mean} \medspace \mathit{SDSCR}_{i}}$}
                \\
                \Xhline{0.25mm}

                \scalelinespace{1.3} \adjustbox{rotate=90, valign=c}{III} & 101 & 64  & 96 & 106 & 37 & 86-87 & 86-87 & 4.38 & 2.02 & 1.41
                \\

                \scalelinespace{1.3} \adjustbox{rotate=90, valign=c}{IV} & 79 & 96  & 9 & 81 & 33 & 9-10 & 9-10 & 3.40 & 5.13 & 1.28
                \\

                \scalelinespace{1.3} \adjustbox{rotate=90, valign=c}{
                    \Shortstack[c]{{III} {IV \textsuperscript{a}}}
                                                                    }
                & 97 & 60  & 39 & 37 & 86 & 43-44 & 43-44 & 3.98 & 3.18 & 1.07
                \\

                \bottomrule
            \end{tabularx}

            \begin{tablenotes}

                \item[a] angles of $\displaystyle \angle \bar{w}_{ij}$ exist in both quadrants

            \end{tablenotes}

    \end{threeparttable}

\end{adjustwidth}

\end{table*}



\end{document}

相關內容