diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/tracklang/tracklang-manual.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/tracklang/tracklang-manual.tex | 158 |
1 files changed, 153 insertions, 5 deletions
diff --git a/Master/texmf-dist/doc/generic/tracklang/tracklang-manual.tex b/Master/texmf-dist/doc/generic/tracklang/tracklang-manual.tex index e2ffd82a34c..21b1549baca 100644 --- a/Master/texmf-dist/doc/generic/tracklang/tracklang-manual.tex +++ b/Master/texmf-dist/doc/generic/tracklang/tracklang-manual.tex @@ -205,6 +205,14 @@ \meta{dialect-label} has been tracked, otherwise does \meta{false}} } + % \AnyTrackedRegions + \gcmd{Any\-Track\-ed\-Regions} + { + \providedby{\file{tracklang.tex} v1.6.3+} + \syntax{\margm{true}\margm{false}} + \desc{expands to \meta{true} if there are any tracked regions, + otherwise expands to \meta{false}} + } % \IfTrackedLanguageFileExists \gcmd{If\-Track\-ed\-Lan\-guage\-File\-Exists} { @@ -217,6 +225,37 @@ code}\margm{false code}} \gls{CurrentTrackedTag} is set to \meta{tag} and \meta{true} is done, otherwise \meta{false} is done} } + % \IfTrackedLanguageFileExistsOmitDialectLabel + \gcmd{If\-Track\-ed\-Lan\-guage\-File\-Exists\-Omit\-Dialect\-Label} + { + \providedby{\file{tracklang.tex} v1.6.3+} + \syntax{\margm{dialect}\margm{prefix}\margm{suffix}\margm{true +code}\margm{false code}} + \desc{as \gls{IfTrackedLanguageFileExists} but skips the dialect +label check. Note that if the dialect label happens to be the same +as the root label, it will still be checked but at the end instead +of near the start} + } + % \IfTrackedLanguageFileExistsOmitDialectLabelOmitOnlyRegion + \gcmd{If\-Track\-ed\-Lan\-guage\-File\-Exists\-Omit\-Dialect\-Label\-Omit\-Only\-Region} + { + \providedby{\file{tracklang.tex} v1.6.3+} + \syntax{\margm{dialect}\margm{prefix}\margm{suffix}\margm{true +code}\margm{false code}} + \desc{as \gls{IfTrackedLanguageFileExists} but skips the dialect +label check and just the region code check. Note that if the +dialect label happens to be the same as the root label, it will +still be checked but at the end instead of near the start} + } + % \IfTrackedLanguageFileExistsOmitOnlyRegion + \gcmd{If\-Track\-ed\-Lan\-guage\-File\-Exists\-Omit\-Only\-Region} + { + \providedby{\file{tracklang.tex} v1.6.3+} + \syntax{\margm{dialect}\margm{prefix}\margm{suffix}\margm{true +code}\margm{false code}} + \desc{as \gls{IfTrackedLanguageFileExists} but skips the solo + region code check} + } % \CurrentTrackedTag \gcmd{Current\-Track\-ed\-Tag} { @@ -333,6 +372,15 @@ verbose messages} iteration \meta{cs} is set to the dialect tag and \meta{body} is performed} } + % \ForEachTrackedRegion + \gcmd{For\-Each\-Track\-ed\-Region} + { + \providedby{\file{tracklang.tex} v1.0+} + \syntax{\margm{cs}\margm{body}} + \desc{iterates through the list of tracked regions. On each + iteration \meta{cs} is set to the region code and \meta{body} is + performed} + } % \TrackLangNewLanguage \gcmd{Track\-Lang\-New\-Lan\-guage} { @@ -981,7 +1029,32 @@ if the file doesn't exist} { \providedby{\file{tracklang.tex} v1.3+} \syntax{\oargm{load code}\margm{pkgname}\margm{dialect}} - \desc{loads the dialect for the given package} + \desc{loads the dialect for the given package using + \gls{IfTrackedLanguageFileExists}} + } + % \TrackLangRequireDialectOmitDialectLabel + \gcmd{Track\-Lang\-Require\-Di\-alect\-Omit\-Di\-alect\-Label} + { + \providedby{\file{tracklang.tex} v1.3+} + \syntax{\oargm{load code}\margm{pkgname}\margm{dialect}} + \desc{loads the dialect for the given package using + \gls{IfTrackedLanguageFileExistsOmitDialectLabel}} + } + % \TrackLangRequireDialectOmitDialectLabelOmitOnlyRegion + \gcmd{Track\-Lang\-Require\-Di\-alect\-Omit\-Di\-alect\-Label\-Omit\-Only\-Region} + { + \providedby{\file{tracklang.tex} v1.3+} + \syntax{\oargm{load code}\margm{pkgname}\margm{dialect}} + \desc{loads the dialect for the given package using + \gls{IfTrackedLanguageFileExistsOmitDialectLabelOmitOnlyRegion}} + } + % \TrackLangRequireDialectOmitOnlyRegion + \gcmd{Track\-Lang\-Require\-Di\-alect\-Omit\-Only\-Region} + { + \providedby{\file{tracklang.tex} v1.3+} + \syntax{\oargm{load code}\margm{pkgname}\margm{dialect}} + \desc{loads the dialect for the given package using + \gls{IfTrackedLanguageFileExistsOmitOnlyRegion}} } % \TrackLangRequireDialectPrefix \gcmd{Track\-Lang\-Require\-Di\-alect\-Prefix} @@ -1177,6 +1250,29 @@ given \meta{alpha-3 code}, otherwise expands to \meta{false}} \providedby{\file{tracklang-scripts.tex} v1.3+} \desc{set by \gls{TrackLangScriptMap} to the associated alpha code \meta{Code}} } + % PACKAGE OPTIONS: + \gstyopt{verbose} + { + \providedby{\sty{tracklang} v1.6.3+} + \desc{switches on verbose setting} + } + \gstyopt{noverbose} + { + \providedby{\sty{tracklang} v1.6.3+} + \desc{switches off verbose setting (default)} + } + \gstyopt{isotag} + { + \name{\styoptfmt{\meta{iso-tag}}} + \desc{Any ISO tag listed in \tableref{tab:isoopts} may be used +as a package option} + } + \gstyopt{dialect} + { + \name{\styoptfmt{\meta{dialect}}} + \desc{Any dialect label listed in \tableref{tab:isoopts} may be used +as a package option} + } % FILES \gfile{track\-lang.tex}{}% tracklang.tex \gfile{track\-lang.sty}% tracklang.sty @@ -1528,6 +1624,7 @@ given \meta{alpha-3 code}, otherwise expands to \meta{false}} \grootlangtag{samoan}{sm}{} \grootlangtag{sango}{sg}{} \grootlangtagwithreg{sardinian}{sc}{IT}{} + \grootlangtag{scots}{sco}{} \grootlangtag{scottish}{gd}{} \grootlangtag{serbian}{sr}{} \grootlangtag{shona}{sn}{} @@ -2123,12 +2220,12 @@ given \meta{alpha-3 code}, otherwise expands to \meta{false}} \gscript{Zzzz}{999}{Uncoded script}{varies}{}{} } -\title{tracklang.sty v1.6.2: +\title{tracklang.sty v1.6.3: tracking language options} \author{Nicola L.C. Talbot\\[10pt] Dickimaw Books\\ \href{https://www.dickimaw-books.com/}{\nolinkurl{dickimaw-books.com}}} -\date{2025-01-14 +\date{2025-01-22 } \newcommand{\refoptstables}{\tablesref{tab:isoopts,tab:rootlangopts,tab:nonisoopts}} @@ -2830,6 +2927,12 @@ the \file{tracklang.sty} package can pick up document class options and add them to \sty{tracklang}'s internal list of tracked document languages. +As from version 1.6.3, the \LaTeX\ package also has options +\inlineoptdef{verbose} and \inlineoptdef{noverbose} to switch +on and off verbose mode. This means that these options can be picked +up if they are used as document class options or passed to +\sty{tracklang} before it's first loaded. + If you're not using \LaTeX, this option isn't available although you can redefine \gls{@tracklang@declareoption} @@ -3494,6 +3597,11 @@ tracked otherwise it will do \meta{false}. (Each detected dialect will automatically have the root language label added to the tracked language list, if it's not already present.) +You can check whether or not any regions have been detected using: +\cmddef{AnyTrackedRegions} +This will do \meta{true} if one or more regions have been +tracked otherwise it will do \meta{false}. + If you want to find out if any of the tracked dialects matches a particular language tag, you can use: \cmddef{GetTrackedDialectFromLanguageTag} @@ -3567,6 +3675,9 @@ You can iterate through each tracked language using: At the start of each iteration, this sets the control sequence \meta{cs} to the tracked language and does \meta{body}. +You can iterate through each tracked region using: +\cmddef{ForEachTrackedRegion} + The above for-loops use the same internal mechanism as \LaTeX's \gls{@for} loop. Since this isn't defined by \TeX, a similar command (\inlineglsdef{@tracklang@for}) will be defined that works in the same way. @@ -3895,6 +4006,26 @@ has been detected, but no file can be found, then \gls{CurrentTrackedTag} is set to the final attempt at determining \meta{localeid}. +Sometimes the dialect label can cause a problem, especially if it +happens to be identical to the root label. The solo region code +check may also be problematic, so the following analoguous commands are +also provided. + +\cmddef{IfTrackedLanguageFileExistsOmitDialectLabel} +As \gls{IfTrackedLanguageFileExists} but omits the test for the +dialect label. Note that if the dialect label happens to be +identical to the root language label, it will still be checked, but +at the very end instead of near the start. + +\cmddef{IfTrackedLanguageFileExistsOmitOnlyRegion} +As \gls{IfTrackedLanguageFileExists} but omits the test for just the +region code. + +\cmddef{IfTrackedLanguageFileExistsOmitDialectLabelOmitOnlyRegion} +Combination of the above two commands. +As \gls{IfTrackedLanguageFileExists} but omits the tests for the +dialect label and for just the region code. + There's a convenient shortcut command new to version 1.3: \cmddef{TrackLangRequireDialect} which uses \gls{IfTrackedLanguageFileExists} to input the resource @@ -3909,6 +4040,18 @@ to \meta{pkgname}, which allows the prefix to be picked up by resource file commands, such as \gls{TrackLangProvidesResource} and \gls{TrackLangRequireResource}. (See below.) +There are analogous commands +\cmddef{TrackLangRequireDialectOmitDialectLabel} +As above, but uses \gls{IfTrackedLanguageFileExistsOmitDialectLabel}. + +\cmddef{TrackLangRequireDialectOmitDialectLabelOmitOnlyRegion} +As above, but uses +\gls{IfTrackedLanguageFileExistsOmitDialectLabelOmitOnlyRegion}. + +\cmddef{TrackLangRequireDialectOmitOnlyRegion} +As above, but uses +\gls{IfTrackedLanguageFileExistsOmitOnlyRegion}. + The optional argument \meta{load code} is the code that actually inputs the required file. This defaults to \begin{codebox} @@ -4002,6 +4145,8 @@ that item is skipped. \item \meta{localeid} is just the value of \gls{CurrentTrackedLanguageTag}. \item \meta{localeid} is just the dialect label. +This step is omitted with \gls{IfTrackedLanguageFileExistsOmitDialectLabel} +and \gls{IfTrackedLanguageFileExistsOmitDialectLabelOmitOnlyRegion}. \item \meta{localeid} is \meta{ISO~639-1}\code{-}\meta{sublang}\code{-}\meta{script}\code{-}\meta{region}. @@ -4069,6 +4214,9 @@ the script is the default for the given language). \item \meta{localeid} is just \meta{ISO~639-3}. \item \meta{localeid} is just \meta{region}. +This step is omitted with +\gls{IfTrackedLanguageFileExistsOmitOnlyRegion} +and \gls{IfTrackedLanguageFileExistsOmitDialectLabelOmitOnlyRegion}. \item \meta{localeid} is \meta{ISO~639-1}\code{-}\meta{sublang}\code{-}\meta{variant} @@ -4296,13 +4444,13 @@ has been defined, you can use: This will expand to \code{utf8} if \gls{inputencodingname} hasn't been defined, otherwise it will expand to \gls{inputencodingname}. For example: -\begin{codebox} +\begin{codebox*} \gls{InputIfFileExists}\marg{foo-\gls{TrackLangEncodingName}.ldf} \marg{\comment{support available for the document encoding} } \marg{\comment{no support for the document encoding} } -\end{codebox} +\end{codebox*} If you require the resource file and want to perform \meta{code1} if it's loaded at this point or \meta{code2} if it's |