# Decoration in the Chapter Title

I am trying to use a decoration in the chapter title using the psvectorian package. The problem is that it doesn't work. What am I doing wrong?

MWE

\documentclass{book}

\usepackage[raggedright]{titlesec}

\titleformat{\chapter}[display]%
{%
\LARGE \centering \bfseries%
}{Chapter\\[1cm] \thechapter}{1cm}{}[\psvectorian[scale=0.5]{82}]

\usepackage{fontspec}

\usepackage[english]{babel}

\usepackage{psvectorian}

\begin{document}

\chapter{Text}

\end{document}

• 'Doesn't work' is no useful description, but I think the main reason is that psvectorian does not compile with lualatex and the optional argument of \psvectorian must be protected because it is inside an [...] already – user31729 Dec 26 '17 at 19:56
• @ChristianHupfer I use XeLaTeX and psvectorian in other parts of my document without a problem. The only part that doesn't produce an output is when I use it in the chapter title. – Adam Dec 26 '17 at 19:58
• Yes, I forgot that XeLaTeX and psvectorian do work. The main cause is the optional argument – user31729 Dec 26 '17 at 20:00

The cause here is that \psvectorian does have an optional argument and is used inside another optional argument -- this does not work for commands defined with \newcommand etc.

Use [{\psvectorian[scale=0.5]{82}}] in order to protect the inner ] pair from being recognized as the closing of the outer [.

\documentclass{book}

\usepackage[raggedright]{titlesec}

\usepackage{auto-pst-pdf}

\titleformat{\chapter}[display]%
{%
\LARGE \centering \bfseries%
}{Chapter\\[1cm] \thechapter}{1cm}{}[{\psvectorian[scale=0.5]{82}}]

\usepackage{fontspec}

\usepackage[english]{babel}

\usepackage{psvectorian}

\begin{document}

\chapter{Text}

\end{document}