0

This is the code:

\documentclass[twoside,headsepline,12pt,a4paper,bibliography=totoc,toc=listof,DIV=14,BCOR=2mm,]{scrbook}

\usepackage{longtable}          
\usepackage{siunitx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{makecell}
\usepackage{tabularx}
\usepackage{geometry}

\begin{document}
 \begin{table}
           \centering
           \begin{subtable}{0.4\linewidth}
           \small    \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{|c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:a}
           \end{subtable}%
           \hspace*{4em}
           \begin{subtable}{0.4\linewidth}
               \centering
            \small   \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{|c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:b}
           \end{subtable}%
           \quad
           \begin{subtable}{0.4\linewidth}
               \centering
           \small    \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{|c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:c}
           \end{subtable}%
           \hspace*{4em}
           \begin{subtable}{0.4\linewidth}
               \centering
          \small    \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{|c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:d}
           \end{subtable}%
           \label{tab:d}
  \caption{A vs B}
       \end{table}

\end{document}

enter image description here

How do I not overlap them ?

In case I have defined some page specification before and now my tables size are such that it is impossible to fit into a single page, then is it advisable to change the sizes of the tables and the characters inside the table to fit them nicely into a single page ? if in case I would like to fit them by changing their size how do I do that ? Please help.

  • @DavidCarlisle....I edited my question. And \small doesnt seem to do any help. – gocjack Dec 8 '16 at 10:32
1

Another approach:

  • not reduced font size in the table
  • reduced tabcolsep from default value to 2pt

enter image description here

An alternative to this can be

  • reduced tabcolspace to 3pt
  • use \small fonts

(not shown).

The red frame is added to show page layout. In real document the

\usepackage{showframe}
\renewcommand*\ShowFrameColor{\color{red}}

in preamble had to be removed.

\documentclass[twoside,headsepline,12pt,a4paper,bibliography=totoc,toc=listof,DIV=14,BCOR=2mm,]{scrbook}
\usepackage{longtable}
\usepackage{siunitx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{makecell}
\usepackage{tabularx}

\usepackage{showframe}
\renewcommand*\ShowFrameColor{\color{red}}

\usepackage{lipsum}

\begin{document}
\lipsum[2]
    \begin{table}[htb]
    \centering
%    \small
    \setlength\tabcolsep{2pt}
           \begin{subtable}{0.5\linewidth}
           \centering
           \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular}
               \caption{A vs B}
               \label{tab:a}
           \end{subtable}%
           \begin{subtable}{0.5\linewidth}
           \centering
            \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular}
               \caption{A vs B}
               \label{tab:b}
           \end{subtable}%

           \begin{subtable}{0.5\linewidth}
           \centering
           \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular}
               \caption{A vs B}
               \label{tab:c}
           \end{subtable}%
           \begin{subtable}{0.5\linewidth}
           \centering
          \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\
        \cline{2-5}
         & \textbf{$k=0.1$} & \textbf{$k=0.3$} & \textbf{$k=0.6$} & \textbf{$k=0.8$} \\
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular}
               \caption{A vs B}
               \label{tab:d}
           \end{subtable}%
           \label{tab:d}
  \caption{A vs B}
       \end{table}
\end{document}

Edit: From comment below follows that text with in real document is smaller as we are informed trough MWE given in question. In this case the width of table had to be reduced accordingly. For example, beginning of table:

\begin{table}[htb]
\centering
%    \small
\setlength\tabcolsep{2pt}

replace with.

\begin{table}[htb]
\centering
\footnotesize
\setlength\tabcolsep{2pt}

this fit the text width if you in preamble you have:

\usepackage{geometry}

hope this will help. Let me noted, that approach with reducing of fonts size and \tabcolsep size has limits. Fonts at tiny which would be for many people to small for reading without magnifying glass :(.

  • Sorry I should have mentioned before, I am using the package "geomerty", this is mandatory in my case and when I use this package above code does NOT work. – gocjack Dec 8 '16 at 12:12
  • Code perfectly work, however, you change page layout. To adopt to new (smaller) page width, you also need to resize tables width! For example,in my MWE uncomment line with \small and also replace it with \footnotesize. See edit of my answer. – Zarko Dec 8 '16 at 12:34
  • Thanks a ton, it fixed all the problems. One last question is [htb] makes the text structure in the document perfect but pushes the tables here and there to accommodate that perfect structure of the document. But [H] puts the table where it necessary but pushes the text before the table and after the table to somewhat unstructured way, can you please comment a bit on that. Thanks. – gocjack Dec 8 '16 at 16:54
  • About positioning of figures are many answers with good explanation on the site ... shortly: if you like to have beautiful document, newer use [H]. Also newer use only [h]. In case, that is not enough space for image on the page, TeX doesn't know where to put figure and the usually push image on the end of file as unprocessed float. So the best choice is htbp where p stand for page and alow that whole page is used by figure. – Zarko Dec 8 '16 at 17:19
2

\small is too big, you need \tiny Also you were using fixed size spaces between the subtable enviornments which did not correctly add up to the total line width, so I replaced those by \hfill (actually no space would be Ok as I made the subtables .5\linewidth, no need to squeeze them in to .4\linewidth and lose 20% of the available space.) (are you sure you want to fit them side by side...)

I also fixed your \multicolumn and bold math usage

\documentclass[twoside,headsepline,12pt,a4paper,bibliography=totoc,toc=listof,DIV=14,BCOR=2mm,]{scrbook}

\usepackage{longtable}          
\usepackage{siunitx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{makecell}
\usepackage{tabularx}

\begin{document}
 \begin{table}
           \centering
           \begin{subtable}{0.5\linewidth}
        \centering\tiny
             \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & {\boldmath$k=0.1$} & {\boldmath$k=0.3$} & {\boldmath$k=0.6$} & {\boldmath$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:a}
           \end{subtable}%
           \hfill
           \begin{subtable}{0.5\linewidth}
               \centering
            \tiny\begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & {\boldmath$k=0.1$} & {\boldmath$k=0.3$} & {\boldmath$k=0.6$} & {\boldmath$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:b}
           \end{subtable}%

           \begin{subtable}{0.5\linewidth}
               \centering
           \tiny\begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & {\boldmath$k=0.1$} & {\boldmath$k=0.3$} & {\boldmath$k=0.6$} & {\boldmath$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:c}
           \end{subtable}%
           \hfill
           \begin{subtable}{0.5\linewidth}
               \centering
          \tiny    \begin{tabular}{|l|*{4}{c|}}
        \hline
        \textbf{Rate} & \multicolumn{4}{c|}{$V_{out}$ in \SI{}{Volts}} \\ 
        \cline{2-5}
         & {\boldmath$k=0.1$} & {\boldmath$k=0.3$} & {\boldmath$k=0.6$} & {\boldmath$k=0.8$} \\ 
        \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} &  & & & \\
    \hline
    \SI{1}{xyzabc} &  & & & \\
    \hline
    \SI{5}{xyzabc} &  & & & \\
    \hline
    \SI{10}{xyzabc} &  & & & \\
    \hline
    \SI{15}{xyzabc} &  & & & \\
    \hline
    \SI{17}{xyzabc} &  & & & \\
    \hline
    \SI{20}{xyzabc} &  & & & \\
    \hline
    \SI{30}{xyzabc} &  & & & \\
    \hline
    \SI{50}{xyzabc} &  & & & \\
    \hline
    \SI{100}{xyzabc} & & & & \\
    \hline
    \end{tabular} 
               \caption{A vs B}
               \label{tab:d}
           \end{subtable}%

  \caption{A vs B}
       \end{table}

\end{document}

enter image description here

  • These four tables constitute complete result so I think putting them together in a single page gives the user the easy access to compare and check. Please give your feedback if you have any suggestions, I am open to consider them. Regards. – gocjack Dec 8 '16 at 11:10
  • @statisticalbeginner if it's pdf then it doesn't really matter but on paper \tiny is pretty much unreadable for people of a certain age, see zarko's answer for some possible re-arrangements – David Carlisle Dec 8 '16 at 11:46

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.