TransWikia.com

Wrapping text on multiple lines with titleformat

TeX - LaTeX Asked by egarbugli on December 7, 2020

I’m trying to reproduce this chapter header:

k

Currently it looks like this:

enter image description here

I’m using this code to generate the titles:

documentclass[12pt]{book}
usepackage{fullpage}
usepackage{titlesec}
usepackage{totcount}

% Chapter headers

regtotcounter{chapter}
titleformat{chapter}[hang]{rmfamilybfseriesfontsize{62pt}{62}selectfont}{hugettfamily{thechapter  /  26}}{1em}{}

begin{document}

chapter{Finding the Leaks in Your Funnel}
{leftskip=0ptrelax
 rightskip=0ptrelax
 You've found PMF. Reduce friction before attempting to scale user acquisition. Use the techniques below to textbf{find (and address) the leaks in your funnel}. newline par}
{leftskip=3ptrelax
 rightskip=60ptrelax
{fontsize{15}{20}selectfont
noindent
“The much bigger share of the total addressable marketindex{Total Addressable Market} comes from getting people to change what they are doing today, overcoming natural human and organizational inertia.” newline par} 
noindent {fontsize{9}{12}selectfont texttt{Bill Auletindex{Bill Aulet}newline
Disciplined Entrepreneurship Authornewlinenewline}
 par}} 
normalfont noindent
You've found PMF. Your business is growing.newlinenewline
That’s amazing—but unless you invested significant time in optimizing messaging and workflows before PMF (which you shouldn’t have), only customers with a degree of imagination are going to adopt your product.newlinenewline

end{document}

2 questions:

  1. How could I get left-hand numbers to fit a narrower column and split into 3 lines?
  2. How can I prevent the title from going off-page?

One Answer

Try this.

documentclass[12pt]{book}
usepackage{amsmath}
usepackage{fullpage}
usepackage{titlesec}
usepackage{totcount}

% Chapter header

regtotcounter{chapter}
titleformat{chapter}[hang]
  {raggedrightsffamilybfseriesfontsize{62}{62}selectfont}
  {hugettfamilymdseries
   % magic number 20pt
   raisebox{20pt}{smash{parbox[t]{2em}{thechapter/26}}}}
  {0pt}{}
titlespacing*{chapter}{0pt}{50pt}{40pt}[40pt]

begin{document}

chapter{Finding the Leaks in Your Funnel}

sffamily
setlength{parindent}{0pt}

You've found PMF. Reduce friction before attempting to scale user acquisition. Use the techniques below to textbf{find (and address) the leaks in your funnel}.bigskip

{leftskip=3ptrelax
 rightskip=60ptrelax
 fontsize{15}{20}selectfont
“The much bigger share of the total addressable marketindex{Total Addressable Market} comes from getting people to change what they are doing today, overcoming natural human and organizational inertia.” par} bigskip

{fontsize{9}{12}selectfont texttt{Bill Auletindex{Bill Aulet}newline
Disciplined Entrepreneurship Author}par}bigskip


You've found PMF. Your business is growing.parbigskip
That’s amazing—but unless you invested significant time in optimizing messaging and workflows before PMF (which you shouldn’t have), only customers with a degree of imagination are going to adopt your product.newlinenewline
end{document}

enter image description here

Correct answer by muzimuzhi Z on December 7, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP