TransWikia.com

Baposter Boxheader Vertical Alignment

TeX - LaTeX Asked by Superfrankie on June 7, 2021

Texts of boxheaders are aligned differently if there are ascenders/descenders. Examples are shown below. The alignment of the title for box on the right seems weird to me. How can I adjust this?

enter image description here

Baposter is a document class for creating posters. It is not available on CTAN, but can be downloaded from http://www.brian-amberg.de/uni/poster/.

One Answer

The default header boxes have 0pt depth. This is the default for any node (see section 5.1 of the TikZ manual). To align letters on the baseline, you need to add text depth = 0.25ex to the macro that creates the headerbox. It is the same issue as here: How to “fix baselines” in tikz nodes?

enter image description here

documentclass[landscape,a4paper]{baposter}

makeatletter
renewcommand{baposter@box@headerdrawtext@rectangle}[1]{
  path (baposter@box@name nw) + (0em,-0.5baposter@box@@boxheaderheight)
        node[anchor=west,inner sep=0.4em,text depth=0.25ex] {#1};% <-- added text depth
}
makeatother

begin{document}

begin{poster}{
  grid=false,
  columns=2,
  colspacing=4.2mm,
  headerheight=0.10textheight,
  background=none,
  eyecatcher=false,
  %posterbox options
  headerborder=closed,
  borderColor=red,
  headershape=rectangle,
  headershade=plain,
  headerColorOne=blue,
  textborder=rectangle,
  boxshade=plain,
  boxColorOne=white,
  headerFontColor=white,
  headerfont=color{white}largebfseriessffamily,
  textfont=normalsizesffamily,
  linewidth=1pt
}
{}
{Title}
{textsc{Author}}
{}

begin{posterbox}[name=box1,column=0,row=0,span=1]{M}
Hello
end{posterbox}

begin{posterbox}[name=box2,column=1,row=0,span=1]{Mp}
Hello
end{posterbox}

end{poster}

end{document}

Correct answer by Ross on June 7, 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