0

This question already has an answer here:

Consider the following code:

\documentclass[oneside, 10pt]{book}
\usepackage[
    paperwidth=6in,
    paperheight=9in,
    tmargin=0.75in,
    bmargin=0.75in,
    lmargin=0.75in,
    rmargin=0.75in
]{geometry}
\usepackage{calc}
\usepackage{tikz}
\usepackage{etoolbox}
\usepackage{transparent}
\usepackage[explicit]{titlesec}
\usepackage{tikzpagenodes}
\usepackage[table]{xcolor}
\usetikzlibrary{calc}
\usetikzlibrary{fadings}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{matrix}
\pagestyle{empty}

\titleformat{\part}[display]{\normalfont\filcenter}{
\thispagestyle{empty}
\tikz[remember picture, overlay] {
    \matrix [column sep = 5mm] at (current page text area.center) {
        \node[
            inner sep = 0pt,
            outer sep = 0pt,
            font = \sffamily\fontsize{24}{24}\selectfont
        ] {Part};
&
        \node [
            circle,
            fill = black,
            font = \sffamily\fontsize{24}{24}\bf\selectfont\color{white},
            outer sep = 0pt,
            minimum size = 1.5cm
        ] {\thepart};
\\};
}
}{6em}{
}[]

\begin{document}

\tikz[remember picture, overlay]{
  \matrix [column sep=5mm] at (current page text area.center) {
    \node[
        inner sep = 0pt,
        outer sep = 0pt,
        font = \sffamily\fontsize{24}{24}\selectfont
    ] {Part};
 &
    \node[
        circle,
        fill = black,
        font = \sffamily\fontsize{24}{24}\bf\selectfont\color{white},
        outer sep = 0pt,
        minimum size = 1.5cm
    ]  (numb) {I};
\\
};
}

\part{}

\end{document}

The result is the following: enter image description here enter image description here

Why is the first page different than the second, and how to make the titleformat work the same way as the normal tikz command? In other words, how to center "Part I" in the page on a single line as it is done on the first page? And why does it currently fail?

marked as duplicate by Torbjørn T. tikz-pgf Oct 17 '17 at 18:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.