Skip to content

Instantly share code, notes, and snippets.

@exaexa
Created January 5, 2023 19:44
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 exaexa/56015a6cfba7bbb3b9bb3901a1da956f to your computer and use it in GitHub Desktop.
Save exaexa/56015a6cfba7bbb3b9bb3901a1da956f to your computer and use it in GitHub Desktop.
table magicks
\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