I would like to have nice fleurons and decorations at the end of my chapters to mimic the style of a book from the late 1800's. Some searches brought pgfornaments to my attention (a more user friendly version of ps vectorian) as the ps decorations look fantastic – exactly what I was looking for.
At any rate, after playing around with it, I've found that centering the PS images produces quite terrible results (see the image below). I should note that these examples are larger than I would use in a real book, but they're enlarged to make it easier to see where the center of the image really is. Not only are the images not centered, but the offset isn't even consistent from image to image. That makes this package completely unusable...
Can someone with more experience tell me if the problem here is specific to pgfornament (the documentation claims it's still in beta) or if the problem is how the PS images themselves are created (i.e., should I try working directly with ps vectorian or will that have the same problem?). Is there some way to fix this so the centering environment works correctly with these objects?
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
% this allows us to use real characters like æ instead of macros like \ae
%% PREAMBLE
\documentclass[letterpaper,titlepage,twoside,openany,12pt]{book}
%easier methods for loading fonts and specifying font features
\usepackage{fontspec}
%Use Junicode for access to runes and other nice medieval features
\setmainfont[Language=Icelandic, Fractions=On]{Junicode}
\newcommand{\jfd}{} %\symbol{"E67D}}
%Switch implementation for end-of-chapter fleurons (below)
\usepackage{xifthen}
\newcommand{\ifequals}[3]{\ifthenelse{\equal{#1}{#2}}{#3}{}}
\newcommand{\case}[2]{#1 #2} % Dummy, so \renewcommand has something to overwrite...
\newenvironment{switch}[1]{\renewcommand{\case}{\ifequals{#1}}}{}
\usepackage[object=vectorian]{pgfornament}
\newcommand{\chapterline}[1]{
\begin{center}
\Large\color{myred}
\begin{switch}{#1}
\case{1}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{80}}
\case{2}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{81}}
\case{3}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{82}}
\case{4}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{83}}
\case{5}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{84}}
\case{6}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{85}}
\case{7}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{86}}
\case{8}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{87}}
\case{9}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{88}}
\case{10}{\pgfornament[anchor=center,ydelta=0pt,width=5cm]{89}}
\end{switch}
\end{center}
}
%Define some colors for the fancy titles
\usepackage{color}
\definecolor{myblue}{rgb}{0,0,0.4}
\definecolor{myred}{rgb}{0.6,0,0}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\Huge\filcenter}
{
{\Large\color{myred}}\\[0.5cm]
\color{myblue}\chaptertitlename\ \thechapter\\[0.4cm]
\color{myred}\jfd
}
{0.4cm}
{\filcenter}
[\vspace{0.1cm}{\Large\color{myred}}]
\titlespacing*{\chapter}{0pt}{-50pt}{*2.0}
%Customize some margions and other lengths
\usepackage{geometry}
%Although shifted even/odd margins look nice for two sided
%printing, it's distracting when viewing the PDF.
\geometry{outer=1.1in,inner=1.1in}
\geometry{bindingoffset=0cm,hratio=1:1}
%the default bottom margin is huge, make it a bit smaller
\addtolength{\textheight}{0.75in}
\begin{document}
\mainmatter
\chapter[Test Ornaments]{Test Ornaments \\ Ornament Test}
\chapterline{1}
\chapterline{2}
\chapterline{3}
\chapterline{4}
\chapterline{5}
\chapterline{6}
\chapterline{7}
\chapterline{8}
\chapterline{9}
\chapterline{10}
\end{document}
\chapterline
command.\chapterline
. There should be a%
at the end of every line starting with\case
.titlehead
. For example, the command\titlehead{\pgfornament{89}}
produces an ornament that is off centered.