xkeyval エラー: `HEIGHT' ('WIDTH') がファミリ `psvectorian' で定義されていません

xkeyval エラー: `HEIGHT' ('WIDTH') がファミリ `psvectorian' で定義されていません

用語集のタイトル、たとえば「シンボルのリスト」を次のように変更したいと思います (パッケージから借用したいくつかのエンティティを使用psvectorian)。

\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\\

これが私のMWE

\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}

これにgloss-symb.tex

\newglossaryentry{sigma}{name={\ensuremath{\Sigma}}, description={Event set}}

しかし、次のようなエラーが発生しました。

Package xkeyval Error: `HEIGHT' undefined in families `psvectorian'. \end{document}

Package xkeyval Error: `WIDTH' undefined in families `psvectorian'. \end{document}

psvectorian マニュアル(ページ 2) では、widthと がheight確かに有効なキーであることがすでに述べられています。では、ここで何が間違っているのでしょうか?

答え1

widthと はheight実際に存在しますが、WIDTHと はHEIGHT存在しません。問題は、タイプセット中のある時点で\glossarynameマクロが展開されて\MakeUppercased になるため、 にwidthなりWIDTH、エラーが発生することです。これは、コード ( など) とテキストを混在させる問題です\psvectorian。純粋なテキストを期待する一部のコードは、一般的なコマンドでは適切に動作しません。

\psvectorian簡単な方法の 1 つは、コマンドをマクロにまとめ\protected、大文字化される前に展開されないようにすることです (したがって、大文字化もされません)。 の定義を 3 つの部分に分割すると、\abcこの作業が完了します。

\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}

コンパイル可能なコード:

\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}

関連情報