From c8515063b5d60060d7ea3e27fdf132acdc2231ab Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 23 May 2023 19:48:02 +0000 Subject: templatetools (23may23) git-svn-id: svn://tug.org/texlive/trunk@67198 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/templatetools/templatetools.dtx | 40 ++++++++++++++++------ 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/source/latex/templatetools') diff --git a/Master/texmf-dist/source/latex/templatetools/templatetools.dtx b/Master/texmf-dist/source/latex/templatetools/templatetools.dtx index 7cecc11565c..56c587902e9 100644 --- a/Master/texmf-dist/source/latex/templatetools/templatetools.dtx +++ b/Master/texmf-dist/source/latex/templatetools/templatetools.dtx @@ -2,11 +2,11 @@ % !TeX spellcheck = en-US % % File: templatetools.sty -% Version: 2014/06/27 v0.1 +% Version: 2023/03/26 v0.1 % Author: Matthias Pospiech % Email: % -% Copyright (C) 2014 by Matthias Pospiech +% Copyright (C) 2023 by Matthias Pospiech % --------------------------------------------------------------------------- % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -32,7 +32,7 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{templatetools} %<*package> - [2014/06/27 v0.1 Collection of conditional commands useful inside templates] + [2023/03/26 v0.2 Collection of conditional commands useful inside templates] % % %<*driver> @@ -46,7 +46,7 @@ % \usepackage{lmodern} -\usepackage{templatetools}[2014/06/27] +\usepackage{templatetools}[2023/03/26] \EnableCrossrefs % (default) Every new macro name used within a macrocode or % macrocode∗ environment will produce an index entry. @@ -92,7 +92,8 @@ % Right brace \} Tilde \~} % % -% \changes{v0.1}{2014/06/27}{Converted to DTX file} +% \changes{v0.1}{2017-10-12}{Converted to DTX file} +% \changes{v0.2}{2023/03/26}{Added checking of bib environments} % % \DoNotIndex{\newcommand,\newenvironment} % @@ -358,6 +359,9 @@ text which is considerably longer than the width of the column \\ % \DescribeMacro{\IfGlossariesStyleDefined} % \marg{style name}\marg{is defined} \AfterLastParam % +% \subsection{Bib environments} +% \DescribeMacro{\IfBibEnvironmentDefined} +% \marg{environment name}\marg{is defined} \AfterLastParam % % \subsection{Template Definitions} % The following commands in principle define only macros, but in contrast to @@ -406,12 +410,12 @@ text which is considerably longer than the width of the column \\ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{templatetools} - [2014/06/27 v0.1 Collection of conditional commands useful inside templates] + [2023/03/26 v0.2 Collection of conditional commands useful inside templates] % \end{macrocode} % \begin{macrocode} %%% --- Necessary Packages %%% ------------------------------------------------------------------ -\RequirePackage{ifpdf} +\RequirePackage{iftex} \RequirePackage{etoolbox} \RequirePackage{ltxcmds} \RequirePackage{array} % for column types @@ -544,7 +548,7 @@ text which is considerably longer than the width of the column \\ % \end{macrocode} % \end{macro} % -% \begin{macro}{\IfElsePackageLoaded\} +% \begin{macro}{\IfElsePackageLoaded} % Wrapper to \cs{ltx@ifpackageloaded} % \begin{macrocode} \let\IfElsePackageLoaded\ltx@ifpackageloaded @@ -813,8 +817,24 @@ text which is considerably longer than the width of the column \\ % Thanks to \person{cgnieder} on %\href{http://tex.stackexchange.com/questions/95639/test-if-a-listings-or-glossaries-style-is-valid}{tex.stackexchange.com} % for the help to implement the command. - - +% +% \subsection{BibLaTeX Enivronemnts} +% +% \iffalse +% ------------------------------------------------------------------ +% tests the existens of a bib environment +% ------------------------------------------------------------------ +% \fi +% +% \begin{macro}{\IfBibEnvironmentDefined} +% Checks if a bib environment is defined. +% \begin{macrocode} +\newcommand{\IfBibEnvironmentDefined}[1]{\ifcsdef{blx@env@#1}} +% \end{macrocode} +% \end{macro} +% +% Thanks to \person{egreg} on \href{https://tex.stackexchange.com/questions/451911/check-if-a-bib-environment-is-defined}{tex.stackexchange.com} for the help to implement the command. +% % \subsection{Template definitions} % % \iffalse -- cgit v1.2.3