5

I have a table which looks shifted to the right:

enter image description here I have been trying

\begin{center}
\centering
\scalebox{0.9}{

But it does not help. How can I move to the center? The code is below:

\documentclass{article}
\usepackage{booktabs,siunitx}
%\sisetup{table-format=2.1}

\usepackage{graphicx}

\begin{document}

\begin{table}[t]
\begin{center}
\scalebox{0.9}{
\setlength{\tabcolsep}{5pt}
\centering
\begin{tabular}{@{} l SSSSSS @{}} % @{} serves to suppress white space at ends of table

\toprule
%V=10   &  \multicolumn{5}{c @{}}{     }\\ 
%\cmidrule(l){2-6}
  $\min(V), K$  & { $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  }  \\
 real $\mu,\sigma$  & {(0.01,0.03)} & {(-0.005,0.03)} & {(0.005,0.03)} & {(0.005,0.15)} & {(-0.005,0.15)}  & {  (0.05,0.15)  } \\
\midrule
Proxy method        & 59.0 & 18.0 & 17.3 &  5.8 & 5.8 &2 \\
Ronn-Verma      &  0.9 & 66.6 & 16.7 & 10.7 & 5.1 & 5.8 \\
Transformed MLE         &  1.4 & 16.6 & 70.8 &  8.0 & 3.1 &5.8 \\
\bottomrule
\end{tabular}}
\caption{ CAPTION}
\label{tab:111}
\end{center}
\end{table}
\end{document}
  • 2
    \begin{center}...\centering? ;-) Don't use \begin{center}...\end{center} in a floating environment like table. Most likely your table is just too wide in order to be centered and leaks into margins – user31729 Aug 25 '17 at 19:03
  • 1
    as suggested by @ChristianHupfer, the table is indeed too wide for the page, and extends into the right margin. – barbara beeton Aug 25 '17 at 19:14
  • Dear @Zarko, Mico, Bernard and everybody else. Thank you for such a quick answers! I am sorry, I can not accept all answers. I will be using Zarko's option, as his last table is even better than I could imagine! – StochasticIntegrationStudent Aug 25 '17 at 21:20
  • Dear all, Could you please also tell where to find information on what S mean in \begin{tabular}{ l SSSSSS }; I could not find also how to work with tables, do you know any convenient editor for tables? I am using TexShop. – StochasticIntegrationStudent Aug 25 '17 at 21:23
5
\documentclass{article}
\usepackage{booktabs,siunitx}
%\sisetup{table-format=2.1}
\usepackage{graphicx}

\usepackage{showframe}

\begin{document}

\begin{table}
\setlength{\tabcolsep}{3pt}
\resizebox{\linewidth}{!}{%
\begin{tabular}{ l SSSSSS } % @{} serves to suppress white space at ends of table
\toprule
%V=10   &  \multicolumn{5}{c @{}}{     }\\
%\cmidrule(l){2-6}
  $\min(V), K$  & { $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  }  \\
 real $\mu,\sigma$  & {(0.01,0.03)} & {(-0.005,0.03)} & {(0.005,0.03)} & {(0.005,0.15)} & {(-0.005,0.15)}  & {  (0.05,0.15)  } \\
\midrule
Proxy method        & 59.0 & 18.0 & 17.3 &  5.8 & 5.8 & 2      \\
Ronn-Verma          & 0.9  & 66.6 & 16.7 & 10.7 & 5.1 & 5.8    \\
Transformed MLE     & 1.4  & 16.6 & 70.8 &  8.0 & 3.1 &5.8     \\
\bottomrule
\end{tabular}%
}
\caption{ CAPTION}
\label{tab:111}
\end{table}
\end{document}

but result is table which require magnify lens for reading :(

enter image description here

maybe you will liked the following redesign of your table.

edit: in case that you like enclose some numbers in parenthesis then \sisetup had be accordingly changed:

\sisetup{input-symbols = {()},
         table-space-text-post=\ ,% <-- for spacing of )
         detect-weight,
         table-format=3.1}% added one digit for space for (

as example i modify mwe below:

\documentclass{article}
\usepackage{booktabs,siunitx}
\usepackage{graphicx}

%-------------------------------------- only for show page layout
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.25pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}

\begin{table}
\sisetup{input-symbols = {()},
     table-space-text-post=\ ,% <-- for spacing of )
     detect-weight,
     table-format=3.1}% added one digit for space for (
\setlength{\tabcolsep}{3pt}
\resizebox{\linewidth}{!}{%
\begin{tabular}{ l SSSSSS } % @{} serves to suppress white space at ends of table
    \toprule
    &  \multicolumn{5}{c}{$\min(V), K$}     \\
    \cmidrule(lr){2-7}
 real $\mu,\sigma\ \times 10^{-3}$  
    & {$(10,30)$} & {$(-5,30)$} & {$(5,30)$} & {$(5,150)$} & {$(-5,150)$} & {$(50,150)$} \\
\midrule
Proxy method        
    & 59.0        & 18.0        & 17.3       &  5.8        & 5.8          & 2           \\
    & (59.0)      & (18.0)      & (17.3)     &  5.8        & 5.8          & (11.1)      \\
Ronn-Verma      
    &  0.9        & 66.6        & 16.7       & 10.7        & 5.1          & 5.8         \\
Transformed MLE         
    &  1.4        & 16.6        & 70.8       &  8.0        & 3.1          & 5.8         \\
\bottomrule
\end{tabular}%
}
\caption{ CAPTION}
\label{tab:111}
\end{table}
\end{document}

enter image description here

| improve this answer | |
  • Dear @Zarko, could you please tell how to put numbers in parenthesis? I want to some estimate and its standard error( typically it is written in parenthesis) – StochasticIntegrationStudent Aug 26 '17 at 7:33
  • @StochasticIntegrationStudent,see edit of my answer. – Zarko Aug 26 '17 at 8:33
  • Dear @Zarko, what if I want to put numbers like 1.3\times 10^{-4} in the cell? Is there a way to do it in similar way to:\sisetup{input-symbols = {()} – StochasticIntegrationStudent Aug 26 '17 at 8:47
  • now i notice that you open new question about parenthesis. i will try provide an answer there. – Zarko Aug 26 '17 at 8:52
4

Table design really matters when it comes to space utilization and readability. I removed much noise from the table as I understand it (too many repetition of $\min(V)$, K, parentheses, etc.) and redesigned the rows and columns from scratch. I don't know if it appeals to you, or even conveys the information as you intended, but in my opinion the table now is clear and readable. No text resizing, no scaling, or whatever, just the contents of the table.

\documentclass{article}
\usepackage{booktabs,siunitx}
\begin{document}

\begin{table}[t]
\centering
\begin{tabular}{@{}*{2}{S[table-format=3.4]} *{3}{S[table-format=8.6]@{}} }
\toprule
             &                 & \multicolumn{3}{c}{$\min(V)$, K}                  \\ \cmidrule{3-5}
{real $\mu$} & {real $\sigma$} & {Proxy method} & {Ronn-Verma} & {Transformed MLE} \\ \midrule
 0.01        & 0.03            &  59.0          &   0.9        &   1.4             \\
-0.005       & 0.03            &  18.0          &  66.6        &  16.6             \\ 
 0.005       & 0.03            &  17.3          &  16.7        &  70.8             \\ 
 0.005       & 0.15            &   5.8          &  10.7        &   8.0             \\
-0.005       & 0.15            &   5.8          &   5.1        &   3.1             \\   
 0.05        & 0.15            &   2.0          &   5.8        &   5.8             \\
\bottomrule
\end{tabular}
\caption{CAPTION}
\label{tab:111}
\end{table}

\end{document}

enter image description here

| improve this answer | |
2

Here's a method that uses a tabular* environment, along with a \scriptsize directive, to assure that the table fits inside the width of the text block.

enter image description here

\documentclass{article}
\usepackage{booktabs,siunitx}
\begin{document}

\begin{table}[t]
\setlength{\tabcolsep}{0pt}
\scriptsize
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l *{4}{S[table-format=2.1]} *{2}{S[table-format=1.1]}}

\toprule
  $\min(V), K$  & { $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  } & {  $\min(V), K$  }  \\
 real $\mu$, $\sigma$  & {(0.01,0.03)} & {($-0.005$,0.03)} & {(0.005,0.03)} & {(0.005,0.15)} & {($-0.005$,0.15)}  & {  (0.05,0.15)  } \\
\midrule
Proxy method   & 59.0 & 18.0 & 17.3 &  5.8 & 5.8 &2   \\
Ronn-Verma     &  0.9 & 66.6 & 16.7 & 10.7 & 5.1 & 5.8\\
Transformed MLE&  1.4 & 16.6 & 70.8 &  8.0 & 3.1 &5.8 \\
\bottomrule
\end{tabular*}
\caption{CAPTION}
\label{tab:111}
\end{table}
\end{document}
| improve this answer | |
2

If you don't use marginal notes, you'll have more decent default outer margins with the geometry package, and it is enough to set the table font to \small to make the table fit margins:

\documentclass{article}
\usepackage{booktabs,siunitx}
\usepackage[showframe]{geometry} %
\sisetup{table-format=2.1}

\usepackage{graphicx}

\begin{document}

\begin{table}[t]
  \setlength{\tabcolsep}{5pt}
  \centering\small
  \begin{tabular}{@{} l*{6}{S} @{}} % @{} serves to suppress white space at ends of table
    \toprule
    $\min(V), K$ & { $\min(V), K$ } & { $\min(V), K$ } & { $\min(V), K$ } & { $\min(V), K$ } & { $\min(V), K$ } & { $\min(V), K$ } \\
    real $\mu,\sigma$ & {$ (0.01,0.03) $} & {$ (-0.005,0.03) $} & {$ (0.005,0.03) $} & {$ (0.005,0.15) $} & {$ (-0.005,0.15) $} & { $ (0.05,0.15) $ } \\
    \midrule
    Proxy method & 59.0 & 18.0 & 17.3 & 5.8 & 5.8 & 2 \\
    Ronn-Verma & 0.9 & 66.6 & 16.7 & 10.7 & 5.1 & 5.8 \\
    \rlap{Transformed MLE} & 1.4 & 16.6 & 70.8 & 8.0 & 3.1 & 5.8 \\
    \bottomrule
  \end{tabular}
  \caption{ CAPTION}
  \label{tab:111}
\end{table}
\end{document} 

enter image description here

| improve this answer | |
  • 1
    By loading geometry you are changing the text width. – egreg Aug 25 '17 at 20:23
  • I know. That's why I added ‘if you don't use marginal notes’ – in which case the outer margin is unnecessarily wide. – Bernard Aug 25 '17 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.