[texhax] A table with both images and text (format problem)
Dan Bolser
dmb at mrc-dunn.cam.ac.uk
Sun Jun 12 02:29:29 CEST 2005
On Sat, 11 Jun 2005, Lars Madsen wrote:
>
>just use p{...} on both columns (your pictures all have the same width).
>
>If the pictures in your 'real' document does not have the same width use
>the array package and use >{\centering\arraybackslash}p{5cm} for the last
>column
I tried the above, but it looks just like as with '|c|' for the 'image
column' of the table.
All my images are (or will be scaled to) the same size.
Did you test the code below? I would like to know if you see the white
space or not on your system.
Also I find that using \parbox{} does change the output (i.e. it is not
the same as using the p{...} column type).
I found I can get reasonable results by puting the contents of *every*
cell in a \parbox{...}, but that isn't a clean solution for two reasons
1) If you want to adjust the column width you have to adjut the parbox
width for every cell in that column,
2) the parbox removes the cell border, so all my text is right up against
the lines of the table.
Any help with either two problems of this workaround (or a better
solution) would be really great!
Thanks very much for any further info regarding the example below,
Dan.
Oh, here is my output if versions might be an issue...
latex test
This is TeX, Version 3.14159 (Web2C 7.4.5)
(./test.tex
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, german,
ngerman, n
ohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/report.cls
Document Class: report 2001/04/21 v1.4e Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty)
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/share/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf/tex/latex/graphics/dvips.def))) (./test.aux)
Underfull \hbox (badness 6792) in paragraph at lines 98--99
[]\OT1/cmr/m/n/10 more more more
Underfull \hbox (badness 6792) in paragraph at lines 98--99
\OT1/cmr/m/n/10 more more more
Underfull \hbox (badness 6792) in paragraph at lines 104--105
[]\OT1/cmr/m/n/10 more more more
Underfull \hbox (badness 6792) in paragraph at lines 104--105
\OT1/cmr/m/n/10 more more more
[1] (./test.aux)
*File List*
report.cls 2001/04/21 v1.4e Standard LaTeX document class
size10.clo 2001/04/21 v1.4e Standard LaTeX file (size option)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
graphics.sty 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2001/08/31 v1.1 graphics configuration of teTeX/TeXLive
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
***********
)
>
>\documentclass{report}
>
>\usepackage{graphicx}
>\begin{document}
> \begin{tabular}{|p{3cm}|p{5cm}|}
> \hline
> more more more more more more text
> &
>% \includegraphics[height=2cm,width=5cm]{picture.1.eps}
> \rule{5cm}{2cm}
> \\
> \hline
> more more more more more more text
> &
>% \includegraphics[height=2cm,width=5cm]{picture.2.eps}
> \rule{5cm}{2cm}
> \\
> \hline
>
> \end{tabular}
>\end{document}
>
>Note:
>
>p{3cm} is like \parbox[c]{3cm}{...}
>
>
>
>
>
>
>
>
>
More information about the texhax
mailing list