Created
January 5, 2023 19:44
-
-
Save exaexa/56015a6cfba7bbb3b9bb3901a1da956f to your computer and use it in GitHub Desktop.
table magicks
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
\newif\ifglzcont | |
\def\glz{\glzconttrue\expandafter\glzi} | |
\def\glzi#1{\glzchar{#1}\ifglzcont\expandafter\glzi\else\expandafter\glzeat\fi} | |
\def\glzeat#1 {\textcolor{black!50}{#1}} | |
\def\glzchar#1{% | |
\if0#1\textcolor{black!20}{#1}\glzconttrue\else% | |
\if.#1.\glzconttrue\else% | |
#1\glzcontfalse% | |
\fi\fi} | |
\let\G\glz % glz = grayed leading zeroes | |
% USE | |
\G0.00123 & \G0.01234 \\ | |
% unfortunately \glzeat requires a trailing space but that's usually not an issue in tables. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment