1

I have a very specific table that just needs to be this way (even though one might argue that it is not a very TeX kind of way). The cell in the upper left is supposed to contain a logo and it fits nicely: table with a sample logo of the correct size My question is how to achieve this without using pstricks' \rput command? If I just include the image, then TeX will reserve some space for it, which I don't want. The padding is fine just the way it is and \rput does not seem to appear to pass on any information about a bounding box.

\documentclass{article}
\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{booktabs}
\begin{document}
\begin{table}\scriptsize
\begin{tabular}{@{}c@{}*{6}{l}@{}}
\specialrule{1pt}{0pt}{3pt}% toprule
% Row 1 ---
    \hspace*{2cm}
&   {Category}
&   \multicolumn{2}{l}{Score}
&   {Result}
&   {Details}
&   More detailed \\
% Row 2 ---
    &&&&&&details
\\[-1.5ex]
% Row 3 ---
%   \includegraphics[height=1.4cm]{scratch.eps}
    \rput(0,0){\includegraphics[height=1.4cm]{scratch.eps}}%
    & \small Some Category                  \\[1ex]
    & \small Subcategory
    & \multicolumn{2}{r}{of 30}             \\
\specialrule{.7pt}{4pt}{3pt}% midrule ---
\end{tabular}
\end{table}
\end{document}
fborchers
  • 465
  • 2
  • 13

1 Answers1

1

This can be achieved in a number of ways without the need for pstricks. Use \raisebox{<length>}[0pt][0pt]{<stuff>} to raise <stuff> up by <length> (negative will lower it). Adding the [0pt][0pt] options removes the height/depth of <stuff> so it doesn't affect the row height.

enter image description here

\documentclass{article}

\usepackage{graphicx} \usepackage{booktabs}

\begin{document}

\begin{table} % Option 1 \scriptsize \begin{tabular}{ @{} c @{} {6}{l} @{} } \specialrule{1pt}{0pt}{3pt}% toprule % Row 1 --- \hspace{2cm} & Category & \multicolumn{2}{l}{Score} & Result & Details & More detailed \ % Row 2 --- &&&&&&details \[-1.5ex] % Row 3 --- \raisebox{-2.35\normalbaselineskip}[0pt][0pt]{\includegraphics[height=1.4cm]{example-image}} & \small Some Category \[1ex] & \small Subcategory & \multicolumn{2}{r}{of 30} \ \specialrule{.7pt}{4pt}{3pt}% midrule --- \end{tabular}

% Option 2 \scriptsize \renewcommand{\arraystretch}{1.4}% \begin{tabular}{ @{} c @{} *{5}{l} @{} } \specialrule{1pt}{0pt}{3pt}% toprule % Row 1 --- & Category & Score & Result & Details & \smash{\renewcommand{\arraystretch}{1}\begin{tabular}[t]{@{} l @{}} More detailed \ details \end{tabular}} \ % Row 2 --- ~\raisebox{-2.3\normalbaselineskip}[0pt][0pt]{\includegraphics[height=1.4cm]{example-image}}~ & \small Some Category \ & \small Subcategory & \multicolumn{1}{r}{of 30} \ \specialrule{.7pt}{4pt}{3pt}% midrule --- \end{tabular} \end{table}

\end{document}

Of course, adjust the amount the element is raised/lowered.

Werner
  • 603,163