From 7f3c84d5d08d7a3c4047e31edfb3164ef787de97 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 24 May 2018 21:35:50 +0000 Subject: glossaries-extra (24may18) git-svn-id: svn://tug.org/texlive/trunk@47827 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/glossaries-extra/glossaries-extra.dtx | 158 +++++++++++++++++++-- .../latex/glossaries-extra/glossaries-extra.ins | 2 +- 2 files changed, 145 insertions(+), 15 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx index 6a62b1dee1e..024b3581036 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx @@ -1,23 +1,23 @@ %\iffalse % glossaries-extra.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: +% -doc "glossaries-extra-codedoc.tex" % -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})" -% -comment ".*\.tex" -% -comment ".*\.bib" -% -setambles ".*\.bib=>\nopreamble\nopostamble" -% -author "Nicola Talbot" % -src "glossaries-extra.sty\Z=>glossaries-extra.sty" % -src "glossaries-extra-bib2gls.sty\Z=>glossaries-extra-bib2gls.sty" % -src "glossaries-extra-stylemods.sty\Z=>glossaries-extra-stylemods.sty" % -src "glossary-bookindex.sty\Z=>glossary-bookindex.sty" % -src "(example-glossaries-.+\.tex)\Z=>\1" % -src "(example-glossaries-.+\.bib)\Z=>\1" +% -author "Nicola Talbot" +% -section "chapter" % -macrocode ".*\.tex" % -macrocode ".*\.bib" -% -doc "glossaries-extra-codedoc.tex" -% -section "chapter" +% -setambles ".*\.bib=>\nopreamble\nopostamble" +% -comment ".*\.tex" +% -comment ".*\.bib" % glossaries-extra -% Created on 2018/5/9 22:46 +% Created on 2018/5/24 12:13 %\fi %\iffalse %<*package> @@ -127,7 +127,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{23123} +\CheckSum{23192} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -167,13 +167,13 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \raggedright } -\title{glossaries-extra.sty v1.31: +\title{glossaries-extra.sty v1.32: documented code} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \url{http://www.dickimaw-books.com/}} -\date{2018-05-09} +\date{2018-05-24} \begin{document} \DocInput{glossaries-extra.dtx} @@ -218,7 +218,7 @@ Dickimaw Books\\ %\section{Package Initialisation and Options} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra}[2018/05/09 v1.31 (NLCT)] +\ProvidesPackage{glossaries-extra}[2018/05/24 v1.32 (NLCT)] % \end{macrocode} % Requires \sty{xkeyval} to define package options. % \begin{macrocode} @@ -2467,6 +2467,136 @@ Dickimaw Books\\ % \end{macrocode} %\end{macro} % +%\begin{macro}{\GlsXtrForeignText} +%\changes{1.32}{2018-05-24}{new} +%\begin{definition} +%\cs{GlsXtrForeignText}\marg{entry label}\marg{text} +%\end{definition} +%If a field is used to store a language tag (such as \texttt{en-GB} +%or \texttt{de-CH-1996}) then this command uses \sty{tracklang}'s +%interface to encapsulate \meta{text}. The field identifying the +%locale is given by \cs{GlsXtrForeignTextField}. +% \begin{macrocode} +\ifdef\foreignlanguage +{ + \ifdef\GetTrackedDialectFromLanguageTag + { + \newcommand{\GlsXtrForeignText}[2]{% +% \end{macrocode} +%In case this is used inside the argument of \cs{glsxtrifhasfield}, +%save and restore \cs{glscurrentfieldvalue}. +% \begin{macrocode} + \let\@glsxtr@org@currentfieldvalue\glscurrentfieldvalue + \glsxtrifhasfield{\GlsXtrForeignTextField}{#1}% + {% + \expandafter\GetTrackedDialectFromLanguageTag\expandafter + {\glscurrentfieldvalue}{\@glsxtr@dialect}% + \let\@glsxtr@locale\glscurrentfieldvalue + \let\glscurrentfieldvalue\@glsxtr@org@currentfieldvalue + \ifdefempty\@glsxtr@dialect + {% +% \end{macrocode} +% An exact match hasn't been found. A partial match can only be +% obtained with at least \sty{tracklang} v1.3.6. +% \begin{macrocode} + \ifundef\TrackedDialectClosestSubMatch + {% + \GlossariesExtraWarning{Can't obtain dialect label + (tracklang v1.3.6+ required)}% + }% + {\let\@glsxtr@dialect\TrackedDialectClosestSubMatch}% + }% + {}% + \ifdefempty\@glsxtr@dialect + {% +% \end{macrocode} +% No tracked dialect found for the root language. +% \begin{macrocode} + }% + {% +% \end{macrocode} +% Check if there's a caption hook for the given dialect label. +% \begin{macrocode} + \ifcsundef{captions\@glsxtr@dialect}{}% + {% +% \end{macrocode} +% Dialect label not recognised. Check if there's a known mapping. +% \begin{macrocode} + \IfTrackedDialectHasMapping{\@glsxtr@dialect}% + {% + \edef\@glsxtr@dialect{% + \GetTrackedDialectToMapping{\@glsxtr@dialect}}% +% \end{macrocode} +% Does a caption hook exist for this? +% \begin{macrocode} + \ifcsundef{captions\@glsxtr@dialect}{}% + {% +% \end{macrocode} +% No mapping. Try root language label instead. +% \begin{macrocode} + \ifcsundef{captions\@tracklang@lang}{}% + {% + \let\@glsxtr@dialect\@tracklang@lang + }% + }% + }% + {% +% \end{macrocode} +% No mapping. Try root language label instead. +% \begin{macrocode} + \ifcsundef{captions\@tracklang@lang}{}% + {% + \let\@glsxtr@dialect\@tracklang@lang + }% + }% + }% + }% + \ifdefempty\@glsxtr@dialect + {% + \GlsXtrUnknownDialectWarning{\@glsxtr@locale}{\@tracklang@lang}% + #2% + }% + {\foreignlanguage{\@glsxtr@dialect}{#2}}% + }% + {#2}% key not set + } + } + { + \newcommand{\GlsXtrForeignText}[2]{% + \GlossariesExtraWarning{Can't encapsulate foreign text: + tracklang v1.3.6+ required}% + #2% + } + } +} +{ +% \end{macrocode} +%\cs{foreignlanguage} isn't defined so just do \meta{text}. +% \begin{macrocode} + \newcommand{\GlsXtrForeignText}[2]{#2} +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrForeignTextField} +%\changes{1.32}{2018-05-24}{new} +%This is the \gloskey{user2} field by default but may be redefined +%as required. +% \begin{macrocode} +\newcommand*{\GlsXtrForeignTextField}{userii} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\GlsXtrUnknownDialectWarning} +%\changes{1.32}{2018-05-24}{new} +% \begin{macrocode} +\newcommand*{\GlsXtrUnknownDialectWarning}[2]{% + \GlossariesExtraWarning{Can't determine valid dialect label + for locale `#1' (root language: #2)}% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsxtrpageref} %\changes{1.11}{2017-01-19}{new} % Like \cs{glsrefentry} but references the page number instead (if @@ -22177,7 +22307,7 @@ defined}{}% %automatically loaded by the record option. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-bib2gls}[2018/05/09 v1.31 (NLCT)] +\ProvidesPackage{glossaries-extra-bib2gls}[2018/05/24 v1.32 (NLCT)] % \end{macrocode} % %These are some convenient macros for use with custom rules. @@ -24554,7 +24684,7 @@ defined}{}% % First identify package: % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-extra-stylemods}[2018/05/09 v1.31 (NLCT)] +\ProvidesPackage{glossaries-extra-stylemods}[2018/05/24 v1.32 (NLCT)] % \end{macrocode} % Provide package options to automatically load required predefined % styles. The simplest method is to just test for the existence of @@ -26729,7 +26859,7 @@ defined}{}% %\section{Package Initialisation and Options} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossary-bookindex}[2018/05/09 v1.31 (NLCT)] +\ProvidesPackage{glossary-bookindex}[2018/05/24 v1.32 (NLCT)] % \end{macrocode} %Load required packages. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins index 3f5f25aa8ef..6a570af9332 100644 --- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins +++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.ins @@ -1,4 +1,4 @@ -% glossaries-extra.ins generated using makedtx version 1.2 2018/5/9 22:46 +% glossaries-extra.ins generated using makedtx version 1.2 2018/5/24 12:13 \input docstrip \preamble -- cgit v1.2.3