1

Hello everyone and thank you in advance for your help. For my bachelor thesis i want 2 tables with an arrow between them. I managed to get those 3 going, however i cant manage to get them to be next to eachother. I did already try to search for a solution but they either dont work (for example \resizebox) or i just did not understand what was going on. Everything i tried so far lead to errors i could not solve or made it even worse.

\begin{table}[h]
    \centering
    \begin{tabular}{c| l c}
       $F_\alpha$  &  $S_\pi$\\
    \hline
       A  &  $\emptyset$\\
       B  &  0A\\
       b  &  0B0A\\
       y  &  0b0B0A\\
       y  &  1b0B0A\\
       C  &  1B0A\\
       c  &  0C1B0A\\
       y  &  0c0C1B0A\\
       y  &  1c0C1B0A\\
       D  &  1C1B0A\\
       d  &  0D1C1B0A\\
       y  &  0d0D1C1B0A\\
       y  &  1d0D1C1B0A\\
       y  &  1D1C1B0A\\
       y  &  1A\\
    \end{tabular}
    \caption{Unsortierte Folge $F$}
    \label{Folge unsortiert}
    \def\Arrow{\raisebox{-.5\height}{\scalebox{4}{$\Rightarrow$}}}
    \Arrow
    \begin{tabular}{c| l c}
       $F_\alpha$  &  $S_\pi$\\
    \hline
       A  &  $\emptyset$\\
       B  &  0A\\
       b  &  0B0A\\
       y  &  0b0B0A\\
       c  &  0C1B0A\\
       y  &  0c0C1B0A\\
       d  &  0D1C1B0A\\
       y  &  0d0D1C1B0A\\
       y  &  1A\\
       C  &  1B0A\\
       y  &  1b0B0A\\
       D  &  1C1B0A\\
       y  &  1c0C1B0A\\
       y  &  1D1C1B0A\\
       y  &  1d0D1C1B0A\\
    \end{tabular}
    \caption{Sortierte Folge $F$ }
    \label{Folge sortiert}
\end{table}

This is of course not the entire code, however uploading the entire thesis would only be confusing, i guess.

This is what it looks like

As you can see, this does look horrible. All i want is all 3 objects to be right next to each other. Table1 Arrow Table2

2
  • 1
    The \caption forces linebreaks. If you want to display them side by side, use minipages inside the table environment like so: \begin{table}\begin{minipage}{.45\linewidth}\centering<table 1>\caption{<1>}\end{minipage}\hfill\Arrow\hfill\begin{minipage}{.45\linewidth}\centering<table 2>\caption{<2>}\end{minipage}\end{table}
    – Skillmon
    Feb 17, 2021 at 13:47
  • As an aside: Never use \resizebox on tables or the like, this leads to inconsistent fonts throughout the document.
    – Skillmon
    Feb 17, 2021 at 13:49

1 Answer 1

2

Converting my comment into an answer within an MWE:

You can use minipages to store the tables with their captions inside a box which can be output next to each other:

\documentclass[]{article}

\usepackage[]{graphicx}

\begin{document}
\begin{table}[h]
  \begin{minipage}{.4\linewidth}
    \centering
    \begin{tabular}{c| l c}
       $F_\alpha$  &  $S_\pi$\\
    \hline
       A  &  $\emptyset$\\
       B  &  0A\\
       b  &  0B0A\\
       y  &  0b0B0A\\
       y  &  1b0B0A\\
       C  &  1B0A\\
       c  &  0C1B0A\\
       y  &  0c0C1B0A\\
       y  &  1c0C1B0A\\
       D  &  1C1B0A\\
       d  &  0D1C1B0A\\
       y  &  0d0D1C1B0A\\
       y  &  1d0D1C1B0A\\
       y  &  1D1C1B0A\\
       y  &  1A\\
    \end{tabular}
    \caption{Unsortierte Folge $F$}
    \label{Folge unsortiert}
  \end{minipage}\hfill
  \def\Arrow{\raisebox{-.5\height}{\scalebox{4}{$\Rightarrow$}}}
  \Arrow\hfill
  \begin{minipage}{.4\linewidth}
    \centering
    \begin{tabular}{c| l c}
       $F_\alpha$  &  $S_\pi$\\
    \hline
       A  &  $\emptyset$\\
       B  &  0A\\
       b  &  0B0A\\
       y  &  0b0B0A\\
       c  &  0C1B0A\\
       y  &  0c0C1B0A\\
       d  &  0D1C1B0A\\
       y  &  0d0D1C1B0A\\
       y  &  1A\\
       C  &  1B0A\\
       y  &  1b0B0A\\
       D  &  1C1B0A\\
       y  &  1c0C1B0A\\
       y  &  1D1C1B0A\\
       y  &  1d0D1C1B0A\\
    \end{tabular}
    \caption{Sortierte Folge $F$ }
    \label{Folge sortiert}
  \end{minipage}%
\end{table}
\end{document}

enter image description here

4
  • Thank you so much. That realy solved my problem. I am sorry that you had to put in some extra efford to make it work. Again, thank you.
    – Der Sten
    Feb 17, 2021 at 13:59
  • @DerSten I'm glad I could help. However, on Q&A-kind of sites it is common to thank through votes, so that future visitors can quickly see which answers tend to be better than others.
    – Skillmon
    Feb 17, 2021 at 14:16
  • I know, i immediately did that. However they are not counted because i am new.
    – Der Sten
    Feb 17, 2021 at 14:21
  • @DerSten oh, I forget about that everytime... :)
    – Skillmon
    Feb 17, 2021 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .