Last active
March 3, 2021 12:27
-
-
Save ComFreek/da714a427be7b174ea428f881dc91902 to your computer and use it in GitHub Desktop.
Make LaTeX colons have the spacing of \colon, e.g. for typing judgements.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[]{article} | |
% Make `:` behave as if you typed `\colon`. | |
% In particular, this allows you to concisely write `t: A` for a typing assertion while still | |
% getting the correct spacing of `\colon`. | |
% | |
% source: <https://chat.stackexchange.com/transcript/message/56900862#56900862> | |
% author: Skillmon <https://tex.stackexchange.com/users/117050/skillmon> | |
\begingroup | |
\lccode`\~=`\: | |
\lowercase{\endgroup\def~}{\colon} | |
\AtBeginDocument{\mathcode`\:="8000 } | |
\begin{document} | |
% Both lines have the same spacing | |
$a\colon b$\par | |
$a: b$\par | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment