I have looked over this question: Package titlesec adds extra space on top of \chapter, despite commands to the contrary
And mine is in a certain sense a duplicate. However, I am wondering if there is any way to do this in a more simpler way? I go completely blank at this code in the solution.
\makeatletter
\def\ttl@mkchap@i#1#2#3#4#5#6#7{%
\ttl@assign\@tempskipa#3\relax\beforetitleunit
%\vspace*{\@tempskipa}% NEW
\global\@afterindenttrue
\ifcase#5 \global\@afterindentfalse\fi
\ttl@assign\@tempskipb#4\relax\aftertitleunit
\ttl@topmode{\@tempskipb}{%
\ttl@select{#6}{#1}{#2}{#7}}%
\ttl@finmarks % Outside the box!
\@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}}
\makeatother
I usually use packages to construct commands and so on, but this part of the code I don't get at all. Sorry, all I really need is an alternative as I usually prefer to understand what my code does.
My chapter heading style is the following:
And the code is:
\documentclass[11pt]{book}
\usepackage{titlesec, lipsum, xcolor}
\titleformat{\chapter}[display] % shape
{\bfseries \Huge}
{\hfill \textcolor{gray!50}{\thechapter}} % Label
{0pt} % Separation after chapter name.
{\vspace{70pt}} % Between Chapter no. and name
[\vspace{-1em}\rule{\textwidth}{0.3pt}\\]
\titlespacing*{\chapter}{0pt}{0pt}{0pt}
\begin{document}
\chapter{Hi}
\lipsum[1-8]
\end{document}
Basically, I want to eliminate all the space before and after if that's possible, preferable through simpler code than the one provided in solution.
I don't get what things like \def, \ttl, \global, \ifcase, \relax, \fi, \beforetitleunit, \makeatletter, \makeatother, or anything with @ in it stands for.
If there isn't a "simpler" solution, that's fine I guess... I can use things like tikz and other stuff pretty well if that helps. Or if there's a shape other than default that'll give me the same sort of result that would be great to.
