3

I want to put 3 tables side by side but they are to big for me to use \quad, and I don't know how to resize it so it cant fit. Tried \quad, and trying to make the font smaller with \small before \begin{tabular}, but can't use \small without \begin{table} and couldn't use \quad with \begin{table}.

\documentclass[a4paper, 11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{float}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\captionsetup[table]{skip=10pt}
\usepackage{geometry}
\geometry{a4paper, margin=2.5cm}
\usepackage{indentfirst}

\begin{document}
\section{Work}

\begin{table}[H]
\caption{Dados Experimentais do Capacitor 10nF}
\begin{tabular}{|c|c|c|c|}
\hline
$f(Hz)$ & $\omega (rad/s)$ & $V_R(V)$ & $V_C(V)$\\
\hline
100 & 628,3 & 0,043 & 7,86\\
150 & 942,5 & 0,064 & 7,85\\
200 & 1.256,6 & 0,086 & 7,84\\
300 & 1.885,0 & 0,130 & 7,82\\
400 & 2.513,3 & 0,172 & 7,80\\
500 & 3.141,6 & 0,216 & 7,89\\
1.000 & 6.283,2 & 0,427 & 7,87\\
2.000 & 12.566,4 & 0,818 & 7,79\\
\hline
\end{tabular}
\end{table}

\begin{table}[H]
\begin{center}
\caption{Dados Experimentais do Capacitor 47nF}
\begin{tabular}{|c|c|c|c|}
\hline
$f(Hz)$ & $\omega (rad/s)$ & $V_R(V)$ & $V_C(V)$\\
\hline

100 & 628,3 & 0,215 & 7,85\\
150 & 942,5 & 0,323 & 7,84\\
200 & 1.256,6 & 0,429 & 7,83\\
300 & 1.885,0 & 0,641 & 7,79\\
400 & 2.513,3 & 0,849 & 7,74\\
500 & 3.141,6 & 1,053 & 7,69\\
1.000 & 6.283,2 & 2,027 & 7,57\\
2.000 & 12.566,4 & 3,513 & 6,79\\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{table}[H]
\begin{center}
\caption{Dados Experimentais do Capacitor 220nF}
\begin{tabular}{|c|c|c|c|}
\hline
$f(Hz)$ & $\omega (rad/s)$ & $V_R(V)$ & $V_C(V)$\\
\hline

100 & 628,3 & 1,119& 7,77\\
150 & 942,5 & 1,652 & 7,66\\
200 & 1.256,6 & 2,161 & 7,51\\
300 & 1.885,0 & 3,070 & 7,15\\
400 & 2.513,3 & 3,825 & 6,71\\
500 & 3.141,6 & 4,480 & 6,34\\
1.000 & 6.283,2 & 6,210 & 4,40\\
2.000 & 12.566,4 & 7,090 & 2,42\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
8
  • Welcome to Tex.SE :) // Can you please complete your code (preamble, begin/end document), so that we can just copy and run your code? Thanks. // Hint: you may want to have a look at minipage, which allows you to split parts of a page into columns. See e.g. here: latex-tutorial.com/minipage-latex .
    – MS-SPO
    Commented Apr 28, 2022 at 12:29
  • Note that in general it is not a good idea to resize a table like that as one ends up with very inconsistent font sizes. Often it is a better idea to redesign ones tables. BTW: why is the both numbers with . and ,?
    – daleif
    Commented Apr 28, 2022 at 12:32
  • @daleif: I guess the comma is a decimal comma, and the dot is a thousand separator.
    – Bernard
    Commented Apr 28, 2022 at 12:58
  • Just updated the code so you can run it. @MS-SPO Commented Apr 28, 2022 at 13:30
  • 1
    @daleif comma is the decimal point and the dot is the thousand separator, as Bernard said. Commented Apr 28, 2022 at 13:31

3 Answers 3

5

A simple solution, if you are allowed (it seems to be part of some lab report, there might be restrictions), is to join columns of your tables, since all of them share frequency f and angular speed \omega.

As you are writing in Brazilian Portuguese, I advice to use \usepackage[brazil]{babel}. Congrats for using utf8 and also indentfirst. I also added \captionsetup{textformat=period}, so you may add a period at the end of the captions of tables and figures without actually having to type them, if you don't need it, just remove it.

About decimals separators, I always suggest to my students a quick read in the page Decimal separator in Wikipedia. It is simple, but give us an overview why it is such a complicated theme. There are many standards around the world and things like using or not using period/comma/whatever are always dependent of some previous definition, some standard. To deal with this issue, we have the package siunitx. It enables a whole set of modifications with numbers and units. Give this package a try.

In this sense, I configurated sisetup in order to using commas and periods as you are using in your table and I created a replica of the first table using a \newcolumtype based on siunitx. You might also take a look at Tip on how to make a visually good table.

\documentclass[a4paper, 11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}

\usepackage{float}
\usepackage{caption}
\captionsetup{textformat=period}
\captionsetup[table]{skip=10pt}
\usepackage{geometry}
\geometry{a4paper, margin=2.5cm}
\usepackage{indentfirst}

\usepackage{siunitx}
\sisetup{output-decimal-marker = {,},
  group-separator = {.},
  group-minimum-digits = 3}
\newcolumntype{N}[1]{S[table-format=#1]}

\begin{document}
\section{Trabalho}

\begin{table}[H]
  \centering
  \caption{Dados Experimentais dos Capacitores}
  \begin{tabular}{|r|r| c|c| c|c| c|c|}
    \hline
    \multicolumn{2}{|c|}{}     & \multicolumn{2}{c}{10nF} & \multicolumn{2}{|c}{47nF} & \multicolumn{2}{|c|}{220nF} \\
    \hline
    $f(Hz)$ & $\omega (rad/s)$ & $V_R(V)$ &   $V_C(V)$    & $V_R(V)$ &    $V_C(V)$    & $V_R(V)$ &     $V_C(V)$     \\
    \hline
        100 &            628,3 & 0,043    &     7,86      & 0,215    &      7,85      & 1,119    &       7,77       \\
        150 &            942,5 & 0,064    &     7,85      & 0,323    &      7,84      & 1,652    &       7,66       \\
        200 &          1 256,6 & 0,086    &     7,84      & 0,429    &      7,83      & 2,161    &       7,51       \\
        300 &          1 885,0 & 0,130    &     7,82      & 0,641    &      7,79      & 3,070    &       7,15       \\
        400 &          2 513,3 & 0,172    &     7,80      & 0,849    &      7,74      & 3,825    &       6,71       \\
        500 &          3 141,6 & 0,216    &     7,89      & 1,053    &      7,69      & 4,480    &       6,34       \\
      1 000 &          6 283,2 & 0,427    &     7,87      & 2,027    &      7,57      & 6,210    &       4,40       \\
      2 000 &         12 566,4 & 0,818    &     7,79      & 3,513    &      6,79      & 7,090    &       2,42       \\
    \hline
  \end{tabular}
\end{table}

\begin{table}[H]
  \centering
  \caption{Dados Experimentais dos Capacitores}
  \begin{tabular}{|N{4}|N{4}| N{1.3}|N{1.2}| N{1.3}|N{1.2}| N{1.3}|N{1.2}|}
    \hline
    \multicolumn{2}{|c|}{}         & \multicolumn{2}{c}{10nF} & \multicolumn{2}{|c}{47nF} & \multicolumn{2}{|c|}{220nF} \\
    \hline
    {$f(Hz)$} & {$\omega (rad/s)$} & {$V_R(V)$} & {$V_C(V)$}  & {$V_R(V)$} & {$V_C(V)$}   & {$V_R(V)$} & {$V_C(V)$}     \\
    \hline
    100       & 628,3              & 0,043      & 7,86        & 0,215      & 7,85         & 1,119      & 7,77           \\
    150       & 942,5              & 0,064      & 7,85        & 0,323      & 7,84         & 1,652      & 7,66           \\
    200       & 1 256,6            & 0,086      & 7,84        & 0,429      & 7,83         & 2,161      & 7,51           \\
    300       & 1 885,0            & 0,130      & 7,82        & 0,641      & 7,79         & 3,070      & 7,15           \\
    400       & 2 513,3            & 0,172      & 7,80        & 0,849      & 7,74         & 3,825      & 6,71           \\
    500       & 3 141,6            & 0,216      & 7,89        & 1,053      & 7,69         & 4,480      & 6,34           \\
    1 000     & 6 283,2            & 0,427      & 7,87        & 2,027      & 7,57         & 6,210      & 4,40           \\
    2 000     & 12 566,4           & 0,818      & 7,79        & 3,513      & 6,79         & 7,090      & 2,42           \\
    \hline
  \end{tabular}
\end{table}
\end{document}

First table with basic parameters.

enter image description here

Second table with siunitx using \newcolumntype{N}[1]{S[table-format=#1]}, to short a little bit the syntax and to enable some local configurations.

enter image description here

2
  • 1
    Saudações do Brasil. @Laura Martins, please revise if the suggestions I gave are suitable for your document/report.
    – FHZ
    Commented Apr 28, 2022 at 17:35
  • 1
    Note: As I suggested and used the package siunitx, I should also have inserted units using commands from those package. My mistake forgetting it. Spacing and fonts would be much better.
    – FHZ
    Commented Apr 28, 2022 at 18:25
2

As one table with three groups separated by double vertical lines, for table is used tabularray package and columns are S type (defined in the siunitx package):

\documentclass[a4paper, 11pt]{article}
\usepackage{geometry}
\geometry{a4paper, margin=2.5cm}

\usepackage[skip=1ex]{caption}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}

\begin{document}
\section{Work}
    \begin{table}[ht] % <---
\sisetup{
    output-decimal-marker={,},
    group-separator={.},
    group-minimum-digits=4
         }
    \centering        % <---  
    \caption{Dados Experimentais do Capacitor \qty{10}{nF}, \qty{47}{nF} and \qty{220}{nF}}
\begin{tblr}{vline{1,2}={2-Z}{solid},
             vline{3,5,7,9} = {1}{-}{},
             vline{3,5,7,9} = {2}{-}{},
             vline{4,6,8} = {solid},
             colspec = {S[table-format=4.0]
                        S[table-format=5.1]
                        *{6}{S[table-format=1.3]}
                        },
             row{2} = {mode=math},
             }
    \cmidrule[1pt]{3-9}
        &           & \SetCell[c=2]{c} {{{\qty{10}{\nano\farad}}}}
                            &       & \SetCell[c=2]{c} {{{\qty{47}{\nano\farad}}}}
                                            &       & \SetCell[c=2]{c} {{{\qty{220}{\nano\farad}}}}
                                                            &               \\
    \midrule[1pt]
{{{f\; (\unit{Hz})}}}
        & {{{\omega\; (\unit{rad/s})}}}
                    & {{{V_R(V)}}}
                            & {{{V_C(V)}}}
                                    & {{{V_R(V)}}}
                                            & {{{V_C(V)}}}
                                                    & {{{V_R(V)}}}
                                                            & {{{V_C(V)}}}  \\
    \midrule
  100   &    628,3  & 0,043 & 7,86  & 0,215 & 7,85  & 1,119 & 7,77          \\
  150   &    942,5  & 0,064 & 7,85  & 0,323 & 7,84  & 1,652 & 7,66          \\
  200   &  1 256,6  & 0,086 & 7,84  & 0,429 & 7,83  & 2,161 & 7,51          \\
  300   &  1 885,0  & 0,130 & 7,82  & 0,641 & 7,79  & 3,070 & 7,15          \\
  400   &  2 513,3  & 0,172 & 7,80  & 0,849 & 7,74  & 3,825 & 6,71          \\
  500   &  3 141,6  & 0,216 & 7,89  & 1,053 & 7,69  & 4,480 & 6,34          \\
1 000   &  6 283,2  & 0,427 & 7,87  & 2,027 & 7,57  & 6,210 & 4,40          \\
2 000   & 12 566,4  & 0,818 & 7,79  & 3,513 & 6,79  & 7,090 & 2,42          \\
    \bottomrule
\end{tblr}
\end{table}
\end{document}

enter image description here

1

If you really want to put three tables side by side you can use this:

\documentclass[a4paper, 11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{float}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\captionsetup[table]{skip=10pt}
\usepackage{geometry}
\geometry{a4paper, margin=2.5cm}
\usepackage{indentfirst}

% added packages:
\usepackage{adjustbox}
\usepackage{subcaption}

\begin{document}
\section{Work}

% changed:
\begin{table}[H]
    \centering
    \caption{Dados Experimentais do Capacitor}
    \begin{subtable}{.3\textwidth}
        \centering
        \adjustbox{width=\textwidth}{
            \begin{tabular}{|c|c|c|c|}
                \hline
                $f(Hz)$ & $\omega (rad/s)$ & $V_R(V)$ & $V_C(V)$\\
                \hline
                100 & 628,3 & 0,043 & 7,86\\
                150 & 942,5 & 0,064 & 7,85\\
                200 & 1.256,6 & 0,086 & 7,84\\
                300 & 1.885,0 & 0,130 & 7,82\\
                400 & 2.513,3 & 0,172 & 7,80\\
                500 & 3.141,6 & 0,216 & 7,89\\
                1.000 & 6.283,2 & 0,427 & 7,87\\
                2.000 & 12.566,4 & 0,818 & 7,79\\
                \hline
            \end{tabular}
        }
        \caption{10nF}
        \label{table1}
    \end{subtable}
    \begin{subtable}{.3\textwidth}
        \centering
        \adjustbox{width=\textwidth}{
            \begin{tabular}{|c|c|c|c|}
                \hline
                $f(Hz)$ & $\omega (rad/s)$ & $V_R(V)$ & $V_C(V)$\\
                \hline
                100 & 628,3 & 0,215 & 7,85\\
                150 & 942,5 & 0,323 & 7,84\\
                200 & 1.256,6 & 0,429 & 7,83\\
                300 & 1.885,0 & 0,641 & 7,79\\
                400 & 2.513,3 & 0,849 & 7,74\\
                500 & 3.141,6 & 1,053 & 7,69\\
                1.000 & 6.283,2 & 2,027 & 7,57\\
                2.000 & 12.566,4 & 3,513 & 6,79\\
                \hline
            \end{tabular}
        }
        \caption{47nF}
        \label{table2}
    \end{subtable}
    \begin{subtable}{.3\textwidth}
        \centering
        \adjustbox{width=\textwidth}{
            \begin{tabular}{|c|c|c|c|}
                \hline
                $f(Hz)$ & $\omega (rad/s)$ & $V_R(V)$ & $V_C(V)$\\
                \hline
                100 & 628,3 & 1,119& 7,77\\
                150 & 942,5 & 1,652 & 7,66\\
                200 & 1.256,6 & 2,161 & 7,51\\
                300 & 1.885,0 & 3,070 & 7,15\\
                400 & 2.513,3 & 3,825 & 6,71\\
                500 & 3.141,6 & 4,480 & 6,34\\
                1.000 & 6.283,2 & 6,210 & 4,40\\
                2.000 & 12.566,4 & 7,090 & 2,42\\
                \hline
            \end{tabular}
        }
        \caption{220nF}
        \label{table3}
    \end{subtable}
\end{table}
\end{document}

Three tables side by side.

4
  • Nica answer. As far as I like adjustbox, as you loaded subcaption, I feel that \subcaptionbox would be even better. It would enable a quick change in the relativa position of subcaption and subtable.
    – FHZ
    Commented Apr 28, 2022 at 18:18
  • The command subcationbox does not automatically reduce the font size (like adjustbox). Or is there an option for this?
    – GuestPost
    Commented Apr 28, 2022 at 18:32
  • Hi, @GuestPost. I really don't remember, as far as I remember you are right and it doesn't reduce font size. I shall check it.
    – FHZ
    Commented Apr 28, 2022 at 18:36
  • I tested and subcaptionbox don't change font size. I would have to use both in order to reduce fonte size and change relative position of caption and object.
    – FHZ
    Commented Apr 28, 2022 at 18:47

You must log in to answer this question.

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