15.07.2013 Views

glossaries.sty: LaTeX2e Package to Assist Generating ... - CTAN

glossaries.sty: LaTeX2e Package to Assist Generating ... - CTAN

glossaries.sty: LaTeX2e Package to Assist Generating ... - CTAN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

\glsdoifnoexists \glsdoifnoexists{〈label〉}{〈code〉}<br />

The opposite: only do second argument if the entry doesn’t exists. Generate<br />

an error message if it exists.<br />

976 \newcommand{\glsdoifnoexists}[2]{%<br />

977 \ifglsentryexists{#1}{%<br />

978 \<strong>Package</strong>Error{<strong>glossaries</strong>}{Glossary entry ‘#1’ has already<br />

979 been defined}{}}{#2}%<br />

980 }<br />

\ifglshaschildren \ifglshaschildren{〈label〉}{〈true part〉}{〈false part〉}<br />

981 \newcommand{\ifglshaschildren}[3]{%<br />

982 \glsdoifexists{#1}%<br />

983 {%<br />

984 \def\do@glshaschildren{#3}%<br />

985 \expandafter\forglsentries\expandafter[\csname glo@#1@type\endcsname]<br />

986 {\glo@label}%<br />

987 {%<br />

988 \letcs\glo@parent{glo@\glo@label @parent}%<br />

989 \ifthenelse{\equal{#1}{\glo@parent}}%<br />

990 {%<br />

991 \def\do@glshaschildren{#2}%<br />

992 \@endfortrue<br />

993 }%<br />

994 {}%<br />

995 }%<br />

996 \do@glshaschildren<br />

997 }%<br />

998 }<br />

\ifglshasparent \ifglshaschildren{〈label〉}{〈true part〉}{〈false part〉}<br />

\@glo@types<br />

999 \newcommand{\ifglshasparent}[3]{%<br />

1000 \glsdoifexists{#1}%<br />

1001 {%<br />

1002 \ifcsempty{glo@#1@parent}{#3}{#2}%<br />

1003 }%<br />

1004 }<br />

1.6 Defining new <strong>glossaries</strong><br />

A comma-separated list of glossary names is s<strong>to</strong>red in \@glo@types. When<br />

a new glossary type is created, its identifying name is added <strong>to</strong> this list. This is<br />

used by commands that iterate through all <strong>glossaries</strong> (such as \make<strong>glossaries</strong><br />

and \print<strong>glossaries</strong>).<br />

1005 \newcommand*{\@glo@types}{,}<br />

A new glossary type is defined using \newglossary. Syntax:<br />

40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!