%20indefinido%20nas%20fam%C3%ADlias%20%60psvectorian'.png)
Gostaria de alterar o título do meu glossário, digamos, Lista de Símbolos, da seguinte maneira (usando algumas entidades emprestadas do psvectorian
pacote).
\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\[\baselineskip]List of Symbols\\[0.9\baselineskip]\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\
Aqui está o meuMWE
\documentclass{memoir}
\usepackage{psvectorian}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{tocloft}
\usepackage{glossaries}
\usepackage{fontspec}
\renewcommand*\glspostdescription{\dotfill}
\newcommand{\abc}[1]{\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\[\baselineskip]#1\\[0.9\baselineskip]\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\}
\loadglsentries{gloss-symb}
\newglossarystyle{mylong}{%
\setglossarystyle{long}%
\renewenvironment{theglossary}%
{\begin{longtable}[l]{@{}p{\dimexpr 2.5cm-\tabcolsep}p{0.8\hsize}}}
{\end{longtable}}%
}
\makenoidxglossaries
\begin{document}
\tableofcontents
\clearpage
\renewcommand{\glossaryname}{\abc{List of Symbols}}
\addcontentsline{toc}{chapter}{List of Symbols}
\printnoidxglossary[style=mylong]
\newpage
\gls{sigma} is an event set.
\end{document}
em que gloss-symb.tex
apenas inclui
\newglossaryentry{sigma}{name={\ensuremath{\Sigma}}, description={Event set}}
No entanto, enfrentei os seguintes erros:
Package xkeyval Error: `HEIGHT' undefined in families `psvectorian'. \end{document}
Package xkeyval Error: `WIDTH' undefined in families `psvectorian'. \end{document}
Opsvectorian
manual(a página 2) já observou isso width
e height
são de fato chaves válidas. Então, o que estou fazendo de errado aqui?
Responder1
width
e height
de fato existem, mas WIDTH
e HEIGHT
não existem. O problema é que em algum momento durante a composição \glossaryname
a macro é expandida ed \MakeUppercase
, assim width
se torna WIDTH
e você recebe o erro. Este é o problema de misturar código ( \psvectorian
e tal) com texto: algum código que espera texto puro não se comportará bem com comandos gerais.
Uma saída fácil é empacotar os \psvectorian
comandos em \protected
macros para que eles não se expandam antes de serem maiúsculos (portanto, eles também não são maiúsculos). Dividir sua definição \abc
em três partes dá conta do recado:
\protected\def\abcbefore{\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\[\baselineskip]}
\protected\def\abcafter{\\[0.9\baselineskip]\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\}
\newcommand{\abc}[1]{\abcbefore#1\abcafter}
Código compilável:
\documentclass{memoir}
\usepackage{psvectorian}
\usepackage{glossaries}
\begin{filecontents*}{gloss-symb}
\newglossaryentry{sigma}{name={\ensuremath{\Sigma}}, description={Event set}}
\end{filecontents*}
\renewcommand*\glspostdescription{\dotfill}
\protected\def\abcbefore{\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\[\baselineskip]}
\protected\def\abcafter{\\[0.9\baselineskip]\hfil\hspace*{-3.5cm}\psvectorian[height=3mm, width=8cm]{88}\hfil\\}
\newcommand{\abc}[1]{\abcbefore#1\abcafter}
\loadglsentries{gloss-symb}
\newglossarystyle{mylong}{%
\setglossarystyle{long}%
\renewenvironment{theglossary}%
{\begin{longtable}[l]{@{}p{\dimexpr 2.5cm-\tabcolsep}p{0.8\hsize}}}
{\end{longtable}}%
}
\makenoidxglossaries
\begin{document}
\tableofcontents
\clearpage
\renewcommand{\glossaryname}{\abc{List of Symbols}}
\addcontentsline{toc}{chapter}{List of Symbols}
\printnoidxglossary[style=mylong]
\newpage
\gls{sigma} is an event set.
\end{document}