# Insert chapter Number inside a symbol and a block of text too

The author of a book I am editing would like to insert a certain symbol inside the Chapter Numbers of his book. He wants this:

Is there a way to insert a symbol in background and be able to write over it?

Here is my MWE:

\documentclass[14pt,twoside,showtrims,a5paper,extrafontsizes]{memoir} %Classe estilo memoir
\usepackage[brazilian]{babel} %Traduz doc para português do Brasil
\usepackage[utf8]{inputenc} %Reconhece acentuação
\usepackage{lipsum}

\chapterstyle{thatcher}

\begin{document}
\renewcommand{\chaptername}{} %remove a string "Capítulo"

\chapter{Dedicatória}
\lipsum [2]

\end{document}

• I thought of hacking it by editing the page in photoshop and including it afterwards, but then I would have lost the TOC reference due to the Chapter page not being counted normally. May 24, 2016 at 5:12
• It's possible, for example, using TikZ nodes, but does it really look nice? Here's an answer of mine (using hyperlinks, but that can be dropped of course): tex.stackexchange.com/questions/305747/…
– user31729
May 24, 2016 at 10:15

First of all, your use of

\renewcommand{\chaptername}{}% Remove a string "Chapter"


for this chapter is incorrect, as there is still a space remaining as part of the chapter name printing macro. Instead you're looking to redefine \printchaptername to something like

\renewcommand{\printchaptername}{\centering{\chapnumfont\thechapter}}


Now, for setting the number inside some other construction, you can redefine \printchaptername to suit your needs. Here is one example using pgfornament:

\documentclass[14pt,twoside]{memoir}
\usepackage{lipsum,pgfornament}

\chapterstyle{thatcher}

\renewcommand{\printchaptername}{%
\centering
\begin{tikzpicture}[every node/.style={inner sep=0pt}]
\node[anchor=south] (image) {\pgfornament[symmetry=h,scale=4]{172}};
\node at (image.center) {\chapnumfont\thechapter};
\end{tikzpicture}%
}

\begin{document}

\chapter{Dedicaion}
\lipsum [2]

\end{document}


For some ornaments, see

• Thanks for the help @Werner! I had noticed that the numbers were not really aligned properly, but now they are fine. May 25, 2016 at 4:27
• do you think it is possible to draw that symbol I used in the picture with the Inskape package as suggested in the pgfornament documentation? Or we rather just change our mind and use some preset symbols. May 25, 2016 at 4:50
• @Adriano: Of course! You can overlay or inset objects on top of one another using a number of ways.
– Werner
May 25, 2016 at 4:55
• Alright, I will make sure to look for a way of doing it. May 25, 2016 at 4:56