2

I want to make divisions in a table with \multirow and \multicolumn commands but I don't understand how can I use them. This is my code

\documentclass[letter,12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{array}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{multirow}

\usepackage[hmargin=2cm,top=4cm,headheight=65pt,footskip=65pt]{geometry}
\setlength{\parindent}{0.95cm}
\pagestyle{fancy}
\usepackage{graphicx}

\renewcommand{\headrulewidth}{0pt}
\fancyhead[CE,CO,LE,LO,RE,RO]{} %% clear out all headers
\fancyhead[C]{%
\begin{tabular}{|m{3.0cm}|m{8.0cm}|m{2.5cm}|m{3.0cm}|}
         \hline 
         \centering
        \includegraphics[scale=0.04]{escudounipamplona.png} 
        & 
        \centering  Propuesta trabajo de grado para optar por el título de Ingeniero en Mecatrónica
        & 
        Test
        & 
        Test   
         \\ 
         \hline 
         \end{tabular}          
}

\begin{document}
\chapter{Chapter title}
%% add this if you want the fancy style also on the first page of a chapter:
\thispagestyle{fancy}
\section{Section title}
\end{document}

This is my result:

enter image description here

And this is what I want to achieve:

enter image description here

I'm a little confused with this package and I'd appreciate any help. Thanks

EDIT: How can I vertically center my image?

1

1 Answer 1

2

I have used tabularx so that the table is as wide as text. also it is letterpaper not letter.

\documentclass[letterpaper,12pt]{book}     %% it is letterpaper
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{array}
\usepackage{tabularx}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{multirow}

\usepackage[hmargin=2cm,top=4cm,headheight=65pt,footskip=65pt]{geometry}
\setlength{\parindent}{0.95cm}
\pagestyle{fancy}
\usepackage{graphicx}

\renewcommand{\headrulewidth}{0pt}
\fancyhead{} %% clear out all headers
\fancyhead[C]{%
\begin{tabularx}{\textwidth}{|m{3.0cm}|m{8.0cm}|
                              >{\centering}X|>{\centering\arraybackslash}X|}
         \hline
        \multirow{2}{3cm}{\centering \includegraphics[scale=0.04]{example-image-a}}
        &
         \multirow{2}{8cm}{\centering Propuesta trabajo de grado para optar por el título de
               Ingeniero en Mecatrónica}
        &
        test
        &
        test
         \\\cline{3-4}
         &&
         test &
         test\\
         \hline
\end{tabularx}
}

\begin{document}
\chapter{Chapter title}
%% add this if you want the fancy style also on the first page of a chapter:
\thispagestyle{fancy}
\section{Section title}
\end{document}

enter image description here

You must log in to answer this question.

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