diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/glossaries/expl/glossaries-accsupp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/glossaries/expl/glossaries-accsupp.sty | 233 |
1 files changed, 216 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/glossaries/expl/glossaries-accsupp.sty b/Master/texmf-dist/tex/latex/glossaries/expl/glossaries-accsupp.sty index 4388301741e..574678f709a 100644 --- a/Master/texmf-dist/tex/latex/glossaries/expl/glossaries-accsupp.sty +++ b/Master/texmf-dist/tex/latex/glossaries/expl/glossaries-accsupp.sty @@ -7,7 +7,7 @@ %% glossaries.dtx (with options: `glossaries-accsupp.sty,package') %% %% glossaries.dtx -%% Copyright 2010 Nicola Talbot +%% Copyright 2011 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-custom-acronym.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy.tex, samplexdy-mc.xdy, database1.tex, database2.tex, glossaries.perl. +%% This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl. %% %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -39,7 +39,8 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-accsupp}[2009/11/02 v0.2 (NLCT)] +\ProvidesPackage{glossaries-accsupp}[2011/04/02 v3.0 (NLCT) + Experimental glossaries accessibility] \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} \ProcessOptions \RequirePackage{glossaries} @@ -71,6 +72,18 @@ \define@key{glossentry}{descriptionpluralaccess}{% \def\@glo@descpluralaccess{#1}% } +\define@key{glossentry}{shortaccess}{% + \def\@glo@shortaccess{#1}% +} +\define@key{glossentry}{shortpluralaccess}{% + \def\@glo@shortpluralaccess{#1}% +} +\define@key{glossentry}{longaccess}{% + \def\@glo@longaccess{#1}% +} +\define@key{glossentry}{longpluralaccess}{% + \def\@glo@longpluralaccess{#1}% +} \def\@gls@noaccess{\relax} \let\@gls@oldnewglossaryentryprehook\@newglossaryentryprehook \renewcommand*{\@newglossaryentryprehook}{% @@ -84,6 +97,10 @@ \def\@glo@symbolpluralaccess{\@glo@symbolaccess}% \def\@glo@descaccess{\relax}% \def\@glo@descpluralaccess{\@glo@descaccess}% + \def\@glo@shortaccess{\relax}% + \def\@glo@shortpluralaccess{\@glo@shortaccess}% + \def\@glo@longaccess{\relax}% + \def\@glo@longpluralaccess{\@glo@longaccess}% } \let\@gls@oldnewglossaryentryposthook\@newglossaryentryposthook \renewcommand*{\@newglossaryentryposthook}{% @@ -115,6 +132,18 @@ \expandafter \protected@xdef\csname glo@\@glo@label @descpluralaccess\endcsname{% \@glo@descpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortaccess\endcsname{% + \@glo@shortaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @shortpluralaccess\endcsname{% + \@glo@shortpluralaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longaccess\endcsname{% + \@glo@longaccess}% + \expandafter + \protected@xdef\csname glo@\@glo@label @longpluralaccess\endcsname{% + \@glo@longpluralaccess}% } \newcommand*{\glsentryaccess}[1]{% \csname glo@#1@access\endcsname @@ -143,6 +172,18 @@ \newcommand*{\glsentrydescpluralaccess}[1]{% \csname glo@#1@descaccess\endcsname } +\newcommand*{\glsentryshortaccess}[1]{% + \csname glo@#1@shortaccess\endcsname +} +\newcommand*{\glsentryshortpluralaccess}[1]{% + \csname glo@#1@shortpluralaccess\endcsname +} +\newcommand*{\glsentrylongaccess}[1]{% + \csname glo@#1@longaccess\endcsname +} +\newcommand*{\glsentrylongpluralaccess}[1]{% + \csname glo@#1@longpluralaccess\endcsname +} \newcommand*{\glsaccsupp}[2]{% \BeginAccSupp{ActualText=#1}#2\EndAccSupp{}% } @@ -222,6 +263,38 @@ \xglsaccsupp{\@glo@access}{#1}% \fi } +\DeclareRobustCommand*{\glsshortaccessdisplay}[2]{% + \protected@edef\@glo@access{\glsentryshortaccess{#2}}% + \ifx\@glo@access\@gls@noaccess + #1% + \else + \xglsaccsupp{\@glo@access}{#1}% + \fi +} +\DeclareRobustCommand*{\glsshortpluralaccessdisplay}[2]{% + \protected@edef\@glo@access{\glsentryshortpluralaccess{#2}}% + \ifx\@glo@access\@gls@noaccess + #1% + \else + \xglsaccsupp{\@glo@access}{#1}% + \fi +} +\DeclareRobustCommand*{\glslongaccessdisplay}[2]{% + \protected@edef\@glo@access{\glsentrylongaccess{#2}}% + \ifx\@glo@access\@gls@noaccess + #1% + \else + \xglsaccsupp{\@glo@access}{#1}% + \fi +} +\DeclareRobustCommand*{\glslongpluralaccessdisplay}[2]{% + \protected@edef\@glo@access{\glsentrylongpluralaccess{#2}}% + \ifx\@glo@access\@gls@noaccess + #1% + \else + \xglsaccsupp{\@glo@access}{#1}% + \fi +} \DeclareRobustCommand*{\glsaccessdisplay}[3]{% \@ifundefined{gls#1accessdisplay}% {% @@ -463,6 +536,66 @@ \glsunset{#2}% }% } +\def\@acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% + \def\@glo@text{% + \glsshortaccessdisplay{\glsentryshort{#2}}{#2}% + }% + \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}% + }% +} +\def\@Acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% + \def\@glo@text{% + \glsshortaccessdisplay{\Glsentryshort{#2}}{#2}% + }% + \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}% + }% +} +\def\@ACRshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% + \def\@glo@text{% + \glsshortaccessdisplay{\MakeUppercase{\glsentryshort{#2}}}{#2}% + }% + \@gls@link[#1]{#2}{\acronymfont{\@glo@text#3}}% + }% +} +\def\@acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% + \def\@glo@text{% + \glslongaccessdisplay{\glsentrylong{#2}}{#2}% + }% + \@gls@link[#1]{#2}{\@glo@text#3}% + }% +} +\def\@Acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% + \def\@glo@text{% + \glslongaccessdisplay{\Glsentrylong{#2}}{#2}% + }% + \@gls@link[#1]{#2}{\@glo@text#3}% + }% +} +\def\@ACRlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% + \def\@glo@text{% + \glslongaccessdisplay{\MakeUppercase{\glsentrylong{#2}}}{#2}% + }% + \@gls@link[#1]{#2}{\@glo@text#3}% + }% +} \ifglsxindy \renewcommand*{\@glossaryentryfield}{% \string\\accsuppglossaryentryfield} @@ -490,7 +623,7 @@ {\glssymbolaccessdisplay{#5}{#2}}{#6}% } \renewcommand*{\newacronymhook}{% - \edef\@gls@keylist{\glsshortkey access=\the\glslongtok,% + \edef\@gls@keylist{shortaccess=\the\glslongtok,% \the\glskeylisttok}% \expandafter\glskeylisttok\expandafter{\@gls@keylist}% } @@ -503,21 +636,26 @@ description={\the\glslongtok},% descriptionaccess=\relax, text={\the\glsshorttok},% - textaccess={\the\glslongtok},% access={\noexpand\@glo@textaccess},% sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\the\glslongtok},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% - firstaccess=\relax, - first={\noexpand\glsdescriptionaccessdisplay + first={\noexpand\glslongaccessdisplay {\the\glslongtok}{\the\glslabeltok}\space - (\noexpand\glstextaccessdisplay + (\noexpand\glsshortaccessdisplay {\the\glsshorttok}{\the\glslabeltok})},% plural={\the\glsshorttok\acrpluralsuffix},% - firstplural={\noexpand\glsdescriptionpluralaccessdisplay - {\noexpand\@glo@descplural}{\the\glslabeltok}\space - (\noexpand\glspluralaccessdisplay - {\noexpand\@glo@plural}{\the\glslabeltok})},% + firstplural={\noexpand\glslongpluralaccessdisplay + {\noexpand\@glo@longpl}{\the\glslabeltok}\space + (\noexpand\glsshortpluralaccessdisplay + {\noexpand\@glo@shortpl}{\the\glslabeltok})},% + firstaccess=\relax, firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% \the\glskeylisttok }% }% @@ -531,11 +669,17 @@ name={\noexpand\acronymfont{\the\glsshorttok}},% sort={\the\glsshorttok},% text={\the\glsshorttok},% - textaccess={\the\glslongtok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\the\glslongtok},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% access={\noexpand\@glo@textaccess},% plural={\the\glsshorttok\noexpand\acrpluralsuffix},% symbol={\the\glslongtok},% symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},% + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% \the\glskeylisttok }% }% @@ -550,6 +694,11 @@ \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% access={\noexpand\@glo@textaccess},% sort={\the\glsshorttok},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\the\glslongtok},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% first={\the\glslongtok},% firstaccess=\relax, firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% @@ -559,6 +708,8 @@ symbol={\noexpand\@glo@text},% symbolaccess={\noexpand\@glo@textaccess},% symbolplural={\noexpand\@glo@plural},% + firstpluralaccess=\relax, + textaccess={\noexpand\@glo@shortaccess},% \the\glskeylisttok}% }% \@do@newglossaryentry @@ -569,11 +720,15 @@ {% type=\acronymtype,% name={\noexpand\acronymfont{\the\glsshorttok}},% - access={\noexpand\@glo@textaccess},% sort={\the\glsshorttok},% text={\the\glsshorttok},% textaccess={\the\glslongtok},% + access={\noexpand\@glo@textaccess},% plural={\the\glsshorttok\noexpand\acrpluralsuffix},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% description={\the\glslongtok},% descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% \the\glskeylisttok @@ -589,9 +744,14 @@ name={\noexpand\acronymfont{\the\glsshorttok}},% access={\noexpand\@glo@symbolaccess},% sort={\the\glsshorttok},% - text={\noexpand\@glo@symbol},% - textaccess={\noexpand\@glo@symbolaccess},% - plural={\noexpand\@glo@symbolplural},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + shortaccess={\the\glslongtok},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + text={\noexpand\@glo@short},% + textaccess={\noexpand\@glo@shortaccess},% + plural={\noexpand\@glo@shortpl},% first={\the\glslongtok},% firstaccess=\relax, firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% @@ -609,6 +769,45 @@ \newcommand*{\glsshortpluralaccesskey}{\glsshortpluralkey access}% \newcommand*{\glslongaccesskey}{\glslongkey access}% \newcommand*{\glslongpluralaccesskey}{\glslongpluralkey access}% +\newcommand*{\showglonameaccess}[1]{% + \expandafter\show\csname glo@#1@textaccess\endcsname +} +\newcommand*{\showglotextaccess}[1]{% + \expandafter\show\csname glo@#1@textaccess\endcsname +} +\newcommand*{\showglopluralaccess}[1]{% + \expandafter\show\csname glo@#1@pluralaccess\endcsname +} +\newcommand*{\showglofirstaccess}[1]{% + \expandafter\show\csname glo@#1@firstaccess\endcsname +} +\newcommand*{\showglofirstpluralaccess}[1]{% + \expandafter\show\csname glo@#1@firstpluralaccess\endcsname +} +\newcommand*{\showglosymbolaccess}[1]{% + \expandafter\show\csname glo@#1@symbolaccess\endcsname +} +\newcommand*{\showglosymbolpluralaccess}[1]{% + \expandafter\show\csname glo@#1@symbolpluralaccess\endcsname +} +\newcommand*{\showglodescaccess}[1]{% + \expandafter\show\csname glo@#1@descaccess\endcsname +} +\newcommand*{\showglodescpluralaccess}[1]{% + \expandafter\show\csname glo@#1@descpluralaccess\endcsname +} +\newcommand*{\showgloshortaccess}[1]{% + \expandafter\show\csname glo@#1@shortaccess\endcsname +} +\newcommand*{\showgloshortpluralaccess}[1]{% + \expandafter\show\csname glo@#1@shortpluralaccess\endcsname +} +\newcommand*{\showglolongaccess}[1]{% + \expandafter\show\csname glo@#1@longaccess\endcsname +} +\newcommand*{\showglolongpluralaccess}[1]{% + \expandafter\show\csname glo@#1@longpluralaccess\endcsname +} \endinput %% %% End of file `glossaries-accsupp.sty'. |