Make negative spacing between letters and make them darker on the overlapping parts

I made several changes. I made the color for each digit \color{gray!100!white!\intens where \intens is changed for each digit, from 50 to 75 and then (if needed) 100.

Also, I present the chapter, instead of \thechapter, as \edef\tmp{\thechapter}\expandafter\squeeze\tmp\relax, where \squeeze does a negative kern after each digit and a change of color.

\documentclass[12pt,twoside,draft]{scrbook}

\usepackage{geometry}
\geometry{
paperwidth=11.7in,
paperheight=8.27in,
top=1in,
bottom=1in,
outer=1.5in, 
inner=0.7in,
voffset=0in,
marginparwidth=0.5in,
marginparsep=0.2in,
footskip=0em,
headsep=0pt,
nofoot,
nohead  
}

\usepackage{mathtools}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{anyfontsize}
\usepackage{fontspec}
\newfontfamily\chapterfont[LetterSpace=-12]{Latin Modern Roman}
\usepackage{titlesec}
\usepackage[english]{babel}

\titleformat{\chapter}[display]
{\gdef\intens{50}\normalfont\bfseries\color{gray!100!white!\intens}\fontsize{\paperheight}{\paperheight}\selectfont}%
{\resizebox{!}{\paperheight+1in}{%
  \chapterfont\edef\tmp{\thechapter}\expandafter\squeeze\tmp\relax}}%
{-\paperheight}%
{\color{black}\raggedright\Huge}

\titlespacing{\chapter}{0in}{-1.5in}{40pt}
\def\squeeze#1#2\relax{#1\ifx\relax#2\relax\ \else%
  \xdef\intens{\the\numexpr\intens+25\relax}%
  \kern-180pt\color{gray!100!white!\intens}\squeeze#2\relax\fi}
\begin{document}

\setcounter{chapter}{20}
\chapter{Twenty One}

\lipsum[1]

\setcounter{chapter}{101}
\chapter{Century Plus Two}

\lipsum[1]

\end{document}

enter image description here

enter image description here


The negative kerning is quite easy to do with fontspec and XeLaTeX or LuaLaTeX. I've used the LetterSpace font feature for the font used for the number. Giving it a negative value decreases the inter-letter spacing. I've given it a value of -12 as an example, which doesn't actually overlap them but gives you an idea of what you can do. (I tried larger numbers but nothing looked very pleasing to my eye.) This is not a scale number but an "normalized additive factor defined as a percentage of the font size. For a 10 pt font 1.0 will add 0.1pt between each letter." (fontspec docs, p.33).

This doesn't solve the "darker when overlapping" issue, though. For that you might need to treat the digits individually with TikZ or something.

\documentclass[12pt,twoside,draft]{scrbook}

\usepackage{geometry}
\geometry{
paperwidth=11.7in,
paperheight=8.27in,
top=1in,
bottom=1in,
outer=1.5in, 
inner=0.7in,
voffset=0in,
marginparwidth=0.5in,
marginparsep=0.2in,
footskip=0em,
headsep=0pt,
nofoot,
nohead  
}

\usepackage{mathtools}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{anyfontsize}
\usepackage{fontspec}
\newfontfamily\chapterfont[LetterSpace=-12]{Latin Modern Roman}
\usepackage{titlesec}
\usepackage[english]{babel}

\titleformat{\chapter}[display]
{\normalfont\bfseries\color{gray!100!white!50}\fontsize{\paperheight}{\paperheight}\selectfont}%
{\resizebox{!}{\paperheight+1in}{\chapterfont\thechapter}}%
{-\paperheight}%
{\color{black}\raggedright\Huge}

\titlespacing{\chapter}{0in}{-1.5in}{40pt}

\begin{document}

\setcounter{chapter}{20}
\chapter{Twenty One}

\lipsum[1]

\end{document}

output of code

Example with full overlap (value of -35):

enter image description here


This is not really an answer to the original question, just a note from a discussion with Steven. Here is a crude method of squeezing and coloring the overlap using tikz opacity. Stevens sqeeze slitter code is stil used.

\documentclass[a4paper]{standalone}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage{tikz,etoolbox,xcolor}
\usetikzlibrary{calc}
\def\myList{}
\def\intens{50}
\def\adjustment{0pt}
\def\pullback{10mm}
\def\squeeze#1#2\relax{
  \listxadd\myList{{#1}{\intens}}
  \ifx\relax#2\relax\else%
  \xdef\intens{\the\numexpr\intens+25\relax}%
  \squeeze#2\relax%
  \fi}
\newcommand\Handler[1]{
  \begingroup
  \def\Splitter##1##2\relax{\gdef\VAL{##1}\gdef\INT{##2}}
  \expandafter\Splitter#1\relax
  \node[gray!100!white!\INT,opacity=0.5] 
  at ($(0,0)+(\adjustment,0)$) {\fontsize{10cm}{10cm}\selectfont\VAL};
  \global\dimdef\adjustment{\adjustment+\pullback}
  \endgroup
  }
\newcommand\DoSqeezed[1]{%
  \def\myList{}%
  \dimdef\adjustment{0pt}%
  \edef\tmp{#1}%
  \expandafter\squeeze\tmp\relax%
  \tikz\forlistloop\Handler\myList;
}
\begin{document}
\DoSqeezed{21}
\DoSqeezed{213}
\end{document}

This could probably be placed in the background either through some feature in titlesec (I don;t use it so unfamilliar) or by using a standard

\begin{tikzpicture}[remember picture,overlay]
...
\end{tikzpicture}

instead of the \tikz ... ; wrapper.

enter image description here


Slightly adjusted version, which should also work with old style numerals. Also switched to memoir to test a few things that are not easy to test in the standalone class

\documentclass[a4paper]{memoir}
\setlrmarginsandblock{1cm}*1
\checkandfixthelayout
\pagestyle{empty}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage{tikz,etoolbox,xcolor}
\usetikzlibrary{calc}
\newcommand\myList{}
\newcommand\intens{50}
\newcommand\adjustment{0pt}
\newcommand\pullback{10mm}
\def\squeeze#1#2\relax{
  \listxadd\myList{{#1}{\intens}}
  \ifx\relax#2\relax\else%
  \xdef\intens{\the\numexpr\intens+25\relax}%
  \squeeze#2\relax%
  \fi}
\newcommand\Handler[1]{
  \begingroup
  \def\Splitter##1##2\relax{\gdef\VAL{##1}\gdef\INT{##2}}
  \expandafter\Splitter#1\relax
  \node[anchor=mid west,gray!100!white!\INT,opacity=0.5] 
  at ($(0,0)+(\adjustment,0)$) {\fontsize{10cm}{10cm}\selectfont\VAL};
  \global\dimdef\adjustment{\adjustment+\pullback}
  \endgroup
  }
\newcommand\DoSqeezed[1]{%
  \renewcommand\myList{}%
  \dimdef\adjustment{0pt}%
  \edef\myTemp{#1}%
  \expandafter\squeeze\myTemp\relax%
  \tikz
  %[remember picture,overlay]
  \forlistloop\Handler\myList;
}
\begin{document}
%\newcounter{chapter}
\setcounter{chapter}{678}
\DoSqeezed{\thechapter}
\DoSqeezed{213}
\end{document}