TransWikia.com

Aligning text at top in tabular (tikzposter block)

TeX - LaTeX Asked by AlexLee on August 12, 2021

I have a table with text and a picture in a tikzposter block.

documentclass[20pt, a0paper, landscape]{tikzposter}
usepackage[utf8]{inputenc}
usepackage{graphicx}

usetheme{Simple}

begin{document}
begin{columns}

begin{columns}
column{0.5}
block{Geographical Area}{
begin{tabular}[t]{p{0.5linewidth} p{0.5linewidth}}
    hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! 
    &
    includegraphics[width=linewidth,]{PIC.pdf}
end{tabular}
}

end{columns}
end{document}

In a zoomed picture it yields a table like this:
enter image description here

I’m trying to align the text at the top in the left cell so it looks like this:
enter image description here

Thanks!

One Answer

You can use the valign=t option (needs the adjustbox package with the export option) in order to top align text and image in a table. In the following example, I also adjusted the widths of the two table columns in order to get rid of the overfull box warning.

enter image description here

documentclass[20pt, a0paper, landscape]{tikzposter}
usepackage{graphicx}
usepackage[export]{adjustbox}

usetheme{Simple}

begin{document}

begin{columns}
column{0.5}
block{Geographical Area}{
begin{tabular}[t]{*{2}{p{dimexpr 0.5linewidth-2tabcolsep}}}
    hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! hello world! 
    &
    includegraphics[width=linewidth,valign=t]{example-image}
end{tabular}
}

end{columns}
end{document}

Correct answer by leandriis on August 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP