7

Well, I'm using a such a code bellow, basically I would like to add ornaments to the numbering of this chapter... Any ideas, examples please? thanks a lotenter image description here

\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
  \makeatletter
       \def\@makechapterhead#1{%
        \vspace*{50\p@}%
        {\parindent \z@ \raggedright \normalfont
        %\ifnum \c@secnumdepth >\m@ne
        %    \huge\bfseries \@chapapp\space \thechapter
        %    \par\nobreak
        %    \vskip 20\p@
        %\fi
     \interlinepenalty\@M
          \Huge \bfseries #1\par\nobreak
      \vskip 40\p@
       }}
      \makeatother

% Datei fancyheaders.tex
% Kopf- und Fu�zeile mit Paket fancyhdr
% Paket muss extra installiert werden


\usepackage{fancyhdr}   % Paket laden
 \pagestyle{fancy}  % bereitgestelltes Layout 'fancy' laden
 % Am Anfang jeder neuen \section wird deren Name in die linke Kopfzeile         geschrieben, dazu neuen command definieren
 %\renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}}
 % Am Anfang jeder neuen \subsection wird deren Name in die rechte Kopfzeile  geschrieben, dazu neuen command definieren
 %\renewcommand{\subsectionmark}[1]{\markright{\thesubsection\ #1}}
  %  Die so erzeugten Inhalte stehen jetzt mit den Befehlen
   % \leftmark und \rightmark zur Verf�gung und k�nnen wie im folgenden eingesetzt werden:
    % \lhead[\rightmark]{\rightmark}

  %\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{}}
   \renewcommand{\sectionmark}[1]{\markright{\textsl{\thesection\ #1}}}

   %%\renewcommand\chaptermark[1]{\markboth{\textsl{\chaptername\  \thechapter\ : #1}}{}}
   %\renewcommand{\chaptermark}[1]{\markboth{#1}{}}

    \makeatletter
       \def\@makechapterhead#1{%
        \vspace*{50\p@}%
       {\parindent \z@ \raggedright \normalfont
  %\ifnum \c@secnumdepth >\m@ne
  %    \huge\bfseries \@chapapp\space \thechapter
  %    \par\nobreak
  %    \vskip 20\p@
  %\fi
  \interlinepenalty\@M
  \Huge \bfseries #1\par\nobreak
  \vskip 40\p@
}}
 \makeatother





\usepackage[T1]{fontenc}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{blindtext}

\newcommand{\chapnumfont}{%     % define font for chapter number
 \usefont{T1}{pnc}{b}{n}%      % choose New Chancery, bold, normal shape
 \fontsize{100}{100}%          % font size 100pt, baselineskip 100pt
 \selectfont%                  % activate font
  }
  \colorlet{chapnumcol}{gray!100}  % color for chapter number

     \titleformat{\chapter}[display]
  {\filleft\bfseries}
  {\filleft\chapnumfont\textcolor{chapnumcol}{\thechapter}}
  {-24pt}
  {\Huge}


  \fancyhead{}
     %\fancyhead[L]{\leftmark}
      \fancyhead[L]{}
      \fancyhead[R]{}%{\rightmark}
     \fancyfoot{}
    \fancyfoot[L]{}
     \fancyfoot[C]{}%{\leftmark}
      \fancyfoot[R]{\thepage}
    \renewcommand{\headrulewidth}{0.4pt}
     \renewcommand{\footrulewidth}{0.4pt}



      % Style "plain" berschreiben, das bei 
     %\chapter{...} mit aktiviert wird
   \fancypagestyle{plain}{
    \lhead{}
     \chead{}
      \rhead{}
     \lfoot{}
     \cfoot{}
   \rfoot{\thepage}
   \renewcommand{\headrulewidth}{0.0pt}
       \renewcommand{\footrulewidth}{0.4pt}}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
user35815
  • 143

1 Answers1

10

Below I present several options produced with the help of the titlesec package.

Two simple alternatives . The first one simply draws a frame around the number; the second one uses a colored background with shades (requires TikZ):

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

\begin{document}

\let\cleardoublepage\relax     % just for the example

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\raggedleft}
  {\fbox{\makebox[3cm][r]{\fontsize{100}{130}\color{gray}\selectfont\thechapter}}}
  {20pt}
  {\Huge}
\chapter{Test chapter}

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\raggedleft}
  {\tikz\node[inner xsep=0pt,top color=gray!10,bottom color=gray!70,text width=3.5cm,align=right] 
    {{\fontsize{100}{130}\color{gray}\selectfont\thechapter}};%
  }
  {20pt}
  {\Huge}
\chapter{Test chapter}

\end{document}

enter image description here

Another one, adding a simple rule to the right:

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

\begin{document}

\let\cleardoublepage\relax     % just for the example

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\raggedleft}
  {{\fontsize{100}{130}\color{gray}\selectfont\thechapter\rlap{\vrule width 2pt height 100pt}}}
  {20pt}
  {\Huge}
\chapter{Test chapter}

\end{document}

enter image description here

Some more elaborate decorations using pgfornament:

\documentclass{book}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{pgfornament}
\usetikzlibrary{calc}

\begin{document}

\let\cleardoublepage\relax     % just for the example

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\raggedleft}
  {\begin{tikzpicture}
  \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{tikzpicture}
  }
  {20pt}
  {\Huge}
\chapter{Test chapter}

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\raggedleft}
  {\begin{tikzpicture}
  \node[text width=3cm,align=center] (chapnum)
    {\fontsize{100}{130}\color{gray}\selectfont\thechapter};%
  \node[shift={(-1cm,10pt)},anchor=north west](CNW)
    at (chapnum.north west) {\pgfornament[width=1cm]{7}};
  \node[shift={(1cm,10pt)},anchor=north east](CNE)
    at (chapnum.north east) {\pgfornament[width=1cm,symmetry=v]{7}};
  \end{tikzpicture}
  }
  {20pt}
  {\Huge}
\chapter{Test chapter}

\end{document}

enter image description here

And two more examples, this time using the Web-O-Mints fonts:

\documentclass{book}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{lmodern}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand*\wb[2]{%
  \fontsize{#1}{#2}\usefont{U}{webo}{xl}{n}}

\begin{document}

\let\cleardoublepage\relax     % just for the example

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\raggedleft}
  {\begin{tikzpicture}
  \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) {\wb{20}{24}I};
  \node[shift={(1cm,1cm)},anchor=north east](CNE)
    at (chapnum.north east) {\wb{20}{24}J};
  \end{tikzpicture}
  }
  {20pt}
  {\Huge}
\chapter{Test chapter}

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\raggedleft}
  {\begin{tikzpicture}
  \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) {\wb{40}{48}A};
  \node[shift={(1cm,1cm)},anchor=north east](CNE)
    at (chapnum.north east) {\wb{40}{48}B};
  \end{tikzpicture}
  }
  {20pt}
  {\Huge}
\chapter{Test chapter}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128