5

I have a question regarding my table. It appears that the code delivers a table that devotes the majority of the space to last column. I couldn't figure out the reason. What might be the problem?

\documentclass{buthesis}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{graphicx}
\usepackage[turkish]{babel}
\usepackage[T1]{fontenc}
\usepackage{natbib}
\usepackage{longtable}
\usepackage{adjustbox, lipsum}
\usepackage{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\usepackage{color}   %May be necessary if you want to color links
\usepackage{color}   %May be necessary if you want to color links
\usepackage{hyperref}
\hypersetup{ colorlinks=false, linktoc=all, hidelinks }
\usepackage{booktabs}
\pagenumbering{roman}
\usepackage{pstool}
\usepackage[none]{hyphenat}
\AtBeginDocument{\renewcommand{\BBAA}{ve}}
\AtBeginDocument{\renewcommand{\BOthers}[1]{vd.}}
\usepackage{booktabs}
\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}
\usepackage{stackengine}
\usepackage{url}


\begin{document}
\begin{table}[H]
\captionsetup{singlelinecheck = false, justification=justified}
\caption{Seçilmiş gelişmiş ülkeler için iş çevrimleri istatistikleri}   


\begin{adjustbox}{max width=\textwidth}

\begin{tabular}{cccccc}

\label{tab:buscycle2}


\textbf{İstatistik} & \textbf{İsviçre} & \textbf{Kanada} & \textbf{Danimarka} &  \textbf{Avustralya} & \textbf{Ortalama}  \\
\hline
\multicolumn{6}{l}{\textbf{Varyans}} \\
 $\sigma_{y}$  & 2 & 3 & 3 & 2 & 2.5\\
 ${\sigma_{c}}/{\sigma_{y}}$ & 0.5& 0.60 & 0.76 & 1.00 & 0.72  \\
 ${\sigma_{g}}/{\sigma_{y}}$ & 1.11 & 1.92 & 1.88 & 0.66 & 0.86 \\
 ${\sigma_{i}}/{\sigma_{y}}$ & 2.15 & 2.73 & 3.30 & 4.66  & 3.31\\
 ${\sigma_{x}}/{\sigma_{y}}$ & 2.61 & 3.05 & 1.75 & 3.18  & 2.94\\
 ${\sigma_{m}}/{\sigma_{y}}$ & 2.30 & 1.55 & 2.48 & 4.04 & 2.48 \\
 ${\sigma_{tb}}/{\sigma_{y}}$ & 0.62 & 0.75  & 0.44 & 1.13  & 0.83\\
 \hline
 \multicolumn{6}{l}{\textbf{Y ile korelasyon}} \\
 c  & 0.58 & 0.57 & 0.72 & 0.72 & 0.63 \\
 ${g}/{y}$  & -0.63 & -0.84 & -0.63 & -0.73 & -0.40 \\
 i  & 0.83 & 0.68 & 0.96 & 0.61 &  0.70\\
 x  & 0.75 & 0.55 & 0.66  & -0.08 &  0.39\\
 m  & 0.62& 0.66 & 0.73 & 0.46 & 0.23\\
 tby  &  0.50 & 0.32 & -0.40 & -0.20 &  0.12\\
  tb  & 0.56   & 0.37  & -0.26 & -0.17 & 0.18\\
 cay  & -0.21 & 0.74 & -0.68 & -0.51 & 0.13  \\
 \hline
  \multicolumn{6}{l}{\textbf{Otokorelasyon}} \\
 y & 0.67 & 0.80 & 0.73 & 0.78 &  0.78\\
 c & 0.70 & 0.88 & 0. 66 & 0.81 &  0.82\\
 g & 0.59 & 0.86 & 0.72&0.64 &  0.75\\
 i & 0.61& 0.81 & 0.78 & 0.81 &  0.79\\
 x & 0.44&0.87 &0.67  & 0.90 & 0.82 \\
 m & 0.49 & 0.46 & 0.71 & 0.72 & 0.57\\
 tby & 0.15 &0.94 &0.65 & 0.89 & 0.81 \\
  tb & 0.20 & 0.93 & 0.66 & 0.89 & 0.81  \\
 cay & 0.18 & 0.72 & 0.52 & 0.45 & 0.56\\
 \hline
    \multicolumn{6}{l}{\footnotesize Kaynak: Dünya Bankası verileri kullanılarak yazar tarafından oluşturulmuştur.  \url{https://databank.worldbank.org/source/world-development-indicators} } \\

\end{tabular}
\end{adjustbox}
\end{table} 
\end{document}
  • Is the buthesis document class available online? – Mico Aug 24 at 8:40
  • The main cause of the table's "asymmetry", as you call it, is the presence of the \multicolumn{6}{l}{\footnotesize ...} directive. Change it to \multicolumn{6}{@{}p{10.5cm}}{\footnotesize\raggedright ...}. – Mico Aug 24 at 8:51
  • please make MWE clean, that is without things like turkish, buthesis, etc. Your question is about "Asymmetric table", right? ` – Black Mild Aug 24 at 9:21
  • 1
    @BlackMild - Since the document appears to be in Turkish, including the material in the table footnote, I don't think it can be said that \usepackage[turkish]{babel} is unnecessary. – Mico Aug 24 at 9:24
  • Hi mico I downloaded it from university's website. – le rouge et le noir Aug 24 at 14:46
5

It appears that the code delivers a table that devotes the majority of the space to last column. I couldn't figure out the reason.

The main reason for the "asymmetry" is the way you typeset the table footnote: The instruction

\multicolumn{6}{l}{\footnotesize ...}

does not allow line breaks in its argument.

I can think of two remedies:

  • Replace the l column type, which does not allow automatic line-breaking, with the p column type (and a suitably chosen width):

    \multicolumn{6}{@{}p{10.3cm}}{\footnotesize\raggedright ...}
    

    I'd call this the brute-force way.

  • Load the threeparttable environment, take the footnote material out of the tabular environment, and encase the caption statement, the tabular environment, and the footnote material in a threeparttable environment. With this setup,, the width of the footnote material is limited automatically to that of the tabular environment. That's the solution pursued in the code below.

Whatever else you end up doing, do allow for automatic alignment of the numbers in the five data columns on their respective decimal markers. One way to achieve this is to load the siunitx package and its S column type.

The following solution employs the report document class since I don't have access to the buthesis document class. It also employs the line-drawing macros of the booktabs package, it doesn't employ bold-facing of headers as I consider that to be both unnecessary and visually distracting, and I also got rid of unnecessary pairs of curly braces since they add nothing but code clutter. E.g., I replaced all instances of {\sigma_{y}} with \sigma_{y}.

enter image description here

\documentclass{report}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb,amsmath} %maths
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage[turkish]{babel}
%\usepackage{natbib}
\usepackage{apacite} % for \BBAA and \BOthers macros
\bibliographystyle{apacite}

\usepackage{longtable}
\usepackage{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\usepackage{booktabs}
\pagenumbering{roman}
\usepackage{pstool}
\usepackage[none]{hyphenat}
\AtBeginDocument{\renewcommand{\BBAA}{ve}}
\AtBeginDocument{\renewcommand{\BOthers}[1]{vd.}}

\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}
\usepackage{stackengine}

\usepackage{siunitx,threeparttable} % <-- new

\usepackage{xurl}
\usepackage{hyperref} % load this package LAST
\hypersetup{colorlinks=false, linktoc=all, hidelinks }

\begin{document}
\begin{table}[ht!]
\captionsetup{singlelinecheck=false, justification=justified}

\begin{threeparttable} % <-- new
\caption{Seçilmiş gelişmiş ülkeler için iş çevrimleri istatistikleri}   
\label{tab:buscycle2}

\begin{tabular}{@{} >{$}l<{$} *{5}{S[table-format=-1.2]} @{}}
% \toprule % (optional)
$İstatistik$ & {İsviçre} & {Kanada} & {Danimarka} &  {Avustralya} & {Ortalama}  \\
\midrule
\multicolumn{6}{@{}l}{Varyans} \\
 \sigma_{y}  & 2 & 3 & 3 & 2 & 2.5\\
 \sigma_{c}/\sigma_{y}  & 0.50 & 0.60 & 0.76 & 1.00 & 0.72 \\
 \sigma_{g}/\sigma_{y}  & 1.11 & 1.92 & 1.88 & 0.66 & 0.86 \\
 \sigma_{i}/\sigma_{y}  & 2.15 & 2.73 & 3.30 & 4.66 & 3.31 \\
 \sigma_{x}/\sigma_{y}  & 2.61 & 3.05 & 1.75 & 3.18 & 2.94 \\
 \sigma_{m}/\sigma_{y}  & 2.30 & 1.55 & 2.48 & 4.04 & 2.48 \\
 \sigma_{tb}/\sigma_{y} & 0.62 & 0.75 & 0.44 & 1.13 & 0.83 \\
\addlinespace
\multicolumn{6}{@{}l}{Y ile korelasyon} \\
 c   &  0.58 &  0.57 &  0.72 &  0.72 &  0.63 \\
 g/y & -0.63 & -0.84 & -0.63 & -0.73 & -0.40 \\
 i   &  0.83 &  0.68 &  0.96 &  0.61 &  0.70\\
 x   &  0.75 &  0.55 &  0.66 & -0.08 &  0.39\\
 m   &  0.62 &  0.66 &  0.73 &  0.46 &  0.23\\
 tby &  0.50 &  0.32 & -0.40 & -0.20 &  0.12\\
  tb &  0.56 &  0.37 & -0.26 & -0.17 &  0.18\\
 cay & -0.21 &  0.74 & -0.68 & -0.51 &  0.13\\
\addlinespace
\multicolumn{6}{@{}l}{{Otokorelasyon}} \\
 y   & 0.67 & 0.80 & 0.73 & 0.78 & 0.78\\
 c   & 0.70 & 0.88 & 0.66 & 0.81 & 0.82\\
 g   & 0.59 & 0.86 & 0.72 & 0.64 & 0.75\\
 i   & 0.61 & 0.81 & 0.78 & 0.81 & 0.79\\
 x   & 0.44 & 0.87 & 0.67 & 0.90 & 0.82\\
 m   & 0.49 & 0.46 & 0.71 & 0.72 & 0.57\\
 tby & 0.15 & 0.94 & 0.65 & 0.89 & 0.81\\
 tb  & 0.20 & 0.93 & 0.66 & 0.89 & 0.81\\
 cay & 0.18 & 0.72 & 0.52 & 0.45 & 0.56\\
\bottomrule
\end{tabular}

\smallskip\footnotesize\raggedright 
Kaynak: Dünya Bankası verileri kullanılarak yazar tarafından oluşturulmuştur.  
\url{https://databank.worldbank.org/source/world-development-indicators}

\end{threeparttable} % <-- new
\end{table} 
\end{document}
    -
4

As Mico already explained, the reason for the too wide table is the l tpe column that you used in the last \multicolumn command. An l type column does not allow for linebreaks inside the cell. In the following example, I have replaced with a p type column. I have also used the horizontal lines from the booktabs package that you already load (twice). I have also used the siunitx package for an improved alignment of the numbers in the columns 2 to 5. I have also used tabular* in combination with @{\extracolsep{\fill}} to make the table exactly as wide as the textwidth. In the article class that I had to use because I didn't have the document class from your question, the table is already almost as wide as the textwidth. Lastly, I have also replaced the \begin{table}[H] wfrom the float package with \begin{center} \captionsetup{type=table} (uses the caption package that you already load).

enter image description here

\documentclass{article}
\usepackage[usenames]{xcolor} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{graphicx}
\usepackage[turkish]{babel}
\usepackage[T1]{fontenc}
\usepackage{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\usepackage{booktabs}
\pagenumbering{roman}
\usepackage{pstool}
\usepackage[none]{hyphenat}
\usepackage{stackengine}
\usepackage{url}
\usepackage{siunitx}

\usepackage{hyperref}
\hypersetup{ colorlinks=false, linktoc=all, hidelinks }


\begin{document}
\begin{minipage}{\textwidth}
\captionsetup{type=table}
\caption{Seçilmiş gelişmiş ülkeler için iş çevrimleri istatistikleri}
\label{tab:buscycle2}   

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}c*{5}{S[table-format=-1.2]}}

\textbf{İstatistik} & \textbf{İsviçre} & \textbf{Kanada} & \textbf{Danimarka} &  \textbf{Avustralya} & \textbf{Ortalama}  \\
\midrule
\multicolumn{6}{l}{\textbf{Varyans}} \\
 $\sigma_{y}$  & 2 & 3 & 3 & 2 & 2.5\\
 ${\sigma_{c}}/{\sigma_{y}}$ & 0.5& 0.60 & 0.76 & 1.00 & 0.72  \\
 ${\sigma_{g}}/{\sigma_{y}}$ & 1.11 & 1.92 & 1.88 & 0.66 & 0.86 \\
 ${\sigma_{i}}/{\sigma_{y}}$ & 2.15 & 2.73 & 3.30 & 4.66  & 3.31\\
 ${\sigma_{x}}/{\sigma_{y}}$ & 2.61 & 3.05 & 1.75 & 3.18  & 2.94\\
 ${\sigma_{m}}/{\sigma_{y}}$ & 2.30 & 1.55 & 2.48 & 4.04 & 2.48 \\
 ${\sigma_{tb}}/{\sigma_{y}}$ & 0.62 & 0.75  & 0.44 & 1.13  & 0.83\\
 \midrule
 \multicolumn{6}{l}{\textbf{Y ile korelasyon}} \\
 c  & 0.58 & 0.57 & 0.72 & 0.72 & 0.63 \\
 ${g}/{y}$  & -0.63 & -0.84 & -0.63 & -0.73 & -0.40 \\
 i  & 0.83 & 0.68 & 0.96 & 0.61 &  0.70\\
 x  & 0.75 & 0.55 & 0.66  & -0.08 &  0.39\\
 m  & 0.62& 0.66 & 0.73 & 0.46 & 0.23\\
 tby  &  0.50 & 0.32 & -0.40 & -0.20 &  0.12\\
  tb  & 0.56   & 0.37  & -0.26 & -0.17 & 0.18\\
 cay  & -0.21 & 0.74 & -0.68 & -0.51 & 0.13  \\
 \midrule
  \multicolumn{6}{l}{\textbf{Otokorelasyon}} \\
 y & 0.67 & 0.80 & 0.73 & 0.78 &  0.78\\
 c & 0.70 & 0.88 & 0. 66 & 0.81 &  0.82\\
 g & 0.59 & 0.86 & 0.72&0.64 &  0.75\\
 i & 0.61& 0.81 & 0.78 & 0.81 &  0.79\\
 x & 0.44&0.87 &0.67  & 0.90 & 0.82 \\
 m & 0.49 & 0.46 & 0.71 & 0.72 & 0.57\\
 tby & 0.15 &0.94 &0.65 & 0.89 & 0.81 \\
  tb & 0.20 & 0.93 & 0.66 & 0.89 & 0.81  \\
 cay & 0.18 & 0.72 & 0.52 & 0.45 & 0.56\\
 \bottomrule
    \multicolumn{6}{p{\linewidth-2\tabcolsep}}{\footnotesize Kaynak: Dünya Bankası verileri kullanılarak yazar tarafından oluşturulmuştur. \newline  \url{https://databank.worldbank.org/source/world-development-indicators} } \\

\end{tabular*}
\end{minipage} 
\end{document}
  • +1. Just curious, though, about the following: Why did you replace the table envirohment with a center environment? – Mico Aug 24 at 9:33
  • @Mico: I thought it might be better to not use [H] as a float posistion. I myself sometimes hasd problems with this approach. Instead one could use the captionof command. This however will interfere with the hypcap option from hyperref and issue a warning. This can be overcome by using \captionsetup{type=table} \caption{...}. – leandriis Aug 24 at 9:42
  • 1
    The center environment was initially used to keep the tabular and the caption together and to add some vertical white space around it. After some texting I just came to realize that a minipage is better suited to keep tabular and caption together on the same page. I have edited my question to replace center with minipage. – leandriis Aug 24 at 9:44
  • Many thanks for these explanations. – Mico Aug 24 at 9:45
  • Thank you very much for the help @leandriis – le rouge et le noir Aug 24 at 14:48
2

You need no adjustbox, but tabular*. Also, the bottom note need not be in the tabular.

I reformatted your preamble to be more consistent. A couple of \renewcommand have been commented because they are about undefined commands with the preamble (of course, I don't have buthesis, so I used book).

I removed all boldface, that's not really needed.

\documentclass{book}
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage[T1]{fontenc}
\usepackage[turkish]{babel}

\usepackage{amssymb} %maths
\usepackage{amsmath} %maths

\usepackage{siunitx}
\usepackage[usenames]{color} %used for font color
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{caption}
\usepackage{booktabs}
%\usepackage{pstool}
\usepackage[none]{hyphenat}
\usepackage{booktabs}
\usepackage{float}
\usepackage{stackengine}
%\usepackage{url}
\usepackage{hyperref}

\floatstyle{plaintop}
\restylefloat{table}

\captionsetup{justification=raggedright,singlelinecheck=false}

\hypersetup{ colorlinks=false, linktoc=all, hidelinks }

%\AtBeginDocument{\renewcommand{\BBAA}{ve}}
%\AtBeginDocument{\renewcommand{\BOthers}[1]{vd.}}

\begin{document}

\begin{table}[htp]
\captionsetup{singlelinecheck = false, justification=justified}
\caption{Seçilmiş gelişmiş ülkeler için iş çevrimleri istatistikleri}   
\label{tab:buscycle2}

\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  c
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  S[table-format=-1.2]
  @{}
}
\toprule
\textbf{İstatistik} &
{\textbf{İsviçre}} &
{\textbf{Kanada}} &
{\textbf{Danimarka}} &
{\textbf{Avustralya}} &
{\textbf{Ortalama}} \\
\midrule
\multicolumn{6}{@{}l@{}}{\textbf{Varyans}} \\
$\sigma_{y}$             & 2    & 3    & 3    & 2    & 2.5  \\
$\sigma_{c}/\sigma_{y}$  & 0.5  & 0.60 & 0.76 & 1.00 & 0.72 \\
$\sigma_{g}/\sigma_{y}$  & 1.11 & 1.92 & 1.88 & 0.66 & 0.86 \\
$\sigma_{i}/\sigma_{y}$  & 2.15 & 2.73 & 3.30 & 4.66 & 3.31 \\
$\sigma_{x}/\sigma_{y}$  & 2.61 & 3.05 & 1.75 & 3.18 & 2.94 \\
$\sigma_{m}/\sigma_{y}$  & 2.30 & 1.55 & 2.48 & 4.04 & 2.48 \\
$\sigma_{tb}/\sigma_{y}$ & 0.62 & 0.75 & 0.44 & 1.13 & 0.83 \\
\midrule
\multicolumn{6}{@{}l@{}}{\textbf{Y ile korelasyon}} \\
c     &  0.58 &  0.57 &  0.72 &  0.72 &  0.63 \\
$g/y$ & -0.63 & -0.84 & -0.63 & -0.73 & -0.40 \\
i     &  0.83 &  0.68 &  0.96 &  0.61 &  0.70 \\
x     &  0.75 &  0.55 &  0.66 & -0.08 &  0.39 \\
m     &  0.62 &  0.66 &  0.73 &  0.46 &  0.23 \\
tby   &  0.50 &  0.32 & -0.40 & -0.20 &  0.12 \\
tb    &  0.56 &  0.37 & -0.26 & -0.17 &  0.18 \\
cay   & -0.21 &  0.74 & -0.68 & -0.51 &  0.13 \\
\midrule
\multicolumn{6}{@{}l@{}}{\textbf{Otokorelasyon}} \\
y   & 0.67 & 0.80 & 0.73 & 0.78 & 0.78 \\
c   & 0.70 & 0.88 & 0.66 & 0.81 & 0.82 \\
g   & 0.59 & 0.86 & 0.72 & 0.64 & 0.75 \\
i   & 0.61 & 0.81 & 0.78 & 0.81 & 0.79 \\
x   & 0.44 & 0.87 & 0.67 & 0.90 & 0.82 \\
m   & 0.49 & 0.46 & 0.71 & 0.72 & 0.57 \\
tby & 0.15 & 0.94 & 0.65 & 0.89 & 0.81 \\
tb  & 0.20 & 0.93 & 0.66 & 0.89 & 0.81 \\
cay & 0.18 & 0.72 & 0.52 & 0.45 & 0.56 \\
\midrule[\heavyrulewidth]
\multicolumn{6}{@{}p{\textwidth}@{}}{\footnotesize\raggedright
  Kaynak: Dünya Bankası verileri kullanılarak yazar tarafından oluşturulmuştur.
  \url{https://databank.worldbank.org/source/world-development-indicators}}
\end{tabular*}
\end{table} 

\end{document}

enter image description here

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.