Skip to content

Commit

Permalink
Add \version support to code part of sources (fixes #764)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Dec 28, 2024
1 parent 9baa4da commit 70c8a5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions siunitx-code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions siunitx.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 70c8a5b

Please sign in to comment.