2

I've created a complicated (for me) table combining multirow, multicolumn, and almost everything is ok, except the fact that I've got 2 extra vertical lines crossing the multirow-multicol cell.

It seems to me that TEX doesn't understand it's a merged cell :(

Can't find where I can fix it.

The code is below. Attached is also a screenshot with red arrows pointing to the problematic place.

Thanks in advance.

    \documentclass[10pt,paper=a5,pagesize=auto,twoside=semi,open=any,headings=small,headings=optiontohead,chapterprefix=true]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage{paratype}
\usepackage[unicode, linktocpage]{hyperref}
\usepackage{tabulary}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage[fleqn]{amsmath}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\begin{document}
\begin{table}[h]
  \caption{Результаты моделирования}\label{tab:4.6}
  \centering
\begin{footnotesize}
\begin{tabulary}{\textwidth}{|@{}C@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|@{}P{1cm}@{}|}
    \hline
    \multirow{3}{*}{№} & \multicolumn{3}{c|}{\multirow{3}{3cm}{Вид функций, окна анализа, обозначения среднекв. амплитуд и отношений $\frac{S}{N}$}} & \multicolumn{6}{p{6cm}|}{Значения амплитуд и отношений $\frac{S}{N}$} \\
    \cline{5-10}
      & & & & \multicolumn{2}{p{2cm}|}{Вариант 1 \newline($r=-0.02$)} &\multicolumn{2}{p{2cm}|}{Вариант 2 \newline($r=+0.23548$)}& \multicolumn{2}{p{2cm}|}{Вариант 3 \newline($r=-0.36664$)} \\
    \cline{5-10}
      & & & & $\frac{S}{N}$ = 5 & $\frac{S}{N}$ = 2 & $\frac{S}{N}$ = 5 & $\frac{S}{N}$ = 2& $\frac{S}{N}$ = 5 & $\frac{S}{N}$ = 2\\
    \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
    \hline
    2 & \multirow{3}{1cm}{$\Delta T_1$ = 80 мс} & ампл. помехи $N$ & $\sigma_{1N}$ & \multicolumn{2}{c|}{8.01} & \multicolumn{2}{c|}{6.67} & \multicolumn{2}{c|}{7.18} \\
    \cline{1-1}\cline{3-10}
    3 & & ампл. сигн. $S$ & $\sigma_{1S}$ & 40.04 & 16.01 & 33.35 & 13.34 & 35.91 & 14.36\\
    \cline{1-1}\cline{3-10}
    4 & & ампл. суммы $N+S$ & $\sigma_{1,S+N}$ & 40.64 & 17.73 & 35.52 & 16.26 & 33.94 & 13.50 \\
    \hline
    5 & \multirow{2}{1cm}{$\Delta T_2$ = 300 мс} & ампл. помехи $N$ & $\sigma_{2N}$ & \multicolumn{2}{c|}{11.73} & \multicolumn{2}{c|}{6.53} & \multicolumn{2}{c|}{6.53} \\
    \cline{1-1}\cline{3-10}
    6 & & ампл. суммы $N+S$ & $\sigma_{2,S+N}$ & 23.85 & 14.34 & 19.32 & 10.12 & 18.48 & 8.84 \\
    \hline
    7 & \multicolumn{3}{p{3cm}|}{Заданное отношение $\left(\frac{S}{N}\right)_\text{ист}$ = $\frac{\sigma_{1S}}{\sigma_{1N}}$ в окне $\Delta T_1$ = 80 мс} &5&2&5&2&5&2 \\
    \hline
    8 & \multicolumn{3}{p{3cm}|}{Измеренное отношение $\left(\frac{S}{N}\right)_1$ = $\frac{\sigma_{1,S+N}}{\sigma_{1N}}$ в окне $\Delta T_1$ = 80 мс} &5.08&2.21&5.32&2.44&4.73&1.88 \\
    \hline
    9 & \multicolumn{3}{p{3cm}|}{Измеренное отношение $\left(\frac{S}{N}\right)_2$ = $\frac{\sigma_{2,S+N}}{\sigma_{2N}}$ в окне $\Delta T_2$ = 300 мс (имитация практической схемы)} & 2.03&1.22&2.96&1.55&2.83&1.35 \\
    \hline
\end{tabulary}
\end{footnotesize}
\end{table}
\end{document} 

Screenshot of the dvi file

1 Answer 1

2

You need to repeat \multicolumn{3}{c|}{} for all rows occupied by multirow. Then you will obtain:

enter image description here

\documentclass[10pt,paper=a5,pagesize=auto,twoside=semi,open=any,headings=small,headings=optiontohead,chapterprefix=true]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage{paratype}
\usepackage[unicode, linktocpage]{hyperref}
\usepackage{multirow,tabulary}
\usepackage{adjustbox}
\usepackage[fleqn]{amsmath}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}
\begin{table}[htb]
    \centering
    \footnotesize
  \caption{Результаты моделирования}\label{tab:4.6}
\begin{tabulary}{\textwidth}{|@{}C@{}
                             |*{9}{@{}P{1.2cm}@{}|}% <--- changed
                             }
    \hline
\multirow{4}{*}{№} % <--- changed
    &   \multicolumn{3}{c|}{\multirow{4}{3cm}{% <--- changed
            Вид функций, окна анализа, обозначения среднекв. Aмплитуд и отношений $\frac{S}{N}$}}
        &   \multicolumn{6}{p{6cm}|}{Значения амплитуд и отношений $\frac{S}{N}$}  \\
    \cline{5-10}
    &   \multicolumn{3}{c|}{}% <--- added
          & \multicolumn{2}{p{2cm}|}{Вариант 1 \newline($r=-0.02$)}
            &   \multicolumn{2}{p{2cm}|}{Вариант 2 \newline($r=+0.23548$)}
                &   \multicolumn{2}{p{2cm}|}{Вариант 3 \newline($r=-0.36664$)} \\
    \cline{5-10}
    & \multicolumn{3}{c|}{}% <--- added
        & $\frac{S}{N}$ = 5 & $\frac{S}{N}$ = 2 & $\frac{S}{N}$ = 5 & $\frac{S}{N}$ = 2& $\frac{S}{N}$ = 5 & $\frac{S}{N}$ = 2\\
    \hline
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\
    \hline
    2 & \multirow{3}{1cm}{$\Delta T_1$ = 80 мс} & ампл. помехи $N$ & $\sigma_{1N}$ & \multicolumn{2}{c|}{8.01} & \multicolumn{2}{c|}{6.67} & \multicolumn{2}{c|}{7.18} \\
    \cline{1-1}\cline{3-10}
    3 & & ампл. сигн. $S$ & $\sigma_{1S}$ & 40.04 & 16.01 & 33.35 & 13.34 & 35.91 & 14.36\\
    \cline{1-1}\cline{3-10}
    4 & & ампл. суммы $N+S$ & $\sigma_{1,S+N}$ & 40.64 & 17.73 & 35.52 & 16.26 & 33.94 & 13.50 \\
    \hline
    5 & \multirow{2}{1cm}{$\Delta T_2$ = 300 мс} & ампл. помехи $N$ & $\sigma_{2N}$ & \multicolumn{2}{c|}{11.73} & \multicolumn{2}{c|}{6.53} & \multicolumn{2}{c|}{6.53} \\
    \cline{1-1}\cline{3-10}
    6 & & ампл. суммы $N+S$ & $\sigma_{2,S+N}$ & 23.85 & 14.34 & 19.32 & 10.12 & 18.48 & 8.84 \\
    \hline
    7 & \multicolumn{3}{p{3cm}|}{Заданное отношение $\left(\frac{S}{N}\right)_\text{ист}$ = $\frac{\sigma_{1S}}{\sigma_{1N}}$ в окне $\Delta T_1$ = 80 мс} &5&2&5&2&5&2 \\
    \hline
    8 & \multicolumn{3}{p{3cm}|}{Измеренное отношение $\left(\frac{S}{N}\right)_1$ = $\frac{\sigma_{1,S+N}}{\sigma_{1N}}$ в окне $\Delta T_1$ = 80 мс} &5.08&2.21&5.32&2.44&4.73&1.88 \\
    \hline
    9 & \multicolumn{3}{p{3cm}|}{Измеренное отношение $\left(\frac{S}{N}\right)_2$ = $\frac{\sigma_{2,S+N}}{\sigma_{2N}}$ в окне $\Delta T_2$ = 300 мс (имитация практической схемы)} & 2.03&1.22&2.96&1.55&2.83&1.35 \\
    \hline
\end{tabulary}
\end{table}
\end{document} 

In code the changes are designated by % <--- ...`

3
  • Thank you, that did the trick. Also thanks for optimizing layout of tabulary arguments :). I've got one question left - why did you increase the number of rows from 3 to 4 in the first and second cells of the table? At a first glance, they still occupy three.
    – Alexandre
    Mar 9, 2016 at 6:52
  • 2
    Multirow actually count number of lines not rows. This seems not to be enough clear emphasize in its instructions (unfortunately, it hasn't "real" manual). As you see, cells in the rows span with multirow altogether have 4 lines.
    – Zarko
    Mar 9, 2016 at 7:38
  • Thanks for the explanation, Zarko! I'll keep that in mind in future
    – Alexandre
    Mar 9, 2016 at 7:41

You must log in to answer this question.

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