1

Set up

The code for my chosen "new chapter" page style is given below

\documentclass[12pt,oneside]{book}
%********************************CHAPTER SETTINGS*********************
\usepackage[T1]{fontenc}
\usepackage{titlesec, blindtext, color} %remove blindtext after 
\definecolor{gray75}{gray}{0.75} %1=white, 0=black
\newcommand{\hsp}{\hspace{20pt}} %spacing between line and text
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries} %spacing across entire page

%----------------------------------BEGIN------------------------------
\begin{document}

\chapter{Less is More}
\blindtext

\chapter*{more is less}
\blindtext

%----------------------------------END------------------------------
\end{document}

Question

What can I add to control the position of the heading on the page (i.e. amount of white space from the top of the page to "less is more"). And how do I control the size of the text and number?

1

I used the format part, ie the first {\Huge\bfseries} as a hook for the pre-code and inserted some \vspace*. Please tweak it as you wish and consider whether the solution is acceptable

\documentclass[12pt,oneside]{book}
%********************************CHAPTER SETTINGS*********************
\usepackage[T1]{fontenc}
\usepackage{titlesec, blindtext, color} %remove blindtext after 
\definecolor{gray75}{gray}{0.75} %1=white, 0=black
\newcommand{\hsp}{\hspace{20pt}} %spacing between line and text
\titleformat{\chapter}[hang]{\vspace*{4em}\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{} %spacing across entire page

%----------------------------------BEGIN------------------------------
\begin{document}

\chapter{Less is More}
\blindtext

\chapter*{more is less}
\blindtext

%----------------------------------END------------------------------
\end{document}

enter image description here

  • I see how {\vspace*{4em} is controlling the position and I thankyou. what units is "em" I've seen it around a lot lately with "custom code". How would you adjust the size of text and number in the same way? – UniStuffz Jun 21 '17 at 16:19
  • @UniStuffz em is a relative unit of measure and depends upon the selected font size. Usually it's similar to the font size itself. For the other questions, I thin you either should read the documentation of the titlesec package, or post a different question, in order to keep the standard of 1 post per question. – Moriambar Jun 21 '17 at 16:46
0

Here is an example with \titlespacing*(the starred version deletes the first paragraph indent) and a scaled chapter number. Note that \Huge\bfseries in the first argument is valid for the whole title and doesn't have to be repeated in the last argument:

\documentclass[12pt,oneside]{book}
%********************************CHAPTER SETTINGS*********************
\usepackage[showframe]{geometry}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{titlesec, blindtext, color} %remove blindtext after
\definecolor{gray75}{gray}{0.75} %1=white, 0=black
\newcommand{\hsp}{\hspace{20pt}} %spacing between line and text
\titleformat{\chapter}[hang]{\Huge\bfseries}{\scalebox{2}{\thechapter}\hsp\textcolor{gray75}{|}\hsp}{3pt}{} %spacing across entire page
\titlespacing*{\chapter}{0pt}{50pt}{80pt}

%----------------------------------BEGIN------------------------------
\begin{document}

\chapter{Less is More}
\blindtext

\chapter*{more is less}
\blindtext

%----------------------------------END------------------------------
\end{document} 

enter image description here

  • As far as I can play around with, the code you put adjusts the number but how do you adjust the text? – UniStuffz Jun 21 '17 at 18:48
  • and which part of the code is removing the indentation. – UniStuffz Jun 21 '17 at 18:52
  • Removing the indentation is obtained with \titlespacing*. Using \titlespacing Maintains it. By text adjusting, what do you mean? Position or size? – Bernard Jun 21 '17 at 19:00
  • as in increase the size of the text "less is more" to match the size of the number which is increased by \scalebox – UniStuffz Jun 21 '17 at 19:36

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.