Skip to content

Instantly share code, notes, and snippets.

@9999years
Created April 6, 2017 16:41
Show Gist options
  • Save 9999years/87f9c603be356de3156c48d7d5bb3ecc to your computer and use it in GitHub Desktop.
Save 9999years/87f9c603be356de3156c48d7d5bb3ecc to your computer and use it in GitHub Desktop.
% usage: \unicode[font]{codepoint}, e.g. \unicode[\emojifont]{1F60E} or \unicode{1F47D}
% requires --shell-escape be enabled (to use \write18) and curl to be in the path
% prints something like U+XXXX § SECTION SIGN
% note that the codepoint MUST be in all-caps, due to how \symbol works
\newcommand{\unicode}[2][]
{\immediate\write18{curl https://codepoints.net/api/v1/name/#2 -o .cp#2.txt}
\texttt{U+#2} {#1\symbol{"#2}}
\texttt{\input{.cp#2.txt}}\immediate\write18{del .cp#2.txt}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment