diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html')
-rw-r--r-- | Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html | 192 |
1 files changed, 112 insertions, 80 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html index 74207fb56c1..77571dcf832 100644 --- a/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html +++ b/Master/texmf-dist/doc/latex/glossaries/glossary2glossaries.html @@ -26,6 +26,7 @@ package"> <H1 ALIGN="CENTER">Upgrading from the glossary package to the glossaries package</H1> <P ALIGN="CENTER"><STRONG>Nicola L.C. Talbot</STRONG></P> +<P ALIGN="CENTER"><STRONG>17th June 2008</STRONG></P> <BR> <H2><A NAME="SECTION00010000000000000000"> @@ -34,42 +35,44 @@ Contents</A> <!--Table of Contents--> <UL> -<LI><A NAME="tex2html21" +<LI><A NAME="tex2html23" HREF="glossary2glossaries.html#SECTION00020000000000000000">1 Package Options</A> -<LI><A NAME="tex2html22" +<LI><A NAME="tex2html24" HREF="glossary2glossaries.html#SECTION00030000000000000000">2 Defining new glossary types</A> -<LI><A NAME="tex2html23" +<LI><A NAME="tex2html25" HREF="glossary2glossaries.html#SECTION00040000000000000000">3 \make<glossary name></A> -<LI><A NAME="tex2html24" +<LI><A NAME="tex2html26" HREF="glossary2glossaries.html#SECTION00050000000000000000">4 Storing glossary information</A> -<LI><A NAME="tex2html25" +<LI><A NAME="tex2html27" HREF="glossary2glossaries.html#SECTION00060000000000000000">5 Adding an entry to the glossary</A> <UL> -<LI><A NAME="tex2html26" +<LI><A NAME="tex2html28" HREF="glossary2glossaries.html#SECTION00061000000000000000">5.1 \useglosentry</A> -<LI><A NAME="tex2html27" +<LI><A NAME="tex2html29" HREF="glossary2glossaries.html#SECTION00062000000000000000">5.2 \useGlosentry</A> -<LI><A NAME="tex2html28" +<LI><A NAME="tex2html30" HREF="glossary2glossaries.html#SECTION00063000000000000000">5.3 \gls</A> -<LI><A NAME="tex2html29" +<LI><A NAME="tex2html31" HREF="glossary2glossaries.html#SECTION00064000000000000000">5.4 \glossary</A> </UL> <BR> -<LI><A NAME="tex2html30" +<LI><A NAME="tex2html32" HREF="glossary2glossaries.html#SECTION00070000000000000000">6 Acronyms</A> <UL> -<LI><A NAME="tex2html31" +<LI><A NAME="tex2html33" HREF="glossary2glossaries.html#SECTION00071000000000000000">6.1 \acrln and \acrsh</A> -<LI><A NAME="tex2html32" +<LI><A NAME="tex2html34" HREF="glossary2glossaries.html#SECTION00072000000000000000">6.2 \ifacronymfirstuse</A> -<LI><A NAME="tex2html33" +<LI><A NAME="tex2html35" HREF="glossary2glossaries.html#SECTION00073000000000000000">6.3 \resetacronym and \unsetacronym</A> </UL> <BR> -<LI><A NAME="tex2html34" +<LI><A NAME="tex2html36" HREF="glossary2glossaries.html#SECTION00080000000000000000">7 Displaying the glossary</A> -<LI><A NAME="tex2html35" +<LI><A NAME="tex2html37" HREF="glossary2glossaries.html#SECTION00090000000000000000">8 Using makeindex</A> +<LI><A NAME="tex2html38" + HREF="glossary2glossaries.html#SECTION000100000000000000000">9 Troubleshooting</A> </UL> <!--End of Table of Contents--> <P> @@ -104,7 +107,7 @@ to the <TT>glossaries</TT> package options. <A NAME="tab:pkgopt"></A> <DIV ALIGN="CENTER"> -<A NAME="462"></A> +<A NAME="502"></A> <TABLE CELLPADDING=3> <CAPTION><STRONG>Table 1:</STRONG> Mappings from <TT>glossary</TT> to <TT>glossaries</TT> @@ -221,7 +224,7 @@ with in the preamble, and <P> -<TT><TT>\glossarystyle{<<I>new style list</I>>}</TT></TT> +<TT><TT>\glossarystyle{<<I>new style</I>>}</TT></TT> <P> immediately before <code>\printglossary[type=</code><<I>type</I>><code>]</code>, if the new glossary requires a different style to the main (default) @@ -229,7 +232,7 @@ glossary. <P> The <<I>style list</I>> optional argument can be converted to -<<I>new style list</I>> using the same mapping given in +<<I>new style</I>> using the same mapping given in Table <A HREF="glossary2glossaries.html#tab:pkgopt">1</A>. <P> @@ -244,11 +247,18 @@ You will need to replace the above two lines with: </PRE> in the preamble, and <PRE> -\glossarystyle{style=longheader} +\glossarystyle{longheader} </PRE> immediately prior to displaying this glossary new type. <P> +Alternatively, you can specify the style using the <TT>style</TT> +key in the optional argument of <TT>\printglossary</TT>. For example: +<PRE> +\printglossary[type=notation,style=longheader] +</PRE> + +<P> Note that the glossary title is no longer specified using <TT>\</TT><<I>glossary-type</I>><TT>name</TT> (except for <TT>\glossaryname</TT> and <TT>\acronymname</TT>) but is instead specified in the <<I>title</I>> @@ -289,8 +299,8 @@ With the old <TT>glossary</TT> package you could optionally store glossary information for later use, or you could simply use <TT>\glossary</TT> whenever you wanted to add information to the glossary. With the new <TT>glossaries</TT> package, the latter option is no longer -available<A NAME="tex2html2" - HREF="#foot464"><SUP>1</SUP></A>. If +available.<A NAME="tex2html2" + HREF="#foot504"><SUP>1</SUP></A> If you have stored all the glossary information using <TT>\storeglosentry</TT>, then you will need to convert these commands into the equivalent <TT>\newglossaryentry</TT>. If you haven't used @@ -344,9 +354,6 @@ description={The cardinality of the set $\mathcal{S}$}} <P> The <TT>format</TT> and <TT>number</TT> keys available in <TT>\storeglosentry</TT> are not available with <TT>\newglossaryentry</TT>. -Note also that the <TT>glossary</TT> package allowed you to use -<TT>\storeglosentry</TT> in the document, but <TT>\newglossaryentry</TT> -may only be used in the preamble. <P> @@ -408,7 +415,7 @@ Any occurrences if this command will need to be replaced with <TT><TT>\glslink[<<I>new options</I>>]{<<I>label</I>>}{<<I>text</I>>}</TT></TT> <P> The mapping from <<I>old options</I>> to <<I>new options</I>> is -the same as that given in section <A HREF="glossary2glossaries.html#sec:useglosentry">5.1</A> above. +the same as that given <A HREF="glossary2glossaries.html#sec:useglosentry">above</A>. <P> @@ -420,7 +427,9 @@ the same as that given in section <A HREF="glossary2glossaries.html#sec:use Both the <TT>glossary</TT> and the <TT>glossaries</TT> packages define the command <TT>\gls</TT>. In this case, the only thing you need to change is the <TT>number</TT> key in the optional argument -to <TT>counter</TT>. +to <TT>counter</TT>. Note that the new form of <TT>\gls</TT> also takes +a final optional argument which can be used to insert text into the +automatically generated text. <P> @@ -431,13 +440,13 @@ to <TT>counter</TT>. <P> When using the <TT>glossaries</TT> package, you should not use <TT>\glossary</TT> directly.<A NAME="tex2html3" - HREF="#foot469"><SUP>2</SUP></A> If, with the old + HREF="#foot511"><SUP>2</SUP></A> If, with the old package, you have opted to explicitly use <TT>\glossary</TT> instead of storing the glossary information with <TT>\storeglosentry</TT>, then converting from <TT>glossary</TT> to <TT>glossaries</TT> will be more time-consuming, although in the end, I hope you will see the benefits!<A NAME="tex2html4" - HREF="#foot470"><SUP>3</SUP></A> If + HREF="#foot512"><SUP>3</SUP></A> If you have used <TT>\glossary</TT> with the old glossary package, you will instead need to define the relevant glossary terms using <TT>\newglossaryentry</TT> and reference the terms using <TT>\glslink</TT>, @@ -462,7 +471,7 @@ In the <TT>glossary</TT> package, acronyms were treated differently to glossary entries. This resulted in inconsistencies and sprawling unmaintainable code. The new <TT>glossaries</TT> package treats acronyms in exactly the same way as normal glossary terms. In fact, -in the <TT>glossaries</TT> package: +in the <TT>glossaries</TT> package, the default definition of: <P> <TT><TT>\newacronym[<<I>options</I>>]{<<I>label</I>>}{<<I>abbrv</I>>}{<<I>long</I>>}</TT></TT> @@ -483,20 +492,10 @@ firstplural={<<I>long</I>>s (<<I>abbrv</I>>s)}, <P> This is different to the <TT>glossary</TT> package which set the <TT>name</TT> key to <<I>long</I>> (<<I>abbrv</I>>) and allowed you -to set a description using the <TT>description</TT> key. If you want -your document to remain like this, you can redefine <TT>\newacronym</TT> -as follows: -<PRE> -\renewcommand{\newacronym}[4][]{% -\newglossaryentry{#2}{type=\acronymtype, -name={#4 (#3)}, -text={#3}, -first={#4 (#3)}, -plural={#3s}, -firstplural={#4s (#3s)},#1}} -</PRE> -The <TT>description</TT> key will then need to be entered using the -optional argument. +to set a description using the <TT>description</TT> key. If you +still want to do this, you can use the <TT>description</TT> package +option, and use the <TT>description</TT> key in the +optional argument of <TT>\newacronym</TT>. <P> For example, if your document originally had the following: @@ -504,8 +503,12 @@ For example, if your document originally had the following: \newacronym{SVM}{Support Vector Machine}{description=Statistical pattern recognition technique} </PRE> -Then you would need to redefine <TT>\newacronym</TT> as shown above, -and change the above to: +Then you would need to load the <TT>glossaries</TT> package using the +<TT>description</TT> package option, for example: +<PRE> +\usepackage[description]{glossaries} +</PRE> +and change the acronym definition to: <PRE> \newacronym[description=Statistical pattern recognition technique]{svm}{SVM}{Support Vector Machine} @@ -515,6 +518,39 @@ You will also need to replace all occurrences of <TT>\SVM</TT> with <PRE> \newcommand{\SVM}{\gls{svm}} </PRE> +Remember that generally LaTeX ignores all spaces following command +names that consist of a backslash followed by letters! For example, +using the above definition of <TT>\SVM</TT>, the following will ignore +the space after <TT>\SVM</TT>: +<PRE> +The \SVM is a statistical pattern recognition technique. +</PRE> +Instead, you need to explicitly insert a space: +<PRE> +The \SVM\ is a statistical pattern recognition technique. +</PRE> +However, <code>\SVM['s]</code> is equivalent to <code>\gls{svm}['s]</code>, +so you can do, for example: +<PRE> +The \SVM['s] parameters are obtained via optimisation techniques. +</PRE> + +<P> +The <TT>xspace</TT> package provides the command <TT>\xspace</TT> which can +be used to insert a space after the command name if required. Some +people prefer to use this at the end of the command definition so +that they don't need to remember to insert an explicit space. +For example, if we use the <TT>xspace</TT> package, we could define +<TT>\SVM</TT> as follows: +<PRE> +\newcommand{\SVM}{\gls{svm}\xspace} +</PRE> +so now the following will have a space before the word "is": +<PRE> +The \SVM is a statistical pattern recognition technique. +</PRE> +However, you can no longer do <code>\SVM['s]</code>, as the <TT>\xspace</TT> is +now in the way. <P> If you have used <TT>\useacronym</TT> instead of <TT>\</TT><<I>acr-name</I>>, @@ -542,7 +578,9 @@ be replaced with <TT>\Gls{<<I>label</I>>}</TT>. In the <TT>glossary</TT> package, it is possible to produce the long and short forms of an acronym without adding an entry to the glossary using <TT>\acrln</TT> and <TT>\acrsh</TT>. With the -<TT>glossaries</TT> package, you can replace +<TT>glossaries</TT> package (provided you defined the acronym using +<TT>\newacronym</TT> and provided you haven't redefined <TT>\newacronym</TT>) +you can replace <P> <TT><TT>\acrsh{<<I>acr-name</I>>}</TT></TT> @@ -550,44 +588,26 @@ the glossary using <TT>\acrln</TT> and <TT>\acrsh</TT>. With the with <P> -<TT><TT>\glsentrytext{<<I>label</I>>}</TT></TT> +<TT><TT>\acrshort{<<I>label</I>>}</TT></TT> <P> -However the <TT>glossaries</TT> package provides no direct equivalent -of <TT>\acrln</TT>. Instead it provides <TT>\glsentryfirst</TT> which -produces the ``first use'' text without adding an entry to the -glossary, or affecting the first use flag. +and you can replace <P> -Alternatively, if you haven't changed the definition of -<TT>\newacronym</TT>, the long form by itself can be obtained using -<TT>\glsentrydesc</TT>, since by default the <TT>description</TT> key is -set to the long form (but read the notes in the <TT>glossaries</TT> -manual regarding the <TT>sanitize</TT> package option). +<TT><TT>\acrln{<<I>acr-name</I>>}</TT></TT> +<P> +with <P> -If you want to be able to set a description, and be able to -independently access the description, the long form and the -short form, you can redefine <TT>\newacronym</TT> so that it uses -the <TT>symbol</TT> key and use <TT>\defglsdisplayfirst</TT> -so that it uses this value on first use, as follows: -<PRE> -\renewcommand{\newacronym}[4][]{\newglossaryentry{#2}{% -name={#4 (#3)}, -text={#3}, -first={#4}, -symbol={#3}, -}} -\defglsdisplayfirst{\acronymtype}{##1 (##3)##4} -</PRE> -As before, you can access the short name via -<TT>\glsentrytext{<<I>label</I>>}</TT>, but you can now access just the long -form via <TT>\glsentryfirst{<<I>label</I>>}</TT> and the description via -<TT>\glsentrydesc{<<I>label</I>>}</TT>. +<TT><TT>\acrlong{<<I>label</I>>}</TT></TT> +<P> +The <TT>glossaries</TT> package also provides the related commands +<TT>\acrshortpl</TT> (plural short form) and <TT>\acrlongpl</TT> (plural long +form) as well as upper case variations. <P> See -the section ``Using -glossary entries in the text'' of the <TT>glossaries</TT> +the section "Using +glossary entries in the text" of the <TT>glossaries</TT> manual for further details of how to use these commands. <P> @@ -726,16 +746,28 @@ you will need to use the <TT>makeglossaries</TT> Perl script instead. <P> + +<H1><A NAME="SECTION000100000000000000000"> +9 Troubleshooting</A> +</H1> + +<P> +Please check the <A NAME="tex2html5" + HREF="http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/glossariesfaq.html">FAQ</A> +for the <TT>glossaries</TT> package if you have any +problems. + +<P> <BR><HR><H4>Footnotes</H4> <DL> -<DT><A NAME="foot464">... -available</A><A +<DT><A NAME="foot504">... +available.</A><A HREF="glossary2glossaries.html#tex2html2"><SUP>1</SUP></A></DT> <DD>mainly because having a key value list in <TT>\glossary</TT> caused problems, but it also helps consistency. </DD> -<DT><A NAME="foot469">... directly.</A><A +<DT><A NAME="foot511">... directly.</A><A HREF="glossary2glossaries.html#tex2html3"><SUP>2</SUP></A></DT> <DD>This is because <TT>\glossary</TT> requires the argument to be in a specific format and doesn't use the @@ -747,7 +779,7 @@ recommended. If you persist in using <TT>\glossary</TT> with the new package, don't complain if things go wrong! </DD> -<DT><A NAME="foot470">... +<DT><A NAME="foot512">... benefits!</A><A HREF="glossary2glossaries.html#tex2html4"><SUP>3</SUP></A></DT> <DD>From the user's point of view, using <TT>\glossary</TT> |