diff --git a/siunitx-code.tex b/siunitx-code.tex index f392a617..9560c80a 100644 --- a/siunitx-code.tex +++ b/siunitx-code.tex @@ -49,6 +49,10 @@ \ExplSyntaxOff \NewDocumentCommand\email{m}{\href{mailto:#1}{\nolinkurl{#1}}} \NewDocumentCommand\foreign{m}{\textit{#1}} +\NewDocumentCommand\version{m}{\ensuremath{#1}} +\ExpandArgs{c}\NewDocumentCommand{version (pdfstring context)}{m}{#1} +\pdfstringdefDisableCommands{% + \ExpandArgs{Nc}\DeclareCommandCopy\version{version (pdfstring context)}} % Standard settings \EnableDocumentation diff --git a/siunitx.dtx b/siunitx.dtx index 566d5190..e0c6fb45 100644 --- a/siunitx.dtx +++ b/siunitx.dtx @@ -28,6 +28,10 @@ \documentclass{l3doc} % Additional commands needed in this source \ProvideDocumentCommand\email{m}{\href{mailto:#1}{\nolinkurl{#1}}} +\ProvideDocumentCommand\version{m}{\ensuremath{#1}} +\ExpandArgs{c}\ProvideDocumentCommand{version (pdfstring context)}{m}{#1} +\pdfstringdefDisableCommands{% + \ExpandArgs{Nc}\DeclareCommandCopy\version{version (pdfstring context)}} % The next line is needed so that \GetFileInfo will be able to pick up % version data \usepackage{siunitx}