I am trying to typeset a title with titleformat as in the following example:


I like the overall result, but when the title wraps around it is not left-aligned. Is there any way to indent the second line accordingly? This is the code that generates the example:



\newfont{\chapterNumber}{eurb10 scaled 5000}

        \hspace{10pt}\vline}  }{10pt}%

%% Using this instead, the text is left-aligned but the
%% vertical line is not aligned with the body text
% \titleformat{\chapter}[block]%
%         {\relax}%
%         {\llap{\color{gray}\chapterNumber\thechapter%
%         \hspace{10pt}\vline\hspace{10pt}}}{0pt}%
%         {\raggedright\LARGE\textsc}

\chapter{Long long long long long long long long long long title}

There is an alternative definition that makes the title aligned by putting the \hspace inside the \llap, but this way the vertical line is shifted left while I'd like it to be aligned with the body text.

  • Welcome to TeX.sx! Apr 28, 2013 at 19:53
  • Using \newcommand{\chapterNumber}{\fontsize{50}{50}\usefont{U}{eur}{b}{n}} instead of \newfont is better.
    – egreg
    Apr 28, 2013 at 19:57
  • @egreg thanks, can you explain why it is better? Apr 28, 2013 at 20:09

1 Answer 1


Use a \parbox giving it a width of \textwidth minus 10 points.






\chapter{Long long long long long long long long long long title}


The lipsum package is just for producing text that shows how the \vline is aligned with the left margin.

Don't use \newfont, but the command I suggest for defining \chapterNumber.

enter image description here

The command \newfont is still in LaTeX for backward compatibility, because old document written with LaTeX 2.09 could have used it. With the introduction of the New Font Selection Scheme (NFSS), back in the early 90's, some new concepts in font management have been included in LaTeX and fonts defined with \newfont simply ignore them, so the result could be surprising.

The Euler font is available in "unspecified" encoding U, with family name eur; you want bold series b and normal shape n, so \usefont{U}{eur}{b}{n}; the size must be set independently: the first argument to \fontsize is the font size proper, the second is the baselineskip (which is almost irrelevant here, so I use the same as the size). No unit means unit "points". After \fontsize{x}{y} a \selectfont command is necessary, but it's provided automatically by \usefont.


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.