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}
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?


ampersand replacement=\&to thematrixoptions, and use\&instead of&in the matrix. – Torbjørn T. Oct 17 '17 at 18:51