Skip to content

Instantly share code, notes, and snippets.

@vermiculus
Last active April 18, 2016 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vermiculus/178fcf77764e53fdf3c0cde73779e4c5 to your computer and use it in GitHub Desktop.
Save vermiculus/178fcf77764e53fdf3c0cde73779e4c5 to your computer and use it in GitHub Desktop.
\cs_new_protected:Npn \__npkg_package:nnn #1#2#3
{
\texorpdfstring
{
\bool_if:nTF {#1}
{ \__npkg_package_format:n {#3} }
{ \href {#2} { \__npkg_package_format:n {#3} } }
}
{#3}
}
\cs_new_protected:Npn \__npkg_package:nn #1#2
{ \__npkg_package:nnn {#1} { \c__npkg_standard_url_str #2 } {#2} }
\NewDocumentCommand {\package} {sO{}m}
{
\IfValueTF {#2} { \__npkg_package:nnn {#1} {#2} {#3} }
{ \__npkg_package:nn {#1} {#3} }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment