I'm trying to come up with some simple tikz based chapter style for memoir.

I've gotten to a point where I'm almost happy with the result but there is a space before the chapter title which I haven't been able to remove yet.

Here's my code (to be compiled with xelatex)


  \begin{tikzpicture}[overlay, inner sep=10pt, outer sep=0]
    \node[draw=white!80!black, fill=white!80!black, white,
    left, anchor=base east, scale=2, inner sep=4pt] (cn) at (\textwidth,0) {\chapnumfont \rmfamily \thechapter};
    \draw[white!80!black] (cn.south east) -- ++(-\textwidth, 0);
    \draw[red] (0,2) -- ++(0,-\textheight);
    \draw[red] (\textwidth,2) -- ++(0,-\textheight);


\chapter{First chapter}

It gives me this result (red lines, commented out in the mwe, show that chapter title is not flush with the textblock)

extra spacing before chapter

How can I remove that extra spacing before the title?

  • How does those read lines show your issues? How are they made? Please be more specific in your question – daleif Jan 23 '18 at 14:55
  • @daleif the red lines show that "FIRST" is not flush with the textblock. You can obtain them with \draw[red] (0,2) -- ++(0,-\textheight); \draw[red] (\textwidth,2) -- ++(0,-\textheight); inside the tikzpicture block – filippo Jan 23 '18 at 14:57
  • Maybe you are looking for ` \renewcommand*\chapterheadstart{}`. But that looks bad since your is an overlay and thus have no size. BTW: this design is more or less doable without tikz – daleif Jan 23 '18 at 14:57
  • 1
    Isn't it the space after \tikzchapnum{##1} try ending that line with a %. Print chapternum is executed right before printchaptertitle, so if it leaves stuff behind it shows. – daleif Jan 23 '18 at 15:29
  • 2
    @daleif you're right, there's a space there, and one after \end{tikzpicture}! thank you, if you want to add it as an answer I'll accept it. Give me a couple of minutes and I'll update the mwe with a more minimal one. – filippo Jan 23 '18 at 15:34

The issue is a sporadic space after this line


The \printchapternum is executed before \printchaptertitle, thus everything left by it gets interpreted. Use



| improve this answer | |

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.