Skip to content

Instantly share code, notes, and snippets.

@Arth-ur
Created May 22, 2017 21:08
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 Arth-ur/c8f9f85e6563538dd89928d0f799b2d2 to your computer and use it in GitHub Desktop.
Save Arth-ur/c8f9f85e6563538dd89928d0f799b2d2 to your computer and use it in GitHub Desktop.
\makeatletter
\newcommand{\get}[1]{%
\@ifundefined{lookup@#1}{%
\PackageError{lookup}{No #1 key in lookup}{%
Key #1 was not found in lookup. %
You can insert it with \string\lookupPut{key}{value}.%
}%
}{%
\@nameuse{lookup@#1}%
}%
}
\newcommand{\@lookupPut}[2]{%
\@namedef{lookup@#1}{#2}%
}
\makeatother
\newcommand{\applysignrule}[1]{%
\StrSubstitute{#1}{+-}{-}%
}
%% Usage: \get{example.value1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment