Skip to content

Instantly share code, notes, and snippets.

View dvdmrn's full-sized avatar
💀
everything is fine

dvdmrn

💀
everything is fine
View GitHub Profile
@dvdmrn
dvdmrn / comments.tex
Last active September 27, 2023 23:07
A simple way to define inline comments for LaTeX. Extend with your own colours (e.g. xcolor package) and use cases (e.g. todos)
\usepackage{tcolorbox}
\newcommand{\setCommenter}[3]{
\expandafter\newcommand\csname #1\endcsname[1]{\textcolor{#3}{\tcbox[on line, boxsep=0pt, left=2pt, right=2pt, top=2pt, bottom=2pt, colback=#3!80!white, arc=4pt, colframe=white, fontupper=\color{white}]{#2} [##1]}}
}
% define your comments here
\setCommenter{alice}{Alice A.}{blue}
\setCommenter{bob}{Bob B.}{red}