TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to adjust vertical spacing after the title in a thesis class by measuring the title length (actually, height). To achieve this, I put the title in a box and compute the total height of the box.

First, commands to define the title and its styling:


Next, the title box:


Finally, computation the total box height:


This works fine in a document (.tex) file itself. I get, say, that \UL@titleboxtotht is 48.48pt. With above commands defined in the class (.cls) file, I cannot get a hold of the dimension I'm looking for; I only get that \UL@titleboxtotht is 2.73pt. It seems the actual content of the box is never evaluated. Any idea?

share|improve this question

migrated from stackoverflow.com Jan 13 '13 at 15:40

This question came from our site for professional and enthusiast programmers.

There is a problem with \setlength statement; improper bracing. Does the class include the calc package? Also, you can only calculate the title dimensions once it has been set. Would you be able to provide a complete minimal example that shows your usage within the special "thesis" class? Also provide a link to the .cls file. – Werner Jan 12 '13 at 21:31
Fixed the bracing; this was not the problem, just bad copy-pasting. Sorry for the noise. No calc package. "... once it has been set": that was my impression, but when/how is it set? When \titlepage is issued? – Vincent Goulet Jan 12 '13 at 23:32
Where is the .cls located? Please provide a link. Also include a complete minimal working example (MWE) of your problem case. It may be related to the code, or the sequence of commands executed. – Werner Jan 13 '13 at 4:41
Ok, I put an edited and minimally commented version of the class file, a MWE and a required image file in a zip archive. FWIW, the current official version of the class is on CTAN. – Vincent Goulet Jan 13 '13 at 14:52
up vote 4 down vote accepted

You have to defer the measurement to when the title is known, which is when you are expanding \pagetitre; so I'd say

%% Here we play with the title (and subtitle)

  %% Repeat above commands for subtitle, if there is one

%% Adjust spacing between title and "doc id" depending on height of
%% the title and subtitle block

%% Define analogue of the \titlepage command   
    \ifthenelse{\UL@typenum > 1}{\vspace*{0pt}\par}{%
    \vspace{\baselineskip} %%%% SOME SPACE BETWEEN TITLE AND SUBTITLE
    {\textcopyright} \UL@author, \UL@year\par
share|improve this answer
Ah ha! That's the trick! Works exactly as expected, thanks very much! – Vincent Goulet Jan 13 '13 at 18:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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