1

I’m creating a presentation in ConTeXt. I want to set-up a header so that I don’t have to do something like this on every slide:

\setuppapersize[S3]

\starttext
  \starttitle[title=Title]
    \vfill
    I want this text to be vertically centered without having to surround
    it with \type{\vfill}s everytime.
    \vfill
  \stoptitle
\stoptext

rendered PDF

Is it possible? I have tried tweaking different options in \setuphead, but I haven’t even got close, neither could I find any existing example.

4
  • 2
    You can use makeups. They are vertically centered by default. – sztruks Jan 3 at 16:24
  • I know about makeups, but is there a way to bind them to the title? Ideally, I just want to do \starttitle <content> \stoptitle and have the content centred. – Juraj Fiala Jan 3 at 16:35
  • 2
    Sure. You can have a look at tex.stackexchange.com/questions/458229/… – sztruks Jan 3 at 16:38
  • Your title content only spans one slide each, right? In such a case, a solution is easy. – Jairo A. del Rio Jan 3 at 16:43
1

With makeup, it is fairly easy to have your title vertically centered. You will find some hints there: vertically center all slides in ConTeXt with minimal setups

The trouble is I don't understand if your text is somehow structurally connected to your section title. This solution will give you vertically aligned title and short text thereafter. It won't be the best idea if you have long section. For my presentations, I wrap the section titles alone on one slide with setuphead and my custom \startDiapo\stopDiapo for the texts.

\setuppapersize[S3]

\definemakeup [Title][style={\ssb}]
\defineframedtext
   [Diapo]
   [frame=no,
    width=\textwidth ,
    before={\page\leavevmode\vfill},
    after={\vfill}]

% with this setup, you'll get the title
% alone on the slide
%\setuphead [title]
%   [before={\startTitlemakeup{}},
%    after={\stopTitlemakeup{}}]


\starttext

\startDiapo
  \starttitle[title=Title]
    I want this text to be vertically centered without having to surround
    it with \type{\vfill}s everytime.
  \stoptitle
\stopDiapo
\stoptext
1
  • I think it’s okay for the structure to be one title per slide. Your linked answer actually went through the exact solution I tried and had a beautiful visual explanation of where I made my mistake (I wanted insidesection, not beforesection). Thank you very much! – Juraj Fiala Jan 3 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.