1

What am I doing wrong? Can't figure it out! Keep receiving \multispan \omit.

Thanks

\begin{center}
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        \textbf{taxa de amostragem} & \multicolumn{4}{|c|}{\textbf{44.1k Htz}} & \multicolumn{4}{|c|}{\textbf{48k Htz}} & \multicolumn{4}{|c|}{\textbf{96k Htz}} & \multicolumn{4}{|c|}{\textbf{192k Htz}}\\
        \hline
        \small  \textbf{duração da amostra (ms)} & \small \multicolumn{4}{|c|}{0.0226} & \small \multicolumn{4}{|c|}{0.0208} & \multicolumn{4}{|c|}{0.0104} & \multicolumn{4}{|c|}{0.0052} \\
        \hline
        \small  \textbf{tamanho do bloco} & \small 128 & \small 256 & \small 512 & \small 1024 & \small 128 & \small 256 & \small 512 & \small 1024 & \small 128 & \small 256 & \small 512 & \small 1024 & \small 128 & \small 256 & \small 512 & \small 1024 \\
        \hline
        \small \textbf{duração do bloco (ms)} & \small 2.90 & \small 5.80 & \small 11.60 & \small 23.21 & \small 2.66 & \small 5.33 & \small 10.66 & \small 21.33 & \small 1.33 & \small 2.66 & \small 5.33 & \small 10.66 & \small 0.66 & \small 1.33 & \small 2.66 & \small 5.33 \\
        \hline
    \end{tabular}
\end{center}
3
  • 1
    dmallWelcome to TeX SX! You've written \small followed by aa \multicolumn several times. Write it inside, or better, set it for the whole table, just after begin{center]. That said, this table can'ty fit on the text width. Either you print it in elandscape, or better, you rewrite it swapping rows and columns.
    – Bernard
    Commented Jul 6, 2018 at 23:44
  • 1
    Of course, we don't know your text width, so perhaps you are using A2 paper or doing a poster. Could you please edit your code to make it compilable? That will show us the dimensions of the text block and how the paper is orientated.
    – cfr
    Commented Jul 7, 2018 at 0:51
  • Off-topic: "Htz" is a non-standard abbreviation for "Hertz" (the frequency unit). I believe "Hz" is the standard abbreviation. Also, the k ("kilo") term should be placed together with "Hz". Thus, don't write "44.1k Htz"; instead, write "44.1 kHz", etc. Your readers will quite likely appreciate it.
    – Mico
    Commented Jul 7, 2018 at 7:14

2 Answers 2

1

I'd rather propose this layout, if it has to fit an ordinary size of paper, with rows and columns swapped, a,d loadin siunitx for the alignment of numbers, and a proper typing if numbers with units:

\documentclass{article}
\usepackage{array, makecell, multirow}
\renewcommand{\theadfont}{\small\bfseries}
\usepackage{siunitx}

\begin{document}

 \begin{center}
\setlength{\extrarowheight}{2pt}
\sisetup{detect-weight, table-number-alignment=center}
 \begin{tabular}{|c|c|S[table-format=4.0]| S[table-format=2.2]|}%c|c|c|c|c|c|c|c|c|c|c|c|c|}
 \hline
 \thead{taxa de\\ amostragem} &\thead{duração da\\ amostra (ms)} & {\thead{tamanho\\ do bloco}} & {\thead{duração\\ do bloco (ms)}} \\
\hline
 \multirowthead{4} {\SI{44.1}{\kHz}} & \multirowcell{4}{ 0.0226} & 128 & 2.90 \\
 & & 256 & 5.80\\
 & & 512 & 11.60 \\
  & & 1024 & 23.21 \\
 \hline
 \multirowthead{4}{\SI{48}{\kHz}} & \multirowcell{4}{ 0.0208} & 128 & 2.66 \\
 & & 256 & 5.33 \\
 & & 512 & 10.66 \\
  & & 1024 & 21.33 \\
 \hline
 \multirowthead{4}{\SI{96}{\kHz}} & \multirowcell{4}{0.0104} & 128 & 1.33 \\
  & & 256 & 2.66 \\
   & & 512 & 5.33 \\
  & & 1024 & 10.66\\%128 & 256 & 512 & 1024 & 128 & 256 & 512 & 1024 \\
 \hline
 \multirowthead{4}{\SI{192}{\kHz}} & \multirowcell{4}{0.0052} & 128 & 0.66 \\
  & & 256 & 1.33 \\
   & & 512 & 2.66 \\
  & & 1024 & 5.33 \\%
 \hline
 \end{tabular}
 \end{center}

 \end{document}

enter image description here

0

If you must keep the 4-row/17-column layout of the tabular material, i.e., if you can't transpose the material as suggested in @Bernard's answer, I suggest you modify your code as follows:

  • Use a single \small directive for the entire table
  • Use a tabular* environment instead of a tabular* environment
  • Use no vertical lines and fewer, but well-spaced, horizontal lines
  • Use the \SI macro (provided by the siunitx package) to typeset numbers and their scientific units
  • Don't use bold-facing -- unless you want to create the impression that it's necessary to shout at your readers

enter image description here

\documentclass{article}
\usepackage[letterpaper,margin=1in]{geometry} % choose paper size and margins appropriately
\usepackage{booktabs,siunitx}
\begin{document}
\begin{table}[ht!]
\setlength\tabcolsep{0pt} % make LaTeX figure out intercolumn whitespace automatically
\small
    \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l *{16}{c} }
    \toprule
    Taxa de amostragem & 
    \multicolumn{4}{c}{\SI{44.1}{\kilo\hertz}} & 
    \multicolumn{4}{c}{\SI{48}{\kilo\hertz}} & 
    \multicolumn{4}{c}{\SI{96}{\kilo\hertz}} & 
    \multicolumn{4}{c}{\SI{192}{\kilo\hertz}}\\
    Duração da amostra (ms) & 
    \multicolumn{4}{c}{0.0226} & 
    \multicolumn{4}{c}{0.0208} & 
    \multicolumn{4}{c}{0.0104} & 
    \multicolumn{4}{c}{0.0052} \\
    \cmidrule{2-5} \cmidrule{6-9} \cmidrule{10-13} \cmidrule{14-17} 
    Tamanho do bloco & 
        128 & 256 & 512 & 1024 & 128 & 256 & 512 & 1024 & 128 & 256 & 512 & 1024 & 128 & 256 & 512 & 1024 \\
    Duração do bloco (ms) & 
        2.90 & 5.80 & 11.60 & 23.21 & 2.66 & 5.33 & 10.66 & 21.33 & 1.33 & 2.66 & 5.33 & 10.66 & 0.66 & 1.33 & 2.66 & 5.33 \\
    \bottomrule
    \end{tabular*}
\end{table}
\end{document}

You must log in to answer this question.

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