2

I am trying my best to make a beatiful ornament on partpage, but position of parttitle is awful in my every trying. It should be under words "PART I".

I tried to define newcommand \parttitle to catch parttitle (I mean words "I AM HERE"), but nothing happens, and even then phrase "I AM HERE" will be repeated two times. That's awful too.

Maybe it is too easy, then sorry.

Please, take a look at the screenshot:

enter image description here

\documentclass{book}
\usepackage{titlesec}
\usepackage{pgfornament}
\usepackage{tikz}
\usepackage{xcolor}

\newcommand{\framesize}{\textwidth}

\titleformat{\part}
[display]
{\centering\normalfont\Huge\bfseries}
{\begin{tikzpicture}[color=black,
transform shape,
every node/.style={inner sep=0pt}]
\node[minimum size=\framesize,fill=white!10](vecbox){};
\node[inner sep=6pt] (text) at (vecbox.center){\MakeUppercase{\Huge \partname\ \thepart}};
\node[anchor=north] at (text.south){%
\pgfornament[width=0.75*\framesize]{75}};
\node[anchor=south] at (text.north){%
\pgfornament[width=0.75*\framesize,symmetry=h]{75}};
\end{tikzpicture}\vspace{3pt}}
{0pt}
{\huge\MakeUppercase}

\begin{document}
\part{I am here}
\end{document}
3

I don't think TikZ is helpful here. It just adds unnecessary complications. Why can't you just say something like this?

\documentclass{book}
\usepackage{titlesec}
\usepackage{pgfornament}
\newcommand{\framesize}{\textwidth}
\titleformat{\part}
  [display]
  {\centering\normalfont\Huge\bfseries}
  {%
    \mbox{\pgfornament[width=0.75\framesize,symmetry=h]{75}}
    \vskip 3pt
    \MakeUppercase{\Huge \partname\ \thepart}%
  }
  {3pt}
  {\huge\MakeUppercase}
  [%
  \mbox{\pgfornament[width=0.75\framesize]{75}}%
  ]

\begin{document}
\part{I am here}
\end{document}

fancy part page

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy