答案1
是的,你可以按照你建议的方式将这两个答案结合起来。如果你对代码的特定部分有疑问,请随时提问。我唯一添加到答案中的就是在local bounding box
装饰物周围添加一个,这样就可以轻松地定位旋转的Chapter
。
\documentclass{book}
\usepackage{xcolor}
\usepackage[explicit]{titlesec}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{pgfornament}
\usetikzlibrary{calc}
\definecolor{myblue}{RGB}{0,0,122}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\raggedleft}
{\begin{tikzpicture}
\begin{scope}[local bounding box=orna]
\node[text width=3cm,align=center] (chapnum)
{\fontsize{100}{130}\color{gray}\selectfont\thechapter};%
\node[shift={(-1cm,1cm)},anchor=north west](CNW)
at (chapnum.north west) {\pgfornament[width=1.75cm]{61}};
\node[shift={(1cm,1cm)},anchor=north east](CNE)
at (chapnum.north east) {\pgfornament[width=1.75cm,symmetry=v]{61}};
\node[shift={(-1cm,-1cm)},anchor=south west](CSW)
at (chapnum.south west) {\pgfornament[width=1.75cm,symmetry=h]{61}};
\node[shift={(1cm,-1cm)},anchor=south east](CSE)
at (chapnum.south east) {\pgfornament[width=1.75cm,symmetry=c]{61}};
\end{scope}
\node[rotate=90,anchor=south,inner sep=0pt,font=\Huge\sffamily] at (orna.west) {\chaptertitlename};
\end{tikzpicture}
}{0pt}{\fontsize{33}{40}\selectfont\color{myblue}#1}[\vskip10pt\Large]
\titlespacing*{\chapter}{0pt}{50pt}{10pt}
\begin{document}
\chapter{Test chapter}
\end{document}