Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is my follow up question. My previous question is here: How can I do the following in latex

Problem:

If I add the image in my table, I get the following output as shown in the image below. Why is the Co-Supervisor going below?

Table problem I am using this code:

\begin{tabular}{|l|c|r|}
\hline
\bf Author: & \hspace{5pt} & \bf Research Supervisor:\\
\hline
Mr. X &  \hspace{5pt} & Prof. Dr. Z\\
\hline
\includegraphics[width=0.40\textwidth,height=10mm]{Figures/images} &  \hspace{5pt} & \bf Co-Supervisor:\\
\hline
&  \hspace{5pt} & Prof. Dr. Y\\
\hline
\end{tabular}

What I want is shown below: enter image description here

PS: Please ignore the table borders, they are for demo only, I won't be using them in my final code.

The final product: that I desire is:

enter image description here

share|improve this question
    
Please post a MWE always, not just fragments –  Christian Hupfer Jul 26 at 11:16

2 Answers 2

up vote 5 down vote accepted

The image can be aligned with "Prof. Dr. Y" by using a nested tabular with optional option b (bottom):

\documentclass{article}
\usepackage{array}
\usepackage[demo]{graphicx}
\begin{document}

\begin{tabular}{|l|!{\hspace{2\tabcolsep}}|r|}
\hline
\bfseries Author: & \bfseries Research Supervisor:\\
\hline
Mr.\ X & Prof.\ Dr.\ Z\\
\hline
\includegraphics[width=0.40\textwidth,height=10mm]{Figures/images} &
\begin{tabular}[b]{@{}r@{}}
  \bfseries Co-Supervisor:\\
  Prof.\ Dr.\ Y
\end{tabular}\\
\hline
\end{tabular}

\bigskip

\begin{tabular}{l!{\hspace{2\tabcolsep}}r}
\bfseries Author: & \bfseries Research Supervisor:\\
Mr.\ X & Prof.\ Dr.\ Z\\
\includegraphics[width=0.40\textwidth,height=10mm]{Figures/images} &
\begin{tabular}[b]{@{}r@{}}
  \bfseries Co-Supervisor:\\
  Prof.\ Dr.\ Y
\end{tabular}
\end{tabular}

\end{document}

Result

Remarks:

  • \bf is the name in plain TeX and LaTeX 2.09. LaTeX 2ε uses \bfseries.

  • Prof. Dr. Z: TeX does not know, that the dots do not end a sentence, with \nonfrenchspacing, the space is therefore larger. This can be avoided by \Prof.\@ Dr.\@ Z or Prof.\ Dr.\ Z or Prof.~Dr.~Z. BTW, if the letter before the dot is an uppercase letter, TeX sets the normal inter word space, because it assumes, the the dot is an abbreviation dot.

  • \hspace{5pt} as cell contents has no effect. TeX surrounds the cell with \ignorespaces at the beginning and \unskip at the end. The latter removes the previous \hspace. The space that can be seen is \tabcolsep at both sides. Therefore the example has added the space via !{\hspace{2\tabcolsep}} (needs package array) and has dropped the middle column.

Two tables for the left and right side

\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}

\begin{tabular}[t]{l}
  \bfseries Author:\\
  Mr.\ X\\
  \includegraphics[width=0.40\textwidth,height=10mm]{Figures/images}\\
\end{tabular}\qquad
\begin{tabular}[t]{r}
  \bfseries Research Supervisor:\\
  Prof.\ Dr.\ Z\\
  \bfseries Co-Supervisor:\\
  Prof.\ Dr.\ Y\\
\end{tabular}

\end{document}

Result

share|improve this answer
    
Thanks, one question Why is the Co-Supervisor not sticking to the bottom of Prof. Dr. Z. I don't want that space. For eg: the image is sticking to MR. X perfectly. –  ρss Jul 26 at 11:20
    
+1 for edit. Perfect! –  ρss Jul 26 at 11:30

A solution with \multirow approach:

\documentclass{report}
\usepackage{multirow}

\usepackage[demo]{graphicx}%

\begin{document}

\bfseries
\begin{tabular}{|l|c|r|}
\textbf{Author}: & \hspace{5pt} & Research Supervisor:\tabularnewline
Mr. X & \hspace{5pt}  & Prof. Dr. Z\tabularnewline
\multirow{2}{*}{%
\includegraphics[width=0.40\textwidth,height=10mm]{Figures/images}}%
 & \hspace{5pt} & Co-Supervisor:\\
& \hspace{5pt} & Prof. Dr. Y\tabularnewline
\end{tabular}
\normalfont


\end{document}

enter image description here

share|improve this answer
    
Thanks but I am using \documentclass{report}. :( –  ρss Jul 26 at 11:28
1  
@ρss — It doesn't matter. –  Manuel Jul 26 at 11:30
1  
@pss: How should Heiko or I know about report? There is no indication ;-) –  Christian Hupfer Jul 26 at 11:31
    
@Manuel Yes you are right and I am left. I really need to work on my latex skills. –  ρss Jul 26 at 11:31
1  
@ρss By the way, take a note on Christian comment: a full compilable example is always better than just a snippet. –  Manuel Jul 26 at 11:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.