TeX - LaTeX Asked by Eenoku on December 25, 2020
I started using rather large Beamer-based template. Everything is good except title vertical align – for default font size it looks ok:
But when I change the fontsize to, e.g. 9pt
like this:
documentclass[lualatex,hyperref={pdfencoding=auto},9pt]{beamer}
The gets shifted upwards
As far as I found out, the vertical alignment is set up with this code:
setbeamertemplate{frametitle}
{
nointerlineskip
begin{beamercolorbox}[sep=0.3cm,ht=1.8em,wd=paperwidth]{frametitle}
vbox{}vskip-2ex
strutinsertframetitlestrut
hfill
raisebox{-0.25height}{includegraphics[height=1.35em]{proj@TightSignFileName}}
vskip-0.8ex%
end{beamercolorbox}
}
Is there any way, how to do the vertical alignment “dynamically”, so that the whole title would be positioned in the middle, no matter the font size?
I’ve tried valign
from adjustbox
package as mentioned in How to vertically center text with an image in the same row of a table , but it doesn’t seem to work really well in this case:
setbeamertemplate{frametitle}
{
nointerlineskip
begin{beamercolorbox}[sep=0.3cm,ht=1.8em,wd=paperwidth]{frametitle}
vbox{}vskip-2ex
strutinsertframetitlestrut
hfill
includegraphics[valign=m,height=1.35em]{vsb@TightSignFileName}
vskip-0.8ex%
end{beamercolorbox}
}
Due to the large number of necessary files and images I uploaded complete MWE onto this link:
You could bracket your code in:
vspace*{fill}
% Your stuff here
vspace*{fill}
This adds vertical space (vspace
) unconditionally (*
), the space to be added is "as long as will fit" (fill
). Both fill
fight for space, each gets half. If you want uneven space top/bottom, use stretch{n}
:
vspace*{stretch{2}}
% Your stuff here
vspace*{stretch{3}}
This will give 2/5 of the space above. Can use the same idea horizontally, BTW.
Answered by vonbrand on December 25, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP