5

We have a tabu table with figures and \multirow cell which contails a long figure (XeLaTeX is used). Minimal working example is in the end.

The Figure (arrow) is attached after the actual result.

Alignment rules

  • column heading is centered (vertically and horizontally), colored and bold;
  • 1,2,4 columns are centered vertically and left edge horizontally;
  • 3,5 columns - centered both vertically and horizontally.

set by

\taburulecolor{DarkBlue}
\tabulinesep = 2mm
\begin{tabu} to 170 mm {
        |X[2,m]
        |X[1.5,m]
        |X[0.6, C,m]
        |X[2,m]
        |X[0.6, C,m]|
        }


\rowfont{\centering\bfseries\color{Blue}}

Column 5 has a Figure in multirow cell \multirow{8}{*}{\includegraphics[height=8cm]{arrow.PNG}}. It does not align to vertical center. Why? How to do it?

Actual

Arrow arrow

MWE

\documentclass[10pt, oneside, a4paper]{report}
\usepackage[left=2cm,right=1.5cm,
    top=2cm,bottom=2cm,bindingoffset=0cm]{geometry}
\usepackage{indentfirst} 
\usepackage{titlesec}
\usepackage{tabu}
\usepackage[svgnames]{xcolor}
\definecolor{DarkBlue}{HTML}{0070C0} 
\definecolor{Blue}{HTML}{1C8CCC} 
\usepackage{multirow}
\usepackage{polyglossia}
\setmainfont[Ligatures=TeX]{Arial}


%--------------------------------------------
\begin{document}

\taburulecolor{DarkBlue}
\tabulinesep = 2mm
\begin{tabu} to 170 mm {
        |X[2,m]
        |X[1.5,m]
        |X[0.6, C,m]
        |X[2,m]
        |X[0.6, C,m]|
        }


\rowfont{\centering\bfseries\color{Blue}}

\hline

Status
    & Visual indication
    & Symbol
    & Audible signal
    & Priority\\ \hline

Alarm active, not acknowledge 
    & Red, blinking 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Accompanied by an audible signal, as 3 short audible signals repeated every 7 s
    & High 
    \\ \hline

Alarm active, silenced 
    & Red, blinking 
    & picture % \includegraphics[width=0.5cm]{symbol.png} 
    & Silent 
    & \multirow{8}{*}{\includegraphics[height=8cm]{arrow.PNG}} 
    \\    \tabucline{1-4}

Warnings active, not acknowledged
    & Yellowish orange, blinking 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Accompanied by an audible signal, as 2 short audible signals, to be repeated at least once per 5 min or be replaced by an alarm 
    & \\ \tabucline{1-4}

Warnings active, silenced 
    & Yellowish orange, blinking 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent 
    &   \\ \tabucline{1-4}

Rectified --- unacknowledged alarm
    & Visual indication 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent 
    & \\ \tabucline{1-4}

Rectified --- unacknowledged warning
    & Visual indication 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent 
    & \\ \tabucline{1-4}

Alarm active, acknowledged 
    & Visual indication 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Suppression of audible signal (silent)
    & \\ \tabucline{1-4}

Warnings active, acknowledged
    & Visual indication 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent 
    &  \\ \hline

Caution active 
    & Yellow 
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent 
    & Low \\ \hline

Normal state 
    & Empty field 
    & None
    & Silent 
    &  \\ \hline

\end{tabu}
\end{document}
1

enter image description here

  • added package [export]{adjustbox} for determine image baseline in its vertical center
  • corrected number of lines, which are spanned by multirow, to 13 (you need to count all lines in spanned rows)
  • use option = for \multirow, which preserve column formatting in its cell
  • added missing graphicx package (option demo is only for test purposes, since i haven't your image)

\documentclass[10pt, oneside, a4paper]{report}
\usepackage[left=2cm,right=1.5cm,
    top=2cm,bottom=2cm,bindingoffset=0cm]{geometry}
%\usepackage{indentfirst}
%\usepackage{titlesec}
\usepackage{tabu}
\usepackage[svgnames]{xcolor}
\definecolor{DarkBlue}{HTML}{0070C0}
\definecolor{Blue}{HTML}{1C8CCC}
\usepackage{multirow}
%\usepackage{polyglossia}
%\setmainfont[Ligatures=TeX]{Arial}
\usepackage[demo]{graphicx}
\usepackage[export]{adjustbox}


%--------------------------------------------
\begin{document}

\taburulecolor{DarkBlue}
\tabulinesep = 2mm
\begin{tabu} to 170 mm {
        |X[2,m]
        |X[1.5,m]
        |X[0.6, C,m]
        |X[2,m]
        |X[0.6, C,m]|
        }
\rowfont{\centering\bfseries\color{Blue}}
    \hline
Status
    & Visual indication
    & Symbol
    & Audible signal
    & Priority\\ \hline

Alarm active, not acknowledge
    & Red, blinking
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Accompanied by an audible signal, as 3 short audible signals repeated every 7 s
    & High
    \\ \hline

Alarm active, silenced
    & Red, blinking
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent
    & \multirow{13}{=}{\includegraphics[height=8cm,             % <--- span 13 lines of text
                                       width=\linewidth,        % <---
                                       valign=m]{arrow.PNG}}    % <---
    \\    \tabucline{1-4}

Warnings active, not acknowledged
    & Yellowish orange, blinking
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Accompanied by an audible signal, as 2 short audible signals, to be repeated at least once per 5 min or be replaced by an alarm
    & \\ \tabucline{1-4}

Warnings active, silenced
    & Yellowish orange, blinking
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent
    &   \\ \tabucline{1-4}

Rectified --- unacknowledged alarm
    & Visual indication
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent
    & \\ \tabucline{1-4}

Rectified --- unacknowledged warning
    & Visual indication
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent
    & \\ \tabucline{1-4}

Alarm active, acknowledged
    & Visual indication
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Suppression of audible signal (silent)
    & \\ \tabucline{1-4}

Warnings active, acknowledged
    & Visual indication
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent
    &  \\ \hline

Caution active
    & Yellow
    & picture % \includegraphics[width=0.5cm]{symbol.png}
    & Silent
    & Low \\ \hline

Normal state
    & Empty field
    & None
    & Silent
    &  \\ \hline

\end{tabu}
\end{document}
  • thank you for the response. We had to make following changes to get your solution works: 1. to move \usepackage[demo]{graphicx} before all packages (see tex.stackexchange.com/a/52886/123948). I know it is just for debugging, but directly copied MWE does not work for us and mabe somebody else); 2. in the \multirow command = is changed to *: \multirow{13}{*}{\includegraphics[height=8cm,width=\linewidth,valign=m]{arrow.PNG}} because with = an errors occur: missing number, treated as zero and illegal unit of measure (pt inserted); – and1er Aug 21 '17 at 10:33
  • We also didn't found = parameter for \multirow in docs texdoc.net/texmf-dist/doc/latex/multirow/multirow.pdf – and1er Aug 21 '17 at 10:54
  • @AndreiLosenkov, this parameter was introduced by last version (about ear old) of multirow package. please, update it. given link gives to old information. rather see ctan.ijs.si/tex-archive/macros/latex/contrib/multirow/… – Zarko Aug 21 '17 at 11:20
  • oh, okay. But it works with * also for us. Thank you for the support! – and1er Aug 21 '17 at 12:36
  • @AndreiLosenkov, are you sure? without use ˙{=}˙the \linewidth (which I use to determine image width) is not well defined. in your particular case your image is (luckily) narrowed then original column width. – Zarko Aug 21 '17 at 13:17

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.