# Vertical centering of a title within a box which ignores possible accents

I am currently adapting the \part command to customize the table of contents as follows [code directly extracted from the book.cls class]:

\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax%
\refstepcounter{part}%
\setlength\fboxsep{2pt}%
\noindent\protect\colorbox{ocre!20}{\strut\protect\parbox[c][][c]{\ecart}%
{\color{ocre!70}\bfseries\protect\centering\thepart}}\hskip6pt\colorbox{ocre!40}%
{\strut\protect\parbox[c][][c]{\linewidth-4\fboxsep-\ecart-6pt}{\color{white}%
\protect\centering\MakeUppercase{#1}}}}{#1}}%
\else%
...


I am not providing the rest of the code which is quite long but the result is shown below:

It is quite clear that the accented letter è affects the vertical alignment of the title within its box. Is there a way to avoid that? I would be happy with a vertical alignment that ignores accented letters. Otherwise, the \vphantom command is a possibility.

-

Hard to test without a working example but normally the \strut would be enough to cover the accented letters however you have used \parbox[c] so the text is vertically centred so moves down if accents are added. If you used [b] or [t] (which are the same for a one line box) then the text would align on the baseline so not move when there is an accent.
Alternatively you can hide the vertical size of the content by adding \smash
\leavevmode\protect\smash{\MakeUppercase{#1}}}

yes, but I want to keep the vertically centred title so the [c] option is fine. I just would like the accent to be ignored by the vertical alignment. –  pluton Mar 30 '13 at 23:43
ok, thanks. I tried but it yields quite unexpected results. It looks to me that the \vphantom{Ép} command associated with a \parbox[b][][b]{...} command aligning at the bottom is a good compromise. I wanted to avoid the \vphantom but it probably cannot be avoided. –  pluton Mar 31 '13 at 0:13
You are using the form of \parbox where you specify the height but not specifying the height, is that intended? –  David Carlisle Mar 31 '13 at 0:21