Create a gist now

Instantly share code, notes, and snippets.

@bgeron /README.md
Last active Feb 12, 2017

What would you like to do?
common-unicode.sty

common-unicode.sty

Want to use Unicode in your LaTeX files? Use this package! (Also, you need to \usepackage[utf8]{inputenc}.)

Comment below, or mail me at myfirstname at myfirstname dot xyz.

-- Bram Geron, 21 April 2016.

FAQ:

Q: What Unicode symbols are available?

A: In order of Unicode codepoint: ¬·×ΓΔΘΛΞΠΣΦΨΩαβγδεζηθικλμνξπρστυφχψωℓ∀∃∅∞∧∨⊒⊕⊗⟨⟩⟪⟫〚〛⇒⊢†…₀₁₂₃₄₅₆₇₈₉↦∈∩∪⋮⋯⋰⋱≠≤≥⊆⊥⋯✓∗

Q: How do I find the Unicode symbol for a LaTeX macro?

A: Try rendering the LaTeX to HTML using MathJax: https://www.mathjax.org/#modal-livedemo . You can probably copy/paste from that.

Q: How can I find the hex for a Unicode symbol, or reversely?

A: In Python3, type something like hex(ord('¬')) or chr(0x00AC).

Q: Why does LaTeX complain about a missing \begin{document} after \DeclareUnicodeCharacter?

A: Because you must write hexadecimal numbers in all-uppercase.

% common-unicode.sty. (c) 2016, Bram Geron. Version 1.0.
% This is a collection of \DeclareUnicodeCharacter macros, so that you can get
% started using many Unicode characters in your LaTeX files as quickly as
% possible. You need to \usepackage[utf8]{inputenc}.
% This .sty file was hacked together quickly, but I thought I would share it
% already.
% You are welcome to use this file according to the CC0 Public Domain
% Dedication, version 1.0 ("CC0 1.0"). You should be able to find more
% information about this licence at <http://creativecommons.org/publicdomain/zero/1.0/>.
\DeclareUnicodeCharacter{00AC}{\ensuremath{\neg}}
\DeclareUnicodeCharacter{00B7}{\ensuremath{\cdot}}
\DeclareUnicodeCharacter{00D7}{\ensuremath{\times}}
\DeclareUnicodeCharacter{0393}{\ensuremath{\Gamma}}
\DeclareUnicodeCharacter{0394}{\ensuremath{\Delta}}
\DeclareUnicodeCharacter{0398}{\ensuremath{\Theta}}
\DeclareUnicodeCharacter{039B}{\ensuremath{\Lambda}}
\DeclareUnicodeCharacter{039E}{\ensuremath{\Xi}}
\DeclareUnicodeCharacter{03A0}{\ensuremath{\Pi}}
\DeclareUnicodeCharacter{03A3}{\ensuremath{\Sigma}}
\DeclareUnicodeCharacter{03A6}{\ensuremath{\Phi}}
\DeclareUnicodeCharacter{03A8}{\ensuremath{\Psi}}
\DeclareUnicodeCharacter{03A9}{\ensuremath{\Omega}}
\DeclareUnicodeCharacter{03B1}{\ensuremath{\alpha}}
\DeclareUnicodeCharacter{03B2}{\ensuremath{\beta}}
\DeclareUnicodeCharacter{03B3}{\ensuremath{\gamma}}
\DeclareUnicodeCharacter{03B4}{\ensuremath{\delta}}
\DeclareUnicodeCharacter{03B5}{\ensuremath{\epsilon}}
\DeclareUnicodeCharacter{03B6}{\ensuremath{\zeta}}
\DeclareUnicodeCharacter{03B7}{\ensuremath{\eta}}
\DeclareUnicodeCharacter{03B8}{\ensuremath{\theta}}
\DeclareUnicodeCharacter{03B9}{\ensuremath{\iota}}
\DeclareUnicodeCharacter{03BA}{\ensuremath{\kappa}}
\DeclareUnicodeCharacter{03BB}{\ensuremath{\lambda}}
\DeclareUnicodeCharacter{03BC}{\ensuremath{\mu}}
\DeclareUnicodeCharacter{03BD}{\ensuremath{\nu}}
\DeclareUnicodeCharacter{03BE}{\ensuremath{\xi}}
\DeclareUnicodeCharacter{03C0}{\ensuremath{\pi}}
\DeclareUnicodeCharacter{03C1}{\ensuremath{\rho}}
\DeclareUnicodeCharacter{03C3}{\ensuremath{\sigma}}
\DeclareUnicodeCharacter{03C4}{\ensuremath{\tau}}
\DeclareUnicodeCharacter{03C5}{\ensuremath{\upsilon}}
\DeclareUnicodeCharacter{03C6}{\ensuremath{\phi}}
\DeclareUnicodeCharacter{03C7}{\ensuremath{\chi}}
\DeclareUnicodeCharacter{03C8}{\ensuremath{\psi}}
\DeclareUnicodeCharacter{03C9}{\ensuremath{\omega}}
\DeclareUnicodeCharacter{2113}{\ensuremath{\ell}}
\DeclareUnicodeCharacter{2200}{\ensuremath{\forall}}
\DeclareUnicodeCharacter{2203}{\ensuremath{\exists}}
\DeclareUnicodeCharacter{2205}{\ensuremath{\varnothing}}
\DeclareUnicodeCharacter{221E}{\ensuremath{\infty}}
\DeclareUnicodeCharacter{2227}{\ensuremath{\wedge}}
\DeclareUnicodeCharacter{2228}{\ensuremath{\vee}}
\DeclareUnicodeCharacter{2292}{\ensuremath{\to}}
\DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}}
\DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}}
\DeclareUnicodeCharacter{27E8}{\ensuremath{\langle}}
\DeclareUnicodeCharacter{27E9}{\ensuremath{\rangle}}
\DeclareUnicodeCharacter{27EA}{\ensuremath{\llangle}}
\DeclareUnicodeCharacter{27EB}{\ensuremath{\rrangle}}
\DeclareUnicodeCharacter{301A}{\ensuremath{\llbracket}}
\DeclareUnicodeCharacter{301B}{\ensuremath{\rrbracket}}
\DeclareUnicodeCharacter{21D2}{\ensuremath{\Rightarrow}}
\DeclareUnicodeCharacter{22A2}{\ensuremath{\vdash}}
\DeclareUnicodeCharacter{2020}{\ensuremath{\dagger}}
\DeclareUnicodeCharacter{2026}{\ensuremath{\ldots}}
\DeclareUnicodeCharacter{2080}{\ensuremath{_0}}
\DeclareUnicodeCharacter{2081}{\ensuremath{_1}}
\DeclareUnicodeCharacter{2082}{\ensuremath{_2}}
\DeclareUnicodeCharacter{2083}{\ensuremath{_3}}
\DeclareUnicodeCharacter{2084}{\ensuremath{_4}}
\DeclareUnicodeCharacter{2085}{\ensuremath{_5}}
\DeclareUnicodeCharacter{2086}{\ensuremath{_6}}
\DeclareUnicodeCharacter{2087}{\ensuremath{_7}}
\DeclareUnicodeCharacter{2088}{\ensuremath{_8}}
\DeclareUnicodeCharacter{2089}{\ensuremath{_9}}
\DeclareUnicodeCharacter{21A6}{\ensuremath{\mapsto}}
\DeclareUnicodeCharacter{2208}{\ensuremath{\in}}
\DeclareUnicodeCharacter{2229}{\ensuremath{\cap}}
\DeclareUnicodeCharacter{222A}{\ensuremath{\cup}}
\DeclareUnicodeCharacter{22EE}{\ensuremath{\vdots}}
\DeclareUnicodeCharacter{22EF}{\ensuremath{\cdots}}
\DeclareUnicodeCharacter{22F0}{\ensuremath{\iddots}}
\DeclareUnicodeCharacter{22F1}{\ensuremath{\ddots}}
\DeclareUnicodeCharacter{2260}{\ensuremath{\ne}}
\DeclareUnicodeCharacter{2264}{\ensuremath{\le}}
\DeclareUnicodeCharacter{2265}{\ensuremath{\ge}}
\DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}}
\DeclareUnicodeCharacter{22A5}{\ensuremath{\bot}}
\DeclareUnicodeCharacter{22EF}{\ensuremath{\cdots}}
\DeclareUnicodeCharacter{2713}{\ensuremath{\checkmark}}
\DeclareUnicodeCharacter{2217}{\ensuremath{\star}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment