%20%E3%81%8C%E3%83%95%E3%82%A1%E3%83%9F%E3%83%AA%20%60psvectorian'%20%E3%81%A7%E5%AE%9A%E7%BE%A9%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%81%BE%E3%81%9B%E3%82%93.png)
用語集のタイトル、たとえば「シンボルのリスト」を次のように変更したいと思います (パッケージから借用したいくつかのエンティティを使用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
マクロが展開されて\MakeUppercase
d になるため、 に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}