[Tex/LaTex] Two-line spanning number in chapter title

chapterssectioningtitlesec

I try to have the chapter's number in my document twice as big as the title on the left and the two-line chapter title on the right. The number should span two lines, so the two lines of the title are exactly the same size the number is and they are at the same height.

You can see what I achieved so far here:

enter image description here

The problem now is that the title starts at the bottom of the number, but it should start at the top.

I did this using titlesec package:

\titleformat{\chapter}[hang]{\Huge\bfseries\sffamily}{{\fontsize{75}{80}\selectfont\color{chpgrey}{\thechapter~|~}}}{15pt}{}

My document class is scrreprt.

Does anyone have an idea how I can achieve what I want?

Best Answer

One possibility is to use the explicit option for titlesec and two \parboxes (one for the number and the vertical rule, the other one for the title) vertically aligned at the bottom:

\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage{linegoal}
\usepackage[explicit]{titlesec}

\colorlet{chpgrey}{gray!40}

\newcommand\chapnumfont{%
  \fontsize{75}{80}\selectfont\color{chpgrey}}
\titleformat{\chapter}[hang]
  {\bfseries\sffamily}
  {}{0pt}
  {{\chapnumfont\parbox[b]{3cm}{%
      \thechapter}\vrule width3pt depth0.2ex}\hspace{15pt}%
    \parbox[b]{\linegoal}{\Huge\raggedright#1}}

\begin{document}

\chapter{Test Chapter Title}
\chapter{Test Chapter Title Spanning Two Lines}

\end{document}

An image for a one line title:

enter image description here

An image for a title spanning two lines:

enter image description here

Feel free to adjust the widths of the boxes according to your needs.