1

When I use adjustbox to modify the width of a table, even the font size changes. How can I increase the table width but let it exceed both margins equally?

enter image description here

My 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}
  • 2
    Your assertion that the default font size in table environments is 14.9pt if the elsarticle document class is in use is false. The reason the font size is so large is because you're ill-advisedly using an adjustbox environment, to "blow up" the tabular material so that it occupies the full width of the text block. An obvious solution is to cease using the adjustbox device. – Mico Mar 07 '19 at 16:52
  • 1
    @Mico. The misunderstanding about width option in adjustbox package is what confused me. It basically re-scales all of its contents, but I was just looking to increase table width but let the table exceed both margins equally. Thanks a lot for your note. I learnt a lot from you in this TeX Stack Exchange. – Al-Motasem Aldaoudeyeh Mar 07 '19 at 17:38
  • The usual trick is to use \makebox[\textwidth]{...} to overlap both margins equally. See https://tex.stackexchange.com/questions/16582/center-figure-that-is-wider-than-textwidth/16584?r=SearchResults&s=2|0.0000#16584 for example. – John Kormylo Mar 07 '19 at 18:42
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – samcarter_is_at_topanswers.xyz Mar 12 '19 at 10:03

2 Answers2

1

You wrote,

I use adjustbox because I want to extend the table beyond the default margins,

For the table at hand, there is no need to make it wider than the textblock. Just issue either a \small or a \footnotesize directive. And, for sure, don't resort to the adjustbox device.

A separate observation: you're using the fontspec package and use the TeX Gyre Pagella text font. To employ a compatible math font, I suggest you load the unicode-math package (which automatically loads the fontspec package) and issue the directive \setmathfont{TeX Gyre Pagella Math}.

And, no need to employ the C column type for all 10 columns. In fact, you only need the C type for two columns; for the other 8, simply use the plain c column type.

enter image description here

\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}
Mico
  • 506,678
0

enter image description here

Before you begin your table use \begin{adjustwidth}{-0.5<text width increase>}{0em}. In the table preamble, use 1.<textwidth increase factor>. For example. If you want to increase the table width by 0.3 of text width, use \begin{adjustwidth}{-0.15\textwidth}{0em} and {1.3\textwidth} in tabularx preamble. The main purpose of using \begin{adjustwidth}{0.5<text width increase>}{0em} is to move the table to the left by an amount equal to half the increase in table width, thus ensuring that the table will exceed both margins equally.

Here is full 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}
  • 1
    If you're using the elsarticle document class for your paper because you intend to submit the paper to an Elsevier-stable journal, it's almost certainly a very bad idea to make the table 50% wider than the text block. For instance, the journal's editorial staff will quite likely inform you that it cannot publish the paper unless you scale down the width of the table. – Mico Mar 07 '19 at 17:48